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

repo management integration tests #1685

Merged
merged 41 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
dae60b6
repo man
chr-stian Feb 16, 2023
b64e1dc
more tests
chr-stian Mar 8, 2023
4da5ed8
WIP create dist
chr-stian Mar 10, 2023
f2f8c51
WIP create dist
chr-stian Mar 10, 2023
049ad4d
WIP more tests
chr-stian Mar 13, 2023
5edd335
WIP more tests
chr-stian Mar 14, 2023
9804fa1
WIP method to verify
chr-stian Mar 14, 2023
c622959
WIP more tests
chr-stian Mar 15, 2023
827e7fb
WIP more tests, add parameters to URL
chr-stian Mar 16, 2023
3ec514f
WIP more tests
chr-stian Mar 16, 2023
e0f0daa
WIP more tests
chr-stian Mar 17, 2023
127fff1
WIP more tests
chr-stian Mar 17, 2023
1944b62
WIP more tests
chr-stian Mar 20, 2023
73f0bf1
refactor needed
chr-stian Mar 20, 2023
6194698
refactor needed WIP
chr-stian Mar 21, 2023
d3db725
refactor needed WIP
chr-stian Mar 21, 2023
cf891ab
refactor needed WIP
chr-stian Mar 23, 2023
6cd78bd
refactor needed WIP
chr-stian Mar 30, 2023
60b0f25
refactor needed WIP sync test
chr-stian Apr 3, 2023
24ed4da
refactor needed WIP sync test
chr-stian Apr 3, 2023
941a55d
repo management - roles remotes
chr-stian Apr 3, 2023
ab61f1d
more tests - WIP
chr-stian Apr 6, 2023
097537e
sync tests - WIP
chr-stian Apr 11, 2023
e13bb78
protected repos- WIP
chr-stian Apr 12, 2023
22d6cb9
rbac- WIP
chr-stian Apr 14, 2023
10babcf
rbac- WIP
chr-stian Apr 14, 2023
ea27238
rbac- WIP
chr-stian Apr 14, 2023
2fd2ae3
rbac- WIP
chr-stian Apr 14, 2023
5569e28
refactor WIP
chr-stian Apr 19, 2023
5c581dd
refactor WIP
chr-stian Apr 19, 2023
30fa300
refactor WIP
chr-stian Apr 19, 2023
381a6e7
add ci
chr-stian Apr 20, 2023
d323f65
add ci
chr-stian Apr 20, 2023
e818d00
add ci
chr-stian Apr 20, 2023
a70d7f3
add changes and ci
chr-stian Apr 20, 2023
195b63f
fix sync tags
chr-stian Apr 20, 2023
6759556
fix other tests
chr-stian Apr 20, 2023
02b088d
lint
chr-stian Apr 20, 2023
bd4f6c4
lint and fix insights tests
chr-stian Apr 20, 2023
efbbd7d
flake
chr-stian Apr 20, 2023
7909076
delete commented out line
chr-stian Apr 20, 2023
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 .github/workflows/ci_standalone-iqe-rbac-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
# run: sudo apt install software-properties-common -y; sudo add-apt-repository --yes ppa:deadsnakes/ppa; sudo apt install python3.10

- name: run the integration tests
run: ./dev/standalone-iqe-rbac-tests/RUN_INTEGRATION.sh
run: ./dev/standalone-iqe-tests/RUN_RBAC_INTEGRATION.sh
58 changes: 58 additions & 0 deletions .github/workflows/ci_standalone-rbac-on-repos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Standalone RBAC on Repositories tests
on:
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'CHANGES/**'
push:
branches:
- '**'
workflow_dispatch:

jobs:

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Update apt
run: sudo apt -y update

- name: Install LDAP requirements
run: sudo apt-get install -y libsasl2-dev python3 libldap2-dev libssl-dev build-essential

- name: Install docker-compose
run: pip3 install --upgrade docker-compose

- name: create the .compose.env file
run: rm -f .compose.env; cp .compose.env.example .compose.env

- name: workaround github worker permissions issues
run: sed -i.bak 's/PIP_EDITABLE_INSTALL=1/PIP_EDITABLE_INSTALL=0/' .compose.env

- name: workaround github worker permissions issues
run: sed -i.bak 's/WITH_DEV_INSTALL=1/WITH_DEV_INSTALL=0/' .compose.env

