Skip to content

Commit

Permalink
Fixed bash unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Jun 4, 2024
1 parent 16e98bc commit bfd7c64
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions ext/scripts/tests/install_scripts/run_pip_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,44 @@ echo

echo ./install_via_pip.pl without versions
TEST_OUTPUT=$("$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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install --ignore-installed -c /tmp/pip_constraints.txt --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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install --use-deprecated=legacy-resolver -c /tmp/pip_constraints.txt --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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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=$("$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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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
Expand All @@ -62,7 +69,8 @@ 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'"
assert "$TEST_OUTPUT" "Dry-Run: python3 -m pip freeze | grep '==' | sed 's/==/>=/' > /tmp/pip_constraints.txt
Dry-Run: python3 -m pip install -c /tmp/pip_constraints.txt --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
Expand Down

0 comments on commit bfd7c64

Please sign in to comment.