Skip to content

Better molecule tests #73

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

Merged
merged 6 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: Molecule for Ansible - GHR Repository
uses: MonolithProjects/action-molecule@v1.4.1
uses: MonolithProjects/action-molecule@v1.4.2
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
Expand All @@ -55,7 +55,7 @@ jobs:
with:
path: "${{ github.repository }}"
- name: Molecule for Ansible - GHR Organization
uses: MonolithProjects/action-molecule@v1.4.1
uses: MonolithProjects/action-molecule@v1.4.2
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
with:
Expand Down
8 changes: 4 additions & 4 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- registered_runners.json.runners|map(attribute='status') == ["online"]
quiet: true

# - name: Check Labels ### does not work ... will fix the other day :-P
# fail:
# msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['Linux', 'self-hosted', 'X64', 'label1', 'repo-runner'])) }}"
# when: (registered_runners.json.runners.0 | json_query('labels[*].name') | list | difference(['Linux', 'self-hosted', 'X64', 'label1', 'repo-runner'])) != ([])
- name: Check Labels (skipped if labels are OK)
fail:
msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'])) }}"
when: not (registered_runners.json.runners.0 | json_query('labels[*].name') | list ) == (['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'] | list)
11 changes: 4 additions & 7 deletions molecule/repo/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
- runner_name in registered_runners.json.runners|map(attribute='name')|list
quiet: true

- debug:
var: registered_runners.json.runners|map(attribute='name')

# - name: Check Labels ### does not work ... will fix the other day :-P
# fail:
# msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['Linux', 'self-hosted', 'X64', 'label1', 'repo-runner'])) }}"
# when: (registered_runners.json.runners.0 | json_query('labels[*].name') | list | difference(['Linux', 'self-hosted', 'X64', 'label1', 'repo-runner'])) != ([])
- name: Check Labels (skipped if labels are OK)
fail:
msg: Woops some labels differ "{{ (registered_runners.json.runners.0 | json_query('labels[*].name') | difference(['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'])) }}"
when: not (registered_runners.json.runners.0 | json_query('labels[*].name') | list ) == (['self-hosted', 'Linux', 'X64', 'label1', 'repo-runner'] | list)
4 changes: 2 additions & 2 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- github_account is defined
- access_token is defined
- access_token | length > 0
quiet: true
fail_msg: "access_token was not fount."
run_once: yes
tags:
- install
- uninstall
- uninstall