- name: build stack
run: make docker/all

- name: start the compose stack
run: ./compose up -d

- name: give stack some time to spin up
run: COMPOSE_INTERACTIVE_NO_CLI=1 python dev/common/poll.py

- name: set keyring on staging repo for signature upload
run: ./compose exec -T api ./entrypoint.sh manage set-repo-keyring --repository staging --keyring /etc/pulp/certs/galaxy.kbx -y

- name: run the integration tests
run: ./dev/standalone-iqe-tests/RUN_RBAC_REPOS_INTEGRATION.sh
58 changes: 58 additions & 0 deletions .github/workflows/ci_standalone-x-repo-search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Standalone Cross Repository Search tests
on:
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
- 'CHANGES/**'
push:
branches:
- '**'
workflow_dispatch:

jobs:

integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Update apt
run: sudo apt -y update

- name: Install LDAP requirements
run: sudo apt-get install -y libsasl2-dev python3 libldap2-dev libssl-dev build-essential

- name: Install docker-compose
run: pip3 install --upgrade docker-compose

- name: create the .compose.env file
run: rm -f .compose.env; cp .compose.env.example .compose.env

- name: workaround github worker permissions issues
run: sed -i.bak 's/PIP_EDITABLE_INSTALL=1/PIP_EDITABLE_INSTALL=0/' .compose.env

- name: workaround github worker permissions issues
run: sed -i.bak 's/WITH_DEV_INSTALL=1/WITH_DEV_INSTALL=0/' .compose.env

- name: build stack
run: make docker/all

- name: start the compose stack
run: ./compose up -d

- name: give stack some time to spin up
run: COMPOSE_INTERACTIVE_NO_CLI=1 python dev/common/poll.py

- name: set keyring on staging repo for signature upload
run: ./compose exec -T api ./entrypoint.sh manage set-repo-keyring --repository staging --keyring /etc/pulp/certs/galaxy.kbx -y

- name: run the integration tests
run: ./dev/standalone-iqe-tests/RUN_X_REPO_SEARCH_INTEGRATION.sh
1 change: 1 addition & 0 deletions CHANGES/2125.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Implement integration tests for Repository Management feature
4 changes: 2 additions & 2 deletions dev/common/RUN_INTEGRATION.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ $VENVPATH/bin/pip show epdb || pip install epdb
# export HUB_LOCAL=1
# dev/common/RUN_INTEGRATION.sh --pdb -sv --log-cli-level=DEBUG "-m standalone_only" -k mytest
if [[ -z $HUB_LOCAL ]]; then
$VENVPATH/bin/pytest --capture=no -m "not standalone_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync" $@ -v galaxy_ng/tests/integration
$VENVPATH/bin/pytest --capture=no -m "not standalone_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync and not rm_sync and not x_repo_search and not rbac_repos" $@ -v galaxy_ng/tests/integration
RC=$?
else
$VENVPATH/bin/pytest --capture=no -m "not cloud_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync" -v $@ galaxy_ng/tests/integration
$VENVPATH/bin/pytest --capture=no -m "not cloud_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync and not rm_sync and not x_repo_search and not rbac_repos" -v $@ galaxy_ng/tests/integration
RC=$?

