From c404ee2d92281e641bd8c6322bf408332dae9fd4 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Wed, 29 Apr 2026 13:43:55 +0200 Subject: [PATCH] Fix invocation of cli integration tests --- .../.github/workflows/scripts/before_script.sh.j2 | 6 ++++++ .../github/.github/workflows/scripts/install.sh.j2 | 2 +- .../github/.github/workflows/scripts/script.sh.j2 | 11 ++++++++--- templates/github/.github/workflows/test.yml.j2 | 3 +++ templates/include/macros.j2 | 8 ++++++++ 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/templates/github/.github/workflows/scripts/before_script.sh.j2 b/templates/github/.github/workflows/scripts/before_script.sh.j2 index 063d4456..b3828577 100755 --- a/templates/github/.github/workflows/scripts/before_script.sh.j2 +++ b/templates/github/.github/workflows/scripts/before_script.sh.j2 @@ -19,6 +19,12 @@ fi echo echo "# Pulp config:" tail -v -n +1 .ci/ansible/settings/settings.* +{%- if test_cli %} + +echo +echo "# Pulp CLI config" +tail -v -n +1 "../{{ cli_package }}/tests/cli.toml" +{%- endif %} echo echo "# Containerfile:" diff --git a/templates/github/.github/workflows/scripts/install.sh.j2 b/templates/github/.github/workflows/scripts/install.sh.j2 index 396b349a..b129307e 100755 --- a/templates/github/.github/workflows/scripts/install.sh.j2 +++ b/templates/github/.github/workflows/scripts/install.sh.j2 @@ -36,7 +36,7 @@ git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_packag PULP_API_ROOT="$(yq -r '.pulp_scenario_settings.api_root // .pulp_settings.api_root // "/pulp/"' < .ci/ansible/vars/main.yaml)" pulp config create --base-url {{ pulp_scheme }}://pulp{% if pulp_scheme != 'https' %} --no-verify-ssl{% endif %} --api-root "${PULP_API_ROOT}" --username "admin" --password "password" -{% if test_cli -%} +{%- if test_cli %} cp ~/.config/pulp/cli.toml "../{{ cli_package }}/tests/cli.toml" {%- endif %} diff --git a/templates/github/.github/workflows/scripts/script.sh.j2 b/templates/github/.github/workflows/scripts/script.sh.j2 index 63b850f8..73e2a775 100755 --- a/templates/github/.github/workflows/scripts/script.sh.j2 +++ b/templates/github/.github/workflows/scripts/script.sh.j2 @@ -156,12 +156,17 @@ fi {%- if test_cli %} {%- if docker_fixtures %} export PULP_FIXTURES_URL="http://pulp-fixtures:8080" +{%- endif %} # some pulp-cli tests use the api root envvar export PULP_API_ROOT="$(EDITOR=cat pulp config edit 2>/dev/null | awk -F'"' '/api_root/{print $2; exit}')" -{%- endif %} pushd ../{{ cli_package }} -pip install -r test_requirements.txt -pytest -v tests -m "{{ plugins | map(attribute='name') | join(' or ') | snake }}" +if [[ -f "test_requirements.txt" ]] +then + pip install -r test_requirements.txt + pytest -v tests -m "{{ plugins | map(attribute='name') | join(' or ') | snake }}" +else + PULP_CA_BUNDLE="/usr/local/share/ca-certificates/pulp_webserver.crt" make livetest +fi popd {%- endif %} {%- endif %} diff --git a/templates/github/.github/workflows/test.yml.j2 b/templates/github/.github/workflows/test.yml.j2 index d8e3e4ba..dac22fcb 100644 --- a/templates/github/.github/workflows/test.yml.j2 +++ b/templates/github/.github/workflows/test.yml.j2 @@ -3,6 +3,7 @@ checkout, display_logs, install_python_deps, + install_uv, run_script, setup_env, setup_python, @@ -37,6 +38,8 @@ jobs: {{ setup_python() | indent(6) }} + {{ install_uv() | indent(6) }} + - name: "Download plugin package" uses: "actions/download-artifact@v8" with: diff --git a/templates/include/macros.j2 b/templates/include/macros.j2 index f1c7ef4f..76477dc5 100644 --- a/templates/include/macros.j2 +++ b/templates/include/macros.j2 @@ -40,6 +40,14 @@ GITHUB_CONTEXT: "{{ '${{ github.event.pull_request.commits_url }}' }}" {%- endmacro -%} +{%- macro install_uv() -%} +- name: "Install uv" + uses: "astral-sh/setup-uv@v7" + with: + enable-cache: true +{%- endmacro -%} + + {%- macro setup_ruby(condition=None) -%} - uses: ruby/setup-ruby@v1 {%- if condition %}