|
24 | 24 | package, |
25 | 25 | target, |
26 | 26 | output, |
| 27 | + features ? null, |
| 28 | + filter ? "kind(test)", |
27 | 29 | }: |
28 | 30 | pkgs.writeShellApplication { |
29 | 31 | name = "build-${name}-test-archive"; |
|
56 | 58 | --manifest-path "$manifest_path" \ |
57 | 59 | --target ${target} \ |
58 | 60 | -p ${package} \ |
59 | | - -E 'kind(test)' \ |
| 61 | + ${pkgs.lib.optionalString (features != null) "--features ${pkgs.lib.escapeShellArg features}"} \ |
| 62 | + -E ${pkgs.lib.escapeShellArg filter} \ |
60 | 63 | --archive-file "$bundle_dir/tests.tar.zst" |
61 | 64 |
|
62 | 65 | cd "$workspace_root" |
|
92 | 95 | target = muslToolchain.target; |
93 | 96 | output = "artifacts/test-archives/${muslToolchain.target}/provider-refresh-keycloak-tests.tar"; |
94 | 97 | }; |
| 98 | + |
| 99 | + # Follow-up: migrate these wrapper-coupled tests once tmachine provides their |
| 100 | + # managed-gateway controls, SPIFFE fixtures, caller driver-config setting, |
| 101 | + # guest tools, and matching workload-image identity behavior. The corporate |
| 102 | + # proxy and gateway-start binaries currently self-skip without wrapper-owned |
| 103 | + # gateway metadata, so exclude them rather than report false passes. |
| 104 | + podmanE2eFollowUpBinaries = [ |
| 105 | + "credential_gating" |
| 106 | + "driver_config_volume" |
| 107 | + "forward_proxy_graphql_l7" |
| 108 | + "forward_proxy_jsonrpc_l7" |
| 109 | + "forward_proxy_l7_bypass" |
| 110 | + "host_gateway_alias" |
| 111 | + "landlock" |
| 112 | + "local_driver_token_restart" |
| 113 | + # Standalone tmachine runs can time out while opening the localhost relay. |
| 114 | + # Follow up on making the relay setup deterministic before restoring it. |
| 115 | + "no_proxy" |
| 116 | + "podman_corporate_proxy" |
| 117 | + "podman_gateway_start" |
| 118 | + "podman_oci_identity" |
| 119 | + # This validates the standalone driver binary's daemon-unavailable path and |
| 120 | + # belongs in the Podman driver crate's integration tests. The E2E archive |
| 121 | + # does not contain `openshell-driver-podman`. |
| 122 | + "podman_preflight" |
| 123 | + "provider_auto_create" |
| 124 | + # The provider-refresh feature suite covers revoked Keycloak grants. This |
| 125 | + # binary instead covers stable workload handles across repeated rotations |
| 126 | + # and explicit refresh reconfiguration in a long-running sandbox. |
| 127 | + "provider_refresh_handles" |
| 128 | + "provider_token_exchange" |
| 129 | + "proxy_egress_pipeline" |
| 130 | + # Conformance covers stop/start workspace preservation and deletion while |
| 131 | + # stopped. The remaining canonical-main, TTY, attachment replay, and |
| 132 | + # no-keep cases still need migration. Nextest archive filters cannot select |
| 133 | + # individual tests, so keep the complete binary in the follow-up bucket. |
| 134 | + "sandbox_lifecycle" |
| 135 | + # Needs a prebuilt musl DNS probe in guest artifact mode; tracked in #3009. |
| 136 | + "transparent_tcp" |
| 137 | + "websocket_conformance" |
| 138 | + "workspace_lifecycle" |
| 139 | + ]; |
| 140 | + podmanE2eArchiveFilter = |
| 141 | + let |
| 142 | + excludedBinaries = map (binary: "binary(=${binary})") podmanE2eFollowUpBinaries; |
| 143 | + in |
| 144 | + "kind(test) and not (${pkgs.lib.concatStringsSep " or " excludedBinaries})"; |
| 145 | + |
95 | 146 | podmanDriverArchive = mkTestArchive { |
96 | 147 | name = "podman-driver"; |
97 | 148 | workspacePath = "tests/suites/drivers"; |
|
100 | 151 | target = muslToolchain.target; |
101 | 152 | output = "artifacts/test-archives/${muslToolchain.target}/openshell-podman-tests.tar"; |
102 | 153 | }; |
| 154 | + podmanE2eArchive = mkTestArchive { |
| 155 | + name = "podman-e2e"; |
| 156 | + workspacePath = "e2e/rust"; |
| 157 | + manifestPath = "e2e/rust/Cargo.toml"; |
| 158 | + package = "openshell-e2e"; |
| 159 | + target = muslToolchain.target; |
| 160 | + output = "artifacts/test-archives/${muslToolchain.target}/openshell-podman-e2e-tests.tar"; |
| 161 | + features = "e2e-podman"; |
| 162 | + filter = podmanE2eArchiveFilter; |
| 163 | + }; |
103 | 164 | in |
104 | 165 | rec { |
105 | | - inherit conformanceCliArchive providerRefreshKeycloakArchive podmanDriverArchive; |
| 166 | + inherit |
| 167 | + conformanceCliArchive |
| 168 | + providerRefreshKeycloakArchive |
| 169 | + podmanDriverArchive |
| 170 | + podmanE2eArchive |
| 171 | + ; |
106 | 172 |
|
107 | 173 | binaries = pkgs.writeShellApplication { |
108 | 174 | name = "build-artifacts-binaries"; |
@@ -148,19 +214,48 @@ rec { |
148 | 214 | conformanceCliArchive |
149 | 215 | providerRefreshKeycloakArchive |
150 | 216 | podmanDriverArchive |
| 217 | + podmanE2eArchive |
151 | 218 | ]; |
152 | 219 | text = '' |
153 | 220 | build-openshell-conformance-test-archive |
154 | 221 | build-provider-refresh-keycloak-test-archive |
155 | 222 | build-podman-driver-test-archive |
| 223 | + build-podman-e2e-test-archive |
| 224 | + ''; |
| 225 | + }; |
| 226 | + |
| 227 | + testImages = pkgs.writeShellApplication { |
| 228 | + name = "build-artifacts-test-images"; |
| 229 | + runtimeInputs = [ |
| 230 | + pkgs.coreutils |
| 231 | + pkgs.docker-client |
| 232 | + pkgs.git |
| 233 | + ]; |
| 234 | + text = '' |
| 235 | + root=$(git rev-parse --show-toplevel) |
| 236 | + cd "$root" |
| 237 | +
|
| 238 | + docker build \ |
| 239 | + --platform linux/${dockerArch} \ |
| 240 | + --file e2e/python/Dockerfile.workload \ |
| 241 | + --build-arg "PYTHON_VERSION=$(cat .python-version)" \ |
| 242 | + --tag openshell/e2e-python:dev \ |
| 243 | + e2e/python |
| 244 | +
|
| 245 | + mkdir -p artifacts/images |
| 246 | + docker save \ |
| 247 | + --output artifacts/images/openshell-e2e-python-dev.tar \ |
| 248 | + openshell/e2e-python:dev |
156 | 249 | ''; |
157 | 250 | }; |
158 | 251 |
|
159 | 252 | images = pkgs.writeShellApplication { |
160 | 253 | name = "build-artifacts-images"; |
161 | 254 | runtimeInputs = [ |
| 255 | + pkgs.coreutils |
162 | 256 | pkgs.docker-client |
163 | 257 | pkgs.git |
| 258 | + testImages |
164 | 259 | ]; |
165 | 260 | text = '' |
166 | 261 | root=$(git rev-parse --show-toplevel) |
@@ -212,6 +307,8 @@ rec { |
212 | 307 | docker save \ |
213 | 308 | --output artifacts/images/openshell-sandbox-tmachine.tar \ |
214 | 309 | openshell/sandbox:tmachine |
| 310 | +
|
| 311 | + build-artifacts-test-images |
215 | 312 | ''; |
216 | 313 | }; |
217 | 314 |
|
|
0 commit comments