Skip to content

Commit 0b87fa4

Browse files
ci(tests): key the tmachine disk cache on the playbooks and keep JUnit results
tmachine keys its disk layers on a hash of the Ansible tree, and actions/cache does not save after an exact key hit, so the fixed cache key rebuilt the changed layers on every run. Key the cache on the playbooks and fall back to the newest entry for the same runner. The sandbox-lifecycle playbook now has nextest write a JUnit report and fetches it into artifacts/tmachine-diagnostics, which the integration runner already uploads whether or not the lane passes. Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent f26e340 commit 0b87fa4

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

‎.github/workflows/integration-runner.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ jobs:
7373
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
7474
with:
7575
path: ~/.cache/tmachine
76-
key: tmachine-${{ runner.os }}-${{ runner.arch }}
76+
# tmachine keys its disk layers on a hash of the Ansible tree.
77+
# actions/cache doesn't save after an exact key hit, so a fixed key
78+
# would rebuild the changed layers on every run. Key on the playbooks
79+
# and fall back to the newest entry for the same runner.
80+
key: tmachine-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('tests/ansible/**') }}
81+
restore-keys: |
82+
tmachine-${{ runner.os }}-${{ runner.arch }}-
7783
7884
- name: Download integration inputs
7985
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1

‎tests/ansible/playbooks/suites/sandbox-lifecycle.yaml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
content: |
8484
[profile.default]
8585
slow-timeout = { period = "30s", terminate-after = 4 }
86+
87+
[profile.default.junit]
88+
path = "junit.xml"
8689
become: true
8790
become_user: tmachine
8891

@@ -112,6 +115,24 @@
112115
failed_when: false
113116
when: gateway_status is succeeded
114117

118+
# Keep the JUnit report with the run. The integration runner uploads
119+
# artifacts/tmachine-diagnostics whether or not the lane passes.
120+
- name: Find the JUnit report
121+
ansible.builtin.find:
122+
paths: "{{ suite_root }}"
123+
patterns: junit.xml
124+
recurse: true
125+
register: suite_junit
126+
failed_when: false
127+
128+
- name: Fetch the JUnit report
129+
ansible.builtin.fetch:
130+
src: "{{ item.path }}"
131+
dest: "{{ playbook_dir }}/../../../../artifacts/tmachine-diagnostics/junit/sandbox-lifecycle-{{ inventory_hostname }}.xml"
132+
flat: true
133+
loop: "{{ suite_junit.files | default([]) }}"
134+
failed_when: false
135+
115136
- name: Show suite diagnostics
116137
ansible.builtin.debug:
117138
var: suite_result

0 commit comments

Comments
 (0)