-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
141 additions
and
89 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,88 +29,113 @@ function run_install() { | |
fi | ||
} | ||
|
||
function join_by { | ||
local d=${1-} f=${2-} | ||
if shift 2; then | ||
printf %s "$f" "${@/#/$d}" | ||
fi | ||
} | ||
|
||
function run_multiple_install() { | ||
cmd=$(join_by ";" "${@}") | ||
function run_install_must_fail() { | ||
if [ -z "${RUN_PIP_TESTS_EXECUTOR-}" ] | ||
then | ||
eval "bash -e -c \"${cmd[@]}\"" | ||
if [ -z "${DRY_RUN_OPTION-}" ] | ||
then | ||
eval $@ && return 1 || return 0; | ||
else | ||
eval $@ | ||
fi | ||
else | ||
eval "$RUN_PIP_TESTS_EXECUTOR bash -e -c \"${cmd[@]}\"" | ||
if [ -z "${DRY_RUN_OPTION-}" ] | ||
then | ||
eval "$RUN_PIP_TESTS_EXECUTOR $PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl $@" && return 1 || return 0; | ||
else | ||
eval "$RUN_PIP_TESTS_EXECUTOR $PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl $@" | ||
fi | ||
fi | ||
} | ||
|
||
|
||
echo ./install_via_pip.pl with empty | ||
TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/empty_test_file --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "" | ||
#echo ./install_via_pip.pl with empty | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/empty_test_file --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "" | ||
#echo | ||
# | ||
#echo ./install_via_pip.pl without versions | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl without versions and --ignore-installed | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --ignore-installed --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --ignore-installed --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl without versions and --use-deprecated-legacy-resolver | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --use-deprecated-legacy-resolver --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --use-deprecated=legacy-resolver --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with versions, without allow-no-version | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/all_versions_specified --with-versions --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.21.0'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with versions, with allow-no-version, all versions specified | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/all_versions_specified --with-versions --allow-no-version --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.21.0'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with versions, with allow-no-version, some versions missing | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/some_missing_versions --with-versions --allow-no-version --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with versions, with allow-no-version-for-urls, file with urls | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/with_urls --with-versions --allow-no-version-for-urls --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.27.1' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with versions, with allow-no-version-for-urls, file with urls and some missing versions | ||
#run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/with_urls_some_missing_versions --with-versions --allow-no-version-for-urls --python-binary python3 "$DRY_RUN_OPTION" || echo PASSED | ||
#echo | ||
# | ||
# | ||
#echo ./install_via_pip.pl with pip version syntax | ||
#TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/pip_version_syntax --python-binary python3 "$DRY_RUN_OPTION") | ||
#assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests>=2.21.0' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
#echo | ||
# | ||
# | ||
echo ./install_via_pip.pl installing a package twice with different versions must fail | ||
TEST_OUTPUT=$(run_install_must_fail "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/same_pkg/step2 --ancestor-pip-package-root-path test_files/pip/version_conflict/same_pkg/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'azure-common==1.1.28' 'azure-common==1.1.4'" | ||
echo | ||
|
||
echo ./install_via_pip.pl without versions | ||
TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl without versions and --ignore-installed | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --ignore-installed --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --ignore-installed --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl without versions and --use-deprecated-legacy-resolver | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/without_versions --use-deprecated-legacy-resolver --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --use-deprecated=legacy-resolver --no-cache-dir 'humanfriendly' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with versions, without allow-no-version | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/all_versions_specified --with-versions --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.21.0'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with versions, with allow-no-version, all versions specified | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/all_versions_specified --with-versions --allow-no-version --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.21.0'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with versions, with allow-no-version, some versions missing | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/some_missing_versions --with-versions --allow-no-version --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo ./install_via_pip.pl installing with ancestors but all empty | ||
TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/empty/step2 --ancestor-pip-package-root-path test_files/pip/empty/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with versions, with allow-no-version-for-urls, file with urls | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/with_urls --with-versions --allow-no-version-for-urls --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests==2.27.1' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo ./install_via_pip.pl installing with ancestors and correct dependency | ||
TEST_OUTPUT=$(run_install "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/no_version_conflict/dependency_already_installed/step2 --ancestor-pip-package-root-path test_files/pip/no_version_conflict/dependency_already_installed/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'azure-batch==1.0.0' 'azure-common==1.1.4'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with versions, with allow-no-version-for-urls, file with urls and some missing versions | ||
"$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/with_versions/with_urls_some_missing_versions --with-versions --allow-no-version-for-urls --python-binary python3 "$DRY_RUN_OPTION" || echo PASSED | ||
echo ./install_via_pip.pl installing with ancestors and dependency with wrong version must fail | ||
TEST_OUTPUT=$(run_install_must_fail "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/dependency_already_installed/step2 --ancestor-pip-package-root-path test_files/pip/version_conflict/dependency_already_installed/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'azure-batch==1.0.0' 'azure-common==1.1.28'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl with pip version syntax | ||
TEST_OUTPUT=$("$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl" --file test_files/pip/pip_version_syntax --python-binary python3 "$DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'humanfriendly==9.1' 'requests>=2.21.0' 'git+http://github.com/exasol/[email protected]#egg=exasol-bucketfs-utils-python'" | ||
echo ./install_via_pip.pl installing with ancestors and package which has a dependency to an older package must fail | ||
TEST_OUTPUT=$(run_install_must_fail "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/other_package_with_older_dependency_already_installed/step2 --ancestor-pip-package-root-path test_files/pip/version_conflict/other_package_with_older_dependency_already_installed/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'azure-batch==1.0.0' 'azure-storage-queue==1.1.0'" | ||
echo | ||
|
||
|
||
echo ./install_via_pip.pl installing a package twice with different versions | ||
run_multiple_install \ | ||
"$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/step1 --python-binary python3 --with-versions $DRY_RUN_OPTION" \ | ||
"$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/step2 --python-binary python3 --with-versions $DRY_RUN_OPTION" | ||
echo ./install_via_pip.pl installing with ancestors and package which has a dependency to a newer package must fail | ||
TEST_OUTPUT=$(run_install_must_fail "$PATH_TO_INSTALL_SCRIPTS/install_via_pip.pl --file test_files/pip/version_conflict/other_package_with_newer_dependency_already_installed/step2 --ancestor-pip-package-root-path test_files/pip/version_conflict/other_package_with_newer_dependency_already_installed/build_info/packages --python-binary python3 --with-versions $DRY_RUN_OPTION") | ||
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip install --no-cache-dir 'azure-batch==1.0.0' 'azure-storage-queue==1.1.0'" | ||
echo | ||
|
||
|
||
check_for_failed_tests | ||
echo "All pip tests passed" |
Empty file.
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 @@ | ||
|
1 change: 1 addition & 0 deletions
1
...sion_conflict/dependency_already_installed/build_info/packages/step1/python3_pip_packages
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 @@ | ||
azure-common|1.1.4 |
2 changes: 2 additions & 0 deletions
2
...sts/install_scripts/test_files/pip/no_version_conflict/dependency_already_installed/step2
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,2 @@ | ||
azure-batch|1.0.0 #depends on azure-common1.1.4 | ||
|
1 change: 1 addition & 0 deletions
1
...sion_conflict/dependency_already_installed/build_info/packages/step1/python3_pip_packages
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 @@ | ||
azure-common|1.1.28 |
1 change: 1 addition & 0 deletions
1
.../tests/install_scripts/test_files/pip/version_conflict/dependency_already_installed/step2
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 @@ | ||
azure-batch|1.0.0 #depends on azure-common1.1.4 |
1 change: 1 addition & 0 deletions
1
...ge_with_newer_dependency_already_installed/build_info/packages/step1/python3_pip_packages
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 @@ | ||
azure-batch|1.0.0 #depends on azure-common1.1.4 |
2 changes: 2 additions & 0 deletions
2
...st_files/pip/version_conflict/other_package_with_newer_dependency_already_installed/step2
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,2 @@ | ||
azure-storage-queue|1.1.0 #depends on azure-common>=1.1.28 | ||
|
1 change: 1 addition & 0 deletions
1
...ge_with_older_dependency_already_installed/build_info/packages/step1/python3_pip_packages
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 @@ | ||
azure-storage-queue|1.1.0 #depends on azure-common>=1.1.28 |
1 change: 1 addition & 0 deletions
1
...st_files/pip/version_conflict/other_package_with_older_dependency_already_installed/step2
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 @@ | ||
azure-batch|1.0.0 #depends on azure-common1.1.4 |
1 change: 1 addition & 0 deletions
1
...l_scripts/test_files/pip/version_conflict/same_pkg/build_info/packages/step1/apt_packages
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 @@ | ||
should be ignored |
1 change: 1 addition & 0 deletions
1
...s/test_files/pip/version_conflict/same_pkg/build_info/packages/step1/python3_pip_packages
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 @@ | ||
azure-common|1.1.4 |
2 changes: 2 additions & 0 deletions
2
ext/scripts/tests/install_scripts/test_files/pip/version_conflict/same_pkg/step2
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,2 @@ | ||
azure-common|1.1.28 | ||
|
1 change: 0 additions & 1 deletion
1
ext/scripts/tests/install_scripts/test_files/pip/version_conflict/step1
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
ext/scripts/tests/install_scripts/test_files/pip/version_conflict/step2
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.