Skip to content

Commit 877cfc4

Browse files
committed
test(tmachine): execute nextest archives in guests
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 2711da2 commit 877cfc4

3 files changed

Lines changed: 91 additions & 16 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
- name: Install cargo-nextest
6+
hosts: all
7+
become: true
8+
gather_facts: false
9+
vars:
10+
nextest_version: 0.9.143
11+
nextest_arches:
12+
x86_64:
13+
triple: x86_64-unknown-linux-musl
14+
sha256: 6d891c18105ec2d33f6e441a4f92b7ccab47ba263e22055c8bb66884243f3389
15+
aarch64:
16+
triple: aarch64-unknown-linux-musl
17+
sha256: 0560ce0ce017f368c54b5db86588370fc03b470985490fa81200e62a657dda05
18+
tasks:
19+
- name: Wait for SSH
20+
ansible.builtin.wait_for_connection:
21+
22+
- name: Gather guest architecture
23+
ansible.builtin.setup:
24+
filter:
25+
- ansible_architecture
26+
27+
- name: Select cargo-nextest release for guest architecture
28+
ansible.builtin.set_fact:
29+
nextest_release: "{{ nextest_arches[ansible_facts.architecture] | default({}) }}"
30+
31+
- name: Validate guest architecture
32+
ansible.builtin.assert:
33+
that: nextest_release | length > 0
34+
fail_msg: "cargo-nextest is unsupported on {{ ansible_facts.architecture }}"
35+
36+
- name: Download cargo-nextest
37+
ansible.builtin.get_url:
38+
url: "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-{{ nextest_version }}/cargo-nextest-{{ nextest_version }}-{{ nextest_release.triple }}.tar.gz"
39+
dest: /tmp/cargo-nextest.tar.gz
40+
checksum: "sha256:{{ nextest_release.sha256 }}"
41+
mode: "0600"
42+
43+
- name: Install cargo-nextest
44+
ansible.builtin.unarchive:
45+
src: /tmp/cargo-nextest.tar.gz
46+
dest: /usr/local/bin
47+
remote_src: true
48+
creates: /usr/local/bin/cargo-nextest
49+
50+
- name: Verify cargo-nextest
51+
ansible.builtin.command: cargo-nextest --version
52+
changed_when: false

‎tests/ansible/playbooks/smoke.yaml‎

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@
99
- name: Wait for SSH
1010
ansible.builtin.wait_for_connection:
1111

12-
- name: Install OpenShell conformance runner
12+
- name: Create OpenShell conformance test directory
1313
become: true
14-
ansible.builtin.copy:
15-
src: "{{ openshell_conformance_binary }}"
16-
dest: /usr/local/bin/openshell-conformance
17-
mode: "0755"
14+
ansible.builtin.file:
15+
path: /var/lib/openshell-conformance/tests
16+
state: directory
17+
owner: tmachine
18+
group: tmachine
19+
mode: "0700"
20+
21+
- name: Install OpenShell conformance test bundle
22+
become: true
23+
ansible.builtin.unarchive:
24+
src: "{{ openshell_conformance_test_bundle }}"
25+
dest: /var/lib/openshell-conformance/tests
26+
owner: tmachine
27+
group: tmachine
1828

1929
- name: Wait for OpenShell gateway
2030
ansible.builtin.wait_for:
@@ -33,14 +43,19 @@
3343
- --name
3444
- tmachine
3545

36-
- name: Run OpenShell smoke conformance test
46+
- name: Run OpenShell smoke conformance archive
3747
ansible.builtin.command:
3848
argv:
39-
- /usr/local/bin/openshell-conformance
49+
- cargo-nextest
50+
- nextest
4051
- run
41-
- smoke
42-
- --openshell-bin
43-
- /usr/local/bin/openshell
52+
- --archive-file
53+
- /var/lib/openshell-conformance/tests/tests.tar.zst
54+
- --workspace-remap
55+
- /var/lib/openshell-conformance/tests
56+
- --no-capture
57+
environment:
58+
OPENSHELL_BIN: /usr/local/bin/openshell
4459
register: conformance_result
4560
changed_when: false
4661
failed_when: false

‎tests/config.nix‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ let
3737
machine = "ubuntu";
3838
setup = {
3939
use_galaxy = true;
40-
playbooks = [ "ansible/playbooks/docker.yaml" ];
40+
playbooks = [
41+
"ansible/playbooks/docker.yaml"
42+
"ansible/playbooks/nextest.yaml"
43+
];
4144
};
4245
install = {
4346
use_galaxy = false;
@@ -58,7 +61,10 @@ let
5861
machine = "fedora";
5962
setup = {
6063
use_galaxy = false;
61-
playbooks = [ "ansible/playbooks/podman-rootful.yaml" ];
64+
playbooks = [
65+
"ansible/playbooks/podman-rootful.yaml"
66+
"ansible/playbooks/nextest.yaml"
67+
];
6268
};
6369
install = {
6470
use_galaxy = false;
@@ -79,7 +85,10 @@ let
7985
machine = "fedora";
8086
setup = {
8187
use_galaxy = false;
82-
playbooks = [ "ansible/playbooks/podman-rootless.yaml" ];
88+
playbooks = [
89+
"ansible/playbooks/podman-rootless.yaml"
90+
"ansible/playbooks/nextest.yaml"
91+
];
8392
};
8493
install = {
8594
use_galaxy = false;
@@ -102,7 +111,7 @@ let
102111
name = "smoke";
103112
playbooks = [ "ansible/playbooks/smoke.yaml" ];
104113
inputs = {
105-
openshell_conformance_binary = "../target/${muslTarget}/debug/openshell-conformance";
114+
openshell_conformance_test_bundle = "../artifacts/test-archives/${muslTarget}/openshell-conformance-tests.tar";
106115
};
107116
}
108117
];
@@ -112,15 +121,14 @@ let
112121
name = "tmachine";
113122
runtimeInputs = [
114123
qemu
115-
pkgs.git
116124
pkgs.ansible
125+
pkgs.git
117126
pkgs.sshpass
118127
];
119128
text = ''
120129
root=$(git rev-parse --show-toplevel)
121130
cd "$root/tests"
122131
export ANSIBLE_CONFIG="$PWD/ansible/ansible.cfg"
123-
124132
exec ${tmachine}/bin/tmachine --config ${config} "$@"
125133
'';
126134
};

0 commit comments

Comments
 (0)