if [[ $RC != 0 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion dev/common/RUN_INTEGRATION_STAGE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ pip3 install --upgrade pip wheel

pip3 install -r integration_requirements.txt

pytest --log-cli-level=DEBUG -m "not standalone_only and not community_only and not rbac_roles and not slow_in_cloud and not iqe_rbac_test and not sync" --junitxml=galaxy_ng-results.xml -v galaxy_ng/tests/integration
pytest --log-cli-level=DEBUG -m "not standalone_only and not community_only and not rbac_roles and not slow_in_cloud and not iqe_rbac_test and not sync and not rm_sync and not x_repo_search and not rbac_repos" --junitxml=galaxy_ng-results.xml -v galaxy_ng/tests/integration
2 changes: 1 addition & 1 deletion dev/ephemeral/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ${VENV_PATH}/bin/pip install -r integration_requirements.txt

echo "Running pytest ..."
${VENV_PATH}/bin/pytest \
--capture=no -m "cloud_only or (not standalone_only and not community_only and not sync)" \
--capture=no -m "cloud_only or (not standalone_only and not community_only and not sync and not rm_sync and not x_repo_search and not rbac_repos)" \
-v \
galaxy_ng/tests/integration $@
RC=$?
Expand Down
2 changes: 1 addition & 1 deletion dev/insights/RUN_INTEGRATION.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pip show epdb || pip install epdb
# export HUB_LOCAL=1
# dev/common/RUN_INTEGRATION.sh --pdb -sv --log-cli-level=DEBUG "-m standalone_only" -k mytest

pytest --capture=no --tb=short -m "not standalone_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync" $@ -v galaxy_ng/tests/integration
pytest --capture=no --tb=short -m "not standalone_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync and not rm_sync and not x_repo_search and not rbac_repos" $@ -v galaxy_ng/tests/integration
RC=$?

exit $RC
2 changes: 1 addition & 1 deletion dev/standalone-certified-sync/RUN_INTEGRATION.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ $VENVPATH/bin/pip show epdb || pip install epdb
# when running user can specify extra pytest arguments such as
# export HUB_LOCAL=1
# dev/common/RUN_INTEGRATION.sh --pdb -sv --log-cli-level=DEBUG "-m standalone_only" -k mytest
$VENVPATH/bin/pytest --capture=no -m "certified_sync" -v $@ galaxy_ng/tests/integration
$VENVPATH/bin/pytest --capture=no -m "certified_sync or rm_sync" -v $@ galaxy_ng/tests/integration
RC=$?

if [[ $RC != 0 ]]; then
Expand Down
36 changes: 36 additions & 0 deletions dev/standalone-iqe-tests/RUN_RBAC_REPOS_INTEGRATION.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

unset NAMESPACE
unset HUB_AUTH_URL
export HUB_USE_MOVE_ENDPOINT="true"


VENVPATH=/tmp/gng_testing
PIP=${VENVPATH}/bin/pip

if [[ ! -d $VENVPATH ]]; then
python3.10 -m venv $VENVPATH
fi
source $VENVPATH/bin/activate
echo "PYTHON: $(which python)"

$VENVPATH/bin/pip install -r integration_requirements.txt
$VENVPATH/bin/pip show epdb || pip install epdb

echo "Setting up test data"
docker exec -i galaxy_ng_api_1 /entrypoint.sh manage shell < dev/common/setup_test_data.py

$VENVPATH/bin/pytest --capture=no -m "rbac_repos" -v $@ galaxy_ng/tests/integration
RC=$?

if [[ $RC != 0 ]]; then
# dump the api logs
docker logs galaxy_ng_api_1

# dump the worker logs
docker logs galaxy_ng_worker_1
fi

exit $RC
36 changes: 36 additions & 0 deletions dev/standalone-iqe-tests/RUN_X_REPO_SEARCH_INTEGRATION.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

unset NAMESPACE
unset HUB_AUTH_URL
export HUB_USE_MOVE_ENDPOINT="true"


VENVPATH=/tmp/gng_testing
PIP=${VENVPATH}/bin/pip

if [[ ! -d $VENVPATH ]]; then
python3.10 -m venv $VENVPATH
fi
source $VENVPATH/bin/activate
echo "PYTHON: $(which python)"

$VENVPATH/bin/pip install -r integration_requirements.txt
$VENVPATH/bin/pip show epdb || pip install epdb

echo "Setting up test data"
docker exec -i galaxy_ng_api_1 /entrypoint.sh manage shell < dev/common/setup_test_data.py

$VENVPATH/bin/pytest --capture=no -m "x_repo_search" -v $@ galaxy_ng/tests/integration
RC=$?

if [[ $RC != 0 ]]; then
# dump the api logs
docker logs galaxy_ng_api_1

# dump the worker logs
docker logs galaxy_ng_worker_1
fi

exit $RC
2 changes: 1 addition & 1 deletion dev/standalone/RUN_INTEGRATION.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export HUB_USE_MOVE_ENDPOINT=true
# dev/common/RUN_INTEGRATION.sh --pdb -sv --log-cli-level=DEBUG "-m standalone_only" -k mytest
pytest \
--capture=no \
-m "not cloud_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync and not certified_sync" \
-m "not cloud_only and not community_only and not rbac_roles and not iqe_rbac_test and not sync and not certified_sync and not x_repo_search and not rm_sync and not rbac_repos" \
-v $@ galaxy_ng/tests/integration
RC=$?

Expand Down
Loading