From 7d64b11c284db39f28139962f14c8c9da4c132dd Mon Sep 17 00:00:00 2001 From: Dennis Kliban Date: Tue, 8 Oct 2019 12:05:00 -0400 Subject: [PATCH] Use environment variable to set db username for unit test runs re: #5425 https://pulp.plan.io/issues/5425 --- templates/travis/.travis/script.sh.j2 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/travis/.travis/script.sh.j2 b/templates/travis/.travis/script.sh.j2 index 398df6eb..4ddcfa2b 100755 --- a/templates/travis/.travis/script.sh.j2 +++ b/templates/travis/.travis/script.sh.j2 @@ -89,8 +89,7 @@ export CMD_STDIN_PREFIX="sudo kubectl exec -i $PULP_API_POD --" #alias pytest="$CMD_PREFIX pytest" # Run unit tests. -$CMD_PREFIX bash -c "sed \"s/'USER': 'pulp'/'USER': 'postgres'/g\" /etc/pulp/settings.py > unit-test.py" -$CMD_PREFIX bash -c "PULP_SETTINGS=/unit-test.py django-admin test --noinput /usr/local/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/{{ plugin_snake }}/tests/unit/" +$CMD_PREFIX bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/{{ plugin_snake }}/tests/unit/" # Note: This function is in the process of being merged into after_failure show_logs_and_return_non_zero() {