Skip to content

Commit 5a86eac

Browse files
committed
test(e2e): the fixture was the invented wire format too
The e2e wrote its subos manifest in the same shape the broken reader expected, so it kept passing while the feature did nothing against a real subos. Fixing the reader made it fail, which is the correct outcome and the reason the fix is trustworthy. The comment now says the structure is a wire format rather than a convenience, because the invented shape is the tidier-looking of the two and someone will want to "simplify" it back.
1 parent 56e580f commit 5a86eac

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

tests/e2e/200_subos_env_reaches_program.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
# know what any of these variables mean -- it carries whatever the subos
1515
# declares -- and a test naming LIBGL_DRIVERS_PATH would quietly suggest
1616
# otherwise.
17+
#
18+
# The JSON below is xlings's REAL shape: `envs` is an object keyed by binding,
19+
# whose values are arrays of declarations. The first version of this test wrote
20+
# an array of {binding, decls} -- a shape xlings never produces -- and it
21+
# passed, because the reader had been written from the same misunderstanding.
22+
# Do not "simplify" this structure; it is a wire format, not a convenience.
1723
set -euo pipefail
1824

1925
TMP=$(mktemp -d)
@@ -28,9 +34,9 @@ mkdir -p "$subos/usr/lib/dri"
2834
cat > "$subos/.xlings.json" <<'EOF'
2935
{ "workspace": {},
3036
"subos_info": { "schema_version": 1, "runtime": "glibc@2.39",
31-
"envs": [ { "binding": "probe@1", "decls": [
37+
"envs": { "probe@1": [
3238
{ "var": "MCPP_E2E_PROBE", "op": "prepend",
33-
"value": "${subosdir}/usr/lib/dri" } ] } ] } }
39+
"value": "${subosdir}/usr/lib/dri" } ] } } }
3440
EOF
3541

3642
cd "$TMP"

0 commit comments

Comments
 (0)