Skip to content

Commit

Permalink
Change the version check to use app label
Browse files Browse the repository at this point in the history
A change in pulpcore (status API) requires us to change the version test
to use the app label instead of the repository name.
Along with this change we introduce a legacy lookup as a fallback to not
break all CI at the same time.

[noissue]
  • Loading branch information
mdellweg committed Feb 17, 2021
1 parent 785b7d7 commit 86fc81f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
27 changes: 20 additions & 7 deletions templates/github/.ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,26 @@
command: "docker logs pulp"
failed_when: true

- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}.
- block:
- name: "Check the component is in status"
assert:
that:
- component_name in (result.json.versions | items2dict(key_name="component", value_name="version") | keys)
- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}.
rescue:
- name: "Check version of component being tested (legacy)"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ legacy_component_name }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] }}.
- name: "Set pulp password in .netrc"
copy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ else
fi
mkdir .ci/ansible/vars || true
echo "---" > .ci/ansible/vars/main.yaml
echo "component_name: {{ plugin_snake }}" >> .ci/ansible/vars/main.yaml
echo "legacy_component_name: {{ plugin_snake }}" >> .ci/ansible/vars/main.yaml
echo "component_name: {{ plugin_app_label }}" >> .ci/ansible/vars/main.yaml
echo "component_version: '${COMPONENT_VERSION}'" >> .ci/ansible/vars/main.yaml

export PRE_BEFORE_INSTALL=$PWD/.github/workflows/scripts/pre_before_install.sh
Expand Down

0 comments on commit 86fc81f

Please sign in to comment.