-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from bt-skyrise/release/0.3.0
Release/0.3.0 #36 fix: linux pg setup includes recreation of symbolic links #35 Print whole output of Postgres process #34 FolderSearch throws NotImplementedException #33 target multiple dotnet versions #25 - use combination of path's segments instead of concatenation #3 - include copyright of Johannes Hoppe (author of Mongo2Go project)
- Loading branch information
Showing
27 changed files
with
514 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# shell scripts | ||
*.sh text eol=lf | ||
|
||
# linux Pg dist links, libs | ||
pg-dist/pgsql-*-linux-binaries/**/lib*.so[\.\d]* binary | ||
pg-dist/pgsql-*-linux-binaries/bin/** binary | ||
pg-dist/pgsql-*-linux-binaries/lib/** binary | ||
pg-dist/pgsql-*-linux-binaries/share/** binary | ||
|
||
# windows Pg dist links, libs | ||
pg-dist/pgsql-*-windows64-binaries/bin/** binary | ||
pg-dist/pgsql-*-windows64-binaries/lib/** binary | ||
pg-dist/pgsql-*-windows64-binaries/share/** binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
pg-dist/pgsql-10.1-linux-binaries/scripts/fix_linux_pg_dist_lib_links.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/bin/bash | ||
|
||
declare -A PG_LIB_LINKS | ||
|
||
PG_LIB_LINKS=( | ||
["libpq.so"]="libpq.so.5.10" \ | ||
["libpq.so.5"]="libpq.so.5.10" \ | ||
["libpgtypes.so"]="libpgtypes.so.3.10" \ | ||
["libpgtypes.so.3"]="libpgtypes.so.3.10" \ | ||
["libicuuc.so"]="libicuuc.so.53.1" \ | ||
["libicuuc.so.53"]="libicuuc.so.53.1" \ | ||
["libicutu.so"]="libicutu.so.53.1" \ | ||
["libicutu.so.53"]="libicutu.so.53.1" \ | ||
["libicutest.so"]="libicutest.so.53.1" \ | ||
["libicutest.so.53"]="libicutest.so.53.1" \ | ||
["libiculx.so"]="libiculx.so.53.1" \ | ||
["libiculx.so.53"]="libiculx.so.53.1" \ | ||
["libicule.so"]="libicule.so.53.1" \ | ||
["libicule.so.53"]="libicule.so.53.1" \ | ||
["libicuio.so"]="libicuio.so.53.1" \ | ||
["libicuio.so.53"]="libicuio.so.53.1" \ | ||
["libicui18n.so"]="libicui18n.so.53.1" \ | ||
["libicui18n.so.53"]="libicui18n.so.53.1" \ | ||
["libicudata.so"]="libicudata.so.53.1" \ | ||
["libicudata.so.53"]="libicudata.so.53.1" \ | ||
["libecpg.so"]="libecpg.so.6.10" \ | ||
["libecpg.so.6"]="libecpg.so.6.10" \ | ||
["libecpg_compat.so"]="libecpg_compat.so.3.10" \ | ||
["libecpg_compat.so.3"]="libecpg_compat.so.3.10" \ | ||
["libcurl.so"]="libcurl.so.4.4.0" \ | ||
["libcurl.so.4"]="libcurl.so.4.4.0" \ | ||
) | ||
|
||
PG_BINARIES="$1" | ||
|
||
cd $PG_BINARIES | ||
cd ./../lib | ||
|
||
echo "Changed working_dir to $PWD" | ||
|
||
for link in ${!PG_LIB_LINKS[@]}; | ||
do | ||
if [[ -e $link ]] || [[ -h $link ]] | ||
then | ||
echo "Removing $link" | ||
rm $link | ||
else | ||
echo "Not found $link" | ||
fi | ||
|
||
target="${PG_LIB_LINKS[$link]}" | ||
echo "Create link $link targeting $target" | ||
ln -s $target $link | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
130 changes: 130 additions & 0 deletions
130
src/Postgres2Go.Tests/Helpers/FolderSearch/when_invoke_FindFolderUpwards.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
using System; | ||
using System.IO; | ||
using Xunit; | ||
using Postgres2Go.Helper.FileSystem; | ||
using Postgres2Go.Helper.Postgres; | ||
|
||
namespace Postgres2Go.Tests.Helpers.FolderSearch | ||
{ | ||
public class when_invoke_FindFolderUpwards : IDisposable | ||
{ | ||
private readonly Fixture _fixture; | ||
|
||
public when_invoke_FindFolderUpwards() | ||
{ | ||
_fixture = new Fixture(); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
_fixture?.Dispose(); | ||
} | ||
|
||
[Theory] | ||
[InlineData("a")] | ||
[InlineData(@"a\b")] | ||
[InlineData(@"a\b\c")] | ||
[InlineData(@"a\b\c\d")] | ||
[InlineData(@"a\b\c\d\e")] | ||
public void should_locate_directory_with_default_search_pattern(string executionPath) | ||
{ | ||
// PREPARE | ||
_fixture.CreateSubDirectoryIfNotExists( | ||
Path.Combine(@"packages\Postgres2Go-0.3.0", @"pg-dist\pgsql-10.1-windows64-binaries\bin") | ||
); | ||
|
||
string executionAbsPath = _fixture | ||
.CreateSubDirectoryIfNotExists(executionPath); | ||
|
||
string searchLocation = Path.Combine( | ||
PostgresBinaryLocator.NugetPackagesDirectoryPrefix, | ||
PostgresBinaryLocator.DefaultWindowsSearchPattern | ||
); | ||
|
||
// RUN | ||
string foundLocation = executionAbsPath | ||
.FindFolderUpwards(searchLocation); | ||
|
||
// ASSERT | ||
Assert.NotNull(foundLocation); | ||
} | ||
|
||
[Theory] | ||
[InlineData("a", @"packa*\Postgres2*\pg-dist\pgsql-*\bin")] | ||
[InlineData(@"a\b", @"packa*\Postgres2*\pg-dist\pgsql-*\bin")] | ||
[InlineData(@"a\b\c\d\e", @"packa*\Postgres2*\pg-dist\pgsql-*\bin")] | ||
public void should_locate_directory_using_custom_search_pattern(string executionPath, string searchPattern) | ||
{ | ||
// PREPARE | ||
_fixture.CreateSubDirectoryIfNotExists( | ||
Path.Combine(@"packages\Postgres2Go-0.3.0", @"pg-dist\pgsql-10.1-windows64-binaries\bin") | ||
); | ||
|
||
string executionAbsPath = _fixture | ||
.CreateSubDirectoryIfNotExists(executionPath); | ||
|
||
// RUN | ||
string foundLocation = executionAbsPath | ||
.FindFolderUpwards(searchPattern); | ||
|
||
// ASSERT | ||
Assert.NotNull(foundLocation); | ||
} | ||
|
||
[Theory] | ||
[InlineData(@"a\b\c\d\e\f")] | ||
[InlineData(@"a\b\c\d\e\f\g")] | ||
public void cannot_locate_directory_when_nest_level_greater_than_5(string executionPath) | ||
{ | ||
// PREPARE | ||
_fixture.CreateSubDirectoryIfNotExists( | ||
Path.Combine(@"packages\Postgres2Go-0.3.0", @"pg-dist\pgsql-10.1-windows64-binaries\bin") | ||
); | ||
|
||
string executionAbsPath = _fixture | ||
.CreateSubDirectoryIfNotExists(executionPath); | ||
|
||
string searchLocation = Path.Combine( | ||
PostgresBinaryLocator.NugetPackagesDirectoryPrefix, | ||
PostgresBinaryLocator.DefaultWindowsSearchPattern | ||
); | ||
|
||
// RUN | ||
string foundLocation = executionAbsPath | ||
.FindFolderUpwards(searchLocation); | ||
|
||
// ASSERT | ||
Assert.Null(foundLocation); | ||
|
||
} | ||
|
||
class Fixture : IDisposable | ||
{ | ||
internal string Root { get; private set; } | ||
|
||
public Fixture() | ||
{ | ||
Root = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | ||
|
||
if (!Directory.Exists(Root)) | ||
Directory.CreateDirectory(Root); | ||
} | ||
|
||
public string CreateSubDirectoryIfNotExists(string path) | ||
{ | ||
var subDirPath = Path.Combine(Root, path); | ||
|
||
if (!Directory.Exists(subDirPath)) | ||
Directory.CreateDirectory(subDirPath); | ||
|
||
return subDirPath; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
if (!Directory.Exists(Root)) | ||
Directory.Delete(Root); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.