Skip to content

Commit 87c035e

Browse files
committed
Fix invocation of cli integration tests
1 parent b38dba5 commit 87c035e

5 files changed

Lines changed: 26 additions & 4 deletions

File tree

templates/github/.github/workflows/scripts/before_script.sh.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ fi
1919
echo
2020
echo "# Pulp config:"
2121
tail -v -n +1 .ci/ansible/settings/settings.*
22+
{%- if test_cli %}
23+
24+
echo
25+
echo "# Pulp CLI config"
26+
tail -v -n +1 "../{{ cli_package }}/tests/cli.toml"
27+
{%- endif %}
2228

2329
echo
2430
echo "# Containerfile:"

templates/github/.github/workflows/scripts/install.sh.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ git clone --depth 1 --branch "$PULP_CLI_VERSION" {{ cli_repo }} ../{{ cli_packag
3636
PULP_API_ROOT="$(yq -r '.pulp_scenario_settings.api_root // .pulp_settings.api_root // "/pulp/"' < .ci/ansible/vars/main.yaml)"
3737

3838
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"
39-
{% if test_cli -%}
39+
{%- if test_cli %}
4040
cp ~/.config/pulp/cli.toml "../{{ cli_package }}/tests/cli.toml"
4141
{%- endif %}
4242

templates/github/.github/workflows/scripts/script.sh.j2

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,17 @@ fi
156156
{%- if test_cli %}
157157
{%- if docker_fixtures %}
158158
export PULP_FIXTURES_URL="http://pulp-fixtures:8080"
159+
{%- endif %}
159160
# some pulp-cli tests use the api root envvar
160161
export PULP_API_ROOT="$(EDITOR=cat pulp config edit 2>/dev/null | awk -F'"' '/api_root/{print $2; exit}')"
161-
{%- endif %}
162162
pushd ../{{ cli_package }}
163-
pip install -r test_requirements.txt
164-
pytest -v tests -m "{{ plugins | map(attribute='name') | join(' or ') | snake }}"
163+
if [[ -f "test_requirements.txt" ]]
164+
then
165+
pip install -r test_requirements.txt
166+
pytest -v tests -m "{{ plugins | map(attribute='name') | join(' or ') | snake }}"
167+
else
168+
PULP_CA_BUNDLE="/usr/local/share/ca-certificates/pulp_webserver.crt" make livetest
169+
fi
165170
popd
166171
{%- endif %}
167172
{%- endif %}

templates/github/.github/workflows/test.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
checkout,
44
display_logs,
55
install_python_deps,
6+
install_uv,
67
run_script,
78
setup_env,
89
setup_python,
@@ -37,6 +38,8 @@ jobs:
3738

3839
{{ setup_python() | indent(6) }}
3940

41+
{{ install_uv() | indent(6) }}
42+
4043
- name: "Download plugin package"
4144
uses: "actions/download-artifact@v8"
4245
with:

templates/include/macros.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ GITHUB_CONTEXT: "{{ '${{ github.event.pull_request.commits_url }}' }}"
4040
{%- endmacro -%}
4141

4242

43+
{%- macro install_uv() -%}
44+
- name: "Install uv"
45+
uses: "astral-sh/setup-uv@v7"
46+
with:
47+
enable-cache: true
48+
{%- endmacro -%}
49+
50+
4351
{%- macro setup_ruby(condition=None) -%}
4452
- uses: ruby/setup-ruby@v1
4553
{%- if condition %}

0 commit comments

Comments
 (0)