Skip to content

Change to allow pulp_file/certguard functional tests to work again. #177

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions base/container_scripts/install_functional_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ set -e

declare PROJECT="$1"

if [ $PROJECT == "pulp_file" ]
if [[ ${PROJECT} == "pulp_file" || ${PROJECT} == "pulp_certguard" ]]
then
declare PROJECT="pulpcore"
fi

if [ ! -d "/src/$PROJECT/" ]
if [ ! -d "/src/${PROJECT}/" ]
then
echo "Please clone $PROJECT into ../$PROJECT/"
echo "Please clone ${PROJECT} into ../${PROJECT}/"
exit 1
fi

cd "/src/$PROJECT/"
cd "/src/${PROJECT}/"

if [[ -f functest_requirements.txt ]]; then
pip3 install -r functest_requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions base/container_scripts/install_lint_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ set -e

declare PROJECT="$1"

if [ $PROJECT == "pulp_file" ]
if [[ ${PROJECT} == "pulp_file" || ${PROJECT} == "pulp_certguard" ]]
then
declare PROJECT="pulpcore"
fi

if [ ! -d "/src/$PROJECT/" ]
if [ ! -d "/src/${PROJECT}/" ]
then
echo "Please clone $PROJECT into ../$PROJECT/"
echo "Please clone ${PROJECT} into ../${PROJECT}/"
exit 1
fi

cd "/src/$PROJECT/"
cd "/src/${PROJECT}/"

if [[ -f lint_requirements.txt ]]; then
pip install -r lint_requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions base/container_scripts/install_performance_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ set -e

declare PROJECT="$1"

if [ $PROJECT == "pulp_file" ]
if [[ ${PROJECT} == "pulp_file" || ${PROJECT} == "pulp_certguard" ]]
then
declare PROJECT="pulpcore"
fi

if [ ! -d "/src/$PROJECT/" ]
if [ ! -d "/src/${PROJECT}/" ]
then
echo "Please clone $PROJECT into ../$PROJECT/"
echo "Please clone ${PROJECT} into ../${PROJECT}/"
exit 1
fi

cd "/src/$PROJECT/"
cd "/src/${PROJECT}/"

if [[ -f perftest_requirements.txt ]]; then
pip install -r perftest_requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions base/container_scripts/install_unit_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ set -e

declare PROJECT=$1

if [ $PROJECT == "pulp_file" ]
if [[ ${PROJECT} == "pulp_file" || ${PROJECT} == "pulp_certguard" ]]
then
declare PROJECT="pulpcore"
fi

if [ ! -d "/src/$PROJECT/" ]
if [ ! -d "/src/${PROJECT}/" ]
then
echo "Please clone $PROJECT into ../$PROJECT/"
echo "Please clone ${PROJECT} into ../${PROJECT}/"
exit 1
fi

cd "/src/$PROJECT/"
cd "/src/${PROJECT}/"

if [[ -f unittest_requirements.txt ]]; then
pip install -r unittest_requirements.txt
Expand Down
9 changes: 4 additions & 5 deletions base/container_scripts/run_functional_tests.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

declare PACKAGE="$1"
declare PROJECT="${PACKAGE//-/_}"

set -e

if [ $PACKAGE == "pulp_file" ]
if [[ ${PACKAGE} == "pulp_file" || ${PACKAGE} == "pulp_certguard" ]]
then
declare PACKAGE="pulpcore"
fi

declare PROJECT="${PACKAGE//-/_}"
cd "/src/${PACKAGE}/"

function check_pytest () {
sudo -u pulp -E type pytest || {
Expand Down Expand Up @@ -41,9 +42,7 @@ EOF
}
}

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 pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "${PROJECT}.tests.functional" "${@:2}"
6 changes: 2 additions & 4 deletions base/container_scripts/run_lint_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

declare PACKAGE="$1"

if [ $PACKAGE == "pulp_file" ]
if [[ $PACKAGE == "pulp_file" || ${PACKAGE} == "pulp_certguard" ]]
then
declare PACKAGE="pulpcore"
fi

declare PROJECT="${PACKAGE//-/_}"

set -e

export XDG_CONFIG_HOME=/opt/scripts/
Expand All @@ -19,7 +17,7 @@ black --check --diff .

if [[ -f flake8.cfg ]];
then
flake8 --config flake8.cfg "$PROJECT"
flake8 --config flake8.cfg "${PACKAGE}"
else
flake8
fi
Expand Down
10 changes: 5 additions & 5 deletions base/container_scripts/run_performance_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare PACKAGE="$1"

if [ $PACKAGE == "pulp_file" ]
declare PROJECT="${PACKAGE//-/_}"

if [[ ${PACKAGE} == "pulp_file" || ${PACKAGE} == "pulp_certguard" ]]
then
declare PACKAGE="pulpcore"
fi

declare PROJECT="${PACKAGE//-/_}"

set -e

function check_pytest () {
Expand Down Expand Up @@ -41,9 +41,9 @@ EOF
}
}

cd "/src/$PACKAGE/"
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 pytest -r sx --rootdir=/var/lib/pulp --color=yes --pyargs "${PROJECT}.tests.performance" "${@:2}"
9 changes: 4 additions & 5 deletions base/container_scripts/run_unit_tests.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/bin/bash

declare PACKAGE="$1"
declare PROJECT="${PACKAGE//-/_}"

if [ $PACKAGE == "pulp_file" ]
if [[ ${PACKAGE} == "pulp_file" || ${PACKAGE} == "pulp_certguard" ]]
then
declare PACKAGE="pulpcore"
fi

declare PROJECT="${PACKAGE//-/_}"

set -e

cd "/src/$PACKAGE/"
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 pytest -r sx --color=yes --pyargs "${PROJECT}.tests.unit" "${@:2}"