Skip to content

Commit

Permalink
ci: fix custom_env molecule test
Browse files Browse the repository at this point in the history
  • Loading branch information
MonolithProjects committed May 24, 2024
1 parent b5eb5ea commit b96bd90
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions molecule/custom_env/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
github_repo: "{{ lookup('env', 'GITHUB_REPO') }}"
github_account: "{{ lookup('env', 'GITHUB_ACCOUNT') }}"
runner_state: absent
runner_name: test_name
roles:
- monolithprojects.github_actions_runner
1 change: 1 addition & 0 deletions molecule/custom_env/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
github_repo: "{{ lookup('env', 'GITHUB_REPO') }}"
github_account: "{{ lookup('env', 'GITHUB_ACCOUNT') }}"
runner_version: "latest"
runner_name: test_name
runner_labels:
- label1
- repo-runner
Expand Down
4 changes: 2 additions & 2 deletions molecule/custom_env/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
github_account: "{{ lookup('env', 'GITHUB_ACCOUNT') }}"
github_api_url: "https://api.github.com"
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
runner_name: ubuntu16-latest
runner_name: test_name

tasks:
- name: Check currently registered runners
Expand All @@ -32,7 +32,7 @@
ansible.builtin.assert:
that:
- runner_name in registered_runners.json.runners|map(attribute='name')|list
- registered_runners.json.runners|map(attribute='status') == ["online"]
- registered_runners.json.runners.0.status == "online"
quiet: true

- name: Check Labels (skipped if labels are OK)
Expand Down
3 changes: 2 additions & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
github_account: "{{ lookup('env', 'GITHUB_ACCOUNT') }}"
github_api_url: "https://api.github.com"
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
runner_name: ubuntu16-latest
runner_name: test_name

tasks:
- name: Check currently registered runners
Expand All @@ -31,6 +31,7 @@
- name: Check Runner
ansible.builtin.assert:
that:
- runner_name in registered_runners.json.runners|map(attribute='name')|list
- registered_runners.json.runners.0.status == "online"
quiet: true

Expand Down

0 comments on commit b96bd90

Please sign in to comment.