diff --git a/.ci/ansible/smash-config.json b/.ci/ansible/smash-config.json index cd0e7d7b..701d9b4e 100644 --- a/.ci/ansible/smash-config.json +++ b/.ci/ansible/smash-config.json @@ -6,7 +6,7 @@ ], "selinux enabled": false, "version": "3", - "aiohttp_fixtures_origin": "172.18.0.1" + "aiohttp_fixtures_origin": "127.0.0.1" }, "hosts": [ { @@ -26,7 +26,7 @@ "pulp workers": {}, "redis": {}, "shell": { - "transport": "docker" + "transport": "local" } } } diff --git a/.github/template_gitref b/.github/template_gitref index 6e28718e..1b14876e 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-130-ge87b661 +2021.08.26-130-gf6574f2-dirty diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99243b18..8b39a582 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,7 +195,9 @@ jobs: GITHUB_REPO_SLUG: ${{ github.repository }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }} - + - name: Setup tmate session + if: always() + uses: mxschmitt/action-tmate@v3 - name: Extract Deprecations from Logs id: deprecations run: echo "::set-output name=deprecations-${{ matrix.env.TEST }}::$(docker logs pulp 2>&1 | grep -i pulpcore.deprecation | base64 -w 0)" diff --git a/.github/workflows/scripts/func_test_script.sh b/.github/workflows/scripts/func_test_script.sh index 2bcffe40..e51e2868 100755 --- a/.github/workflows/scripts/func_test_script.sh +++ b/.github/workflows/scripts/func_test_script.sh @@ -3,8 +3,8 @@ set -mveuo pipefail -pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m "parallel and not nightly" -n 8 -pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m "not parallel and not nightly" +cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'parallel and not nightly' -n 8" +cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel and not nightly'" if [ "${GITHUB_REF##refs/tags/}" != "${GITHUB_REF}" ] then @@ -16,11 +16,9 @@ then if [ ${PULPCORE_VERSION::3} == "3.9" ] then # Temporarily need to downgrade pulp-smash to run pulpcore 3.9 tests - pip install 'pulp-smash==1!0.12.0' + cmd_prefix bash -c "pip install 'pulp-smash==1!0.12.0'" fi fi -pip install -r ../pulpcore/functest_requirements.txt - -pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "parallel and not nightly" -n 8 -pytest -v -r sx --color=yes --pyargs pulpcore.tests.functional -m "not parallel and not nightly" +cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'parallel and not nightly' -n 8" +cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulpcore.tests.functional -m 'not parallel and not nightly'" diff --git a/.github/workflows/scripts/install.sh b/.github/workflows/scripts/install.sh index fc834117..e85e6889 100755 --- a/.github/workflows/scripts/install.sh +++ b/.github/workflows/scripts/install.sh @@ -22,9 +22,6 @@ if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then pip install -r doc_requirements.txt fi -pip install -e ../pulpcore -e ../pulp-certguard -pip install -r functest_requirements.txt - cd .ci/ansible/ TAG=ci_build @@ -68,6 +65,8 @@ plugins: source: $PULP_CERTGUARD - name: pulpcore source: ./pulpcore + - name: pulp-smash + source: ./pulp-smash VARSYAML fi @@ -78,6 +77,8 @@ services: volumes: - ./settings:/etc/pulp - ./ssh:/keys/ + - ~/.config:/root/.config + - ../../../pulp-openapi-generator:/root/pulp-openapi-generator VARSYAML cat >> vars/main.yaml << VARSYAML diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 96725267..4ad5a485 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -61,24 +61,33 @@ if [[ "$TEST" == "plugin-from-pypi" ]]; then git checkout ${COMPONENT_VERSION} -- pulp_file/tests/ fi +cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt" +cat functest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/functest_requirements.txt" +cmd_prefix pip3 install -r /tmp/unittest_requirements.txt +cmd_prefix pip3 install -r /tmp/functest_requirements.txt +cmd_prefix pip3 install --upgrade ../pulp-smash + cd ../pulp-openapi-generator +./generate.sh pulp_file python +cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_file-client +sudo rm -rf ./pulp_file-client ./generate.sh pulpcore python -pip install ./pulpcore-client -rm -rf ./pulpcore-client +cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client +sudo rm -rf ./pulpcore-client if [[ "$TEST" = 'bindings' ]]; then ./generate.sh pulpcore ruby 0 cd pulpcore-client gem build pulpcore_client.gemspec - gem install --both ./pulpcore_client-0.gem + cmd_prefix gem install --both /root/pulp-openapi-generator/pulpcore-client/pulpcore_client-0.gem fi ./generate.sh pulp_certguard python -pip install ./pulp_certguard-client -rm -rf ./pulp_certguard-client +cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_certguard-client +sudo rm -rf ./pulp_certguard-client if [[ "$TEST" = 'bindings' ]]; then ./generate.sh pulp-certguard ruby 0 cd pulp-certguard-client gem build pulp-certguard_client.gemspec - gem install --both ./pulp-certguard_client-0.gem + cmd_prefix gem install --both /root/pulp-openapi-generator/pulp-certguard-client/pulp-certguard_client-0.gem cd .. fi cd $REPO_ROOT @@ -93,8 +102,8 @@ if [[ "$TEST" = 'bindings' ]]; then exit fi -cat unittest_requirements.txt | cmd_stdin_prefix bash -c "cat > /tmp/unittest_requirements.txt" -cmd_prefix pip3 install -r /tmp/unittest_requirements.txt +CERTIFI=$(cmd_prefix python3 -c 'import certifi; print(certifi.where())') +cmd_prefix bash -c "cat /etc/pulp/certs/pulp_webserver.crt | tee -a "$CERTIFI" > /dev/null" # check for any uncommitted migrations echo "Checking for uncommitted migrations..." @@ -106,16 +115,13 @@ if [[ "$TEST" != "upgrade" ]]; then fi # Run functional tests -export PYTHONPATH=$REPO_ROOT/../pulp-certguard${PYTHONPATH:+:${PYTHONPATH}} -export PYTHONPATH=$REPO_ROOT${PYTHONPATH:+:${PYTHONPATH}} - if [[ "$TEST" == "upgrade" ]]; then # Handle app label change: sed -i "/require_pulp_plugins(/d" pulp_file/tests/functional/utils.py # Running pre upgrade tests: - pytest -v -r sx --color=yes --pyargs --capture=no pulp_file.tests.upgrade.pre + cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs --capture=no pulp_file.tests.upgrade.pre" # Checking out ci_upgrade_test branch and upgrading plugins cmd_prefix bash -c "cd pulpcore; git checkout -f ci_upgrade_test; pip install --upgrade --force-reinstall ." @@ -157,25 +163,25 @@ if [[ "$TEST" == "upgrade" ]]; then # Rebuilding bindings cd ../pulp-openapi-generator ./generate.sh pulpcore python - pip install ./pulpcore-client + cmd_prefix pip3 install /root/pulp-openapi-generator/pulpcore-client ./generate.sh pulp_file python - pip install ./pulp_file-client + cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_file-client ./generate.sh pulp_certguard python - pip install ./pulp_certguard-client + cmd_prefix pip3 install /root/pulp-openapi-generator/pulp_certguard-client cd $REPO_ROOT # Running post upgrade tests git checkout ci_upgrade_test -- pulp_file/tests/ - pytest -v -r sx --color=yes --pyargs --capture=no pulp_file.tests.upgrade.post + cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs --capture=no pulp_file.tests.upgrade.post" exit fi if [[ "$TEST" == "performance" ]]; then if [[ -z ${PERFORMANCE_TEST+x} ]]; then - pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance + cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance" else - pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance.test_$PERFORMANCE_TEST + cmd_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance.test_$PERFORMANCE_TEST" fi exit fi @@ -185,20 +191,20 @@ if [ -f $FUNC_TEST_SCRIPT ]; then else if [[ "$GITHUB_WORKFLOW" == "File Nightly CI/CD" ]]; then - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 - pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m "not parallel" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8" + cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel'" - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and parallel" -n 8 - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not parallel" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and parallel' -n 8" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not parallel'" else - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m "parallel and not nightly" -n 8 - pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m "not parallel and not nightly" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'parallel and not nightly' -n 8" + cmd_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel and not nightly'" - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not nightly and parallel" -n 8 - pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m "from_pulpcore_for_all_plugins and not nightly and not parallel" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not nightly and parallel' -n 8" + cmd_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulpcore.tests.functional -m 'from_pulpcore_for_all_plugins and not nightly and not parallel'" fi diff --git a/template_config.yml b/template_config.yml index 6f605f10..00c0b5a4 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,12 +1,12 @@ # This config represents the latest values used when running the plugin-template. Any settings that # were not present before running plugin-template have been added with their default values. -# generated with plugin_template@2021.08.26-129-gf780fda +# generated with plugin_template@2021.08.26-129-gf780fda-dirty additional_repos: - branch: main name: pulp-certguard -aiohttp_fixtures_origin: 172.18.0.1 +aiohttp_fixtures_origin: 127.0.0.1 api_root: /pulp/ black: true check_commit_message: true