Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use module name (-m) to run pytest and pip #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/container_scripts/install_lint_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ fi
cd "/src/$PROJECT/"

if [[ -f lint_requirements.txt ]]; then
pip install -r lint_requirements.txt
python3 -m pip install -r lint_requirements.txt
fi
4 changes: 2 additions & 2 deletions base/container_scripts/install_performance_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fi
cd "/src/$PROJECT/"

if [[ -f perftest_requirements.txt ]]; then
pip install -r perftest_requirements.txt
python3 -m pip install -r perftest_requirements.txt
elif [[ -f functest_requirements.txt ]]; then
pip install -r functest_requirements.txt
python3 -m pip install -r functest_requirements.txt
fi
4 changes: 2 additions & 2 deletions base/container_scripts/install_unit_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ then
exit 1
fi

pip install git+https://github.com/pulp/pulp-smash.git
python3 -m pip install git+https://github.com/pulp/pulp-smash.git

cd "/src/$PROJECT/"

if [[ -f unittest_requirements.txt ]]; then
pip install -r unittest_requirements.txt
python3 -m pip install -r unittest_requirements.txt
fi
4 changes: 2 additions & 2 deletions base/container_scripts/run_functional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi
declare PROJECT="${PACKAGE//-/_}"

function check_pytest () {
sudo -u pulp -E type pytest || {
sudo -u pulp -E python3 -m pytest --version || {
cat << EOF

ERROR: pytest is not installed
Expand Down Expand Up @@ -48,4 +48,4 @@ cd "/src/$PACKAGE/"
check_pytest
check_client

sudo -u pulp -E pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "$PROJECT.tests.functional" "${@:2}"
sudo -u pulp -E python3 -m pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "$PROJECT.tests.functional" "${@:2}"
4 changes: 2 additions & 2 deletions base/container_scripts/run_performance_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare PROJECT="${PACKAGE//-/_}"
set -e

function check_pytest () {
sudo -u pulp -E type pytest || {
sudo -u pulp -E python3 -m pytest --version || {
cat << EOF

ERROR: pytest is not installed
Expand Down Expand Up @@ -48,4 +48,4 @@ cd "/src/$PACKAGE/"
check_pytest
check_client

sudo -u pulp -E pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "$PROJECT.tests.performance" "${@:2}"
sudo -u pulp -E python3 -m pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "$PROJECT.tests.performance" "${@:2}"
2 changes: 1 addition & 1 deletion base/container_scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ source "/opt/oci_env/base/container_scripts/configure_pulp_smash.sh"

cd "/src/$PACKAGE/"

sudo -u pulp -E PULP_DATABASES__default__USER=postgres pytest -r sx --color=yes --pyargs "$PROJECT.tests.unit" "${@:2}"
sudo -u pulp -E PULP_DATABASES__default__USER=postgres python3 -m pytest -r sx --color=yes --pyargs "$PROJECT.tests.unit" "${@:2}"
2 changes: 1 addition & 1 deletion base/container_scripts/show_urls.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# this gives us the show_urls django command
pip show django-extensions || pip install django-extensions
python3 -m pip show django-extensions || python3 -m pip install django-extensions

pulpcore-manager show_urls
Loading