Skip to content

test(e2e): stop pinning the profile version, and run the two upgrade tests - #426

Merged
Sunrisepeak merged 2 commits into
mainfrom
fix/profile-version-test-rot
Jul 27, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
fix/profile-version-test-rot

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

The bug

subos_profile_upgrade_test.sh and subos_shell_level_test.sh both assert:

grep -q "^# xlings-profile-version: 9" .../xlings-profile.sh

The profiles are at 10 (src/core/xself/profile_resources.cppm). Both tests have been failing — and neither is listed in run_all.sh, so nothing noticed. Confirmed against the released 2026.7.27.3 binary as well, so it is not a recent break.

The fix

Read the marker out of the source of truth:

PROFILE_VERSION="$(grep -oP 'xlings-profile-version: \K[0-9]+' \
    "$ROOT_DIR/src/core/xself/profile_resources.cppm" | head -1)"

The property under test is "the emitted profile carries the marker the source declares". What the number is today is not part of that, and pinning it is exactly what let these rot.

Both pass after the change. Both are now registered (E2E-39, E2E-40) — subos_profile_upgrade_test.sh is the profile-upgrade test and has never run in CI.

Context, handed over rather than acted on

Found while evaluating the 0.4.69 → 2026.7.27.3 upgrade path. 18 of the 73 tests/e2e/*_test.sh are referenced from neither run_all.sh, nor project_e2e_test.sh, nor any workflow. I ran 16 of them locally against this build:

result tests
pass unchanged (14) install_idempotent shim_link subos_events xpkg_snapshot_remove update_package subos_xpkg_use_cmd config_install_no_implicit_dir project_data_routing subos_xpkg_install subos_xpkg_keeper subos_xpkg_fork build_xim_index_artifact shim_alias_recursion rpath_verify
fixed here (2) subos_profile_upgrade subos_shell_level
fails, not diagnosed (1) index_artifact_update — failed to set index repo origin, possibly environmental
not run (1) windows_quick_install_resource_probe — Windows only

Wiring up the other 14 would add ~40% to the e2e job. One local pass is weak evidence of CI stability, so that is a deliberate call about CI time rather than something to slip into this PR. Filed separately.

…tests

`subos_profile_upgrade_test.sh` and `subos_shell_level_test.sh` both
grep for `# xlings-profile-version: 9`. The profiles moved to 10 (see
core/xself/profile_resources.cppm), so both have been failing — and
neither is listed in run_all.sh, so nothing noticed.

Read the expected marker out of profile_resources.cppm instead. What
these tests are for is "the emitted profile carries the marker the
source declares"; the number it happens to be today is not part of
that, and pinning it is what let them rot.

Register both. `subos_profile_upgrade_test.sh` is literally the
profile-upgrade test and it has never run in CI.

Found while evaluating the 0.4.69 -> 2026.7.27.3 upgrade path. 18 of
the 73 e2e scripts are referenced from neither run_all.sh nor
project_e2e_test.sh nor any workflow; 16 were run locally and 14 pass
unchanged. Whether to wire up the other 14 is a separate call about CI
time, so the list is in an issue rather than in this commit.
From the e2e job on main:

    === E2E-30: custom_index_artifact_test.sh ===
    [test] SKIP: no xlings binary (build first)
    PASS: E2E-30 (custom_index_artifact_test.sh, 7ms)

`custom_index_artifact_test.sh` and `index_artifact_update_test.sh` each
rolled their own binary discovery — `find "$PROJECT_DIR/build" -path
'*debug*' -name xlings` — with a SKIP and exit 0 when nothing matched.
It lied in both directions:

  * run_all.sh passes no argument to E2E-30, and CI builds into target/
    via mcpp, never build/. So the find matched nothing, the test
    skipped, and run_all recorded a pass. The custom index artifact
    feature (#377/#379, shipped 0.4.68) has had no CI coverage at all
    while appearing to have it.

  * Standalone on a dev box the find DID match — a three-week-old debug
    build — so the test failed against behaviour that had since changed,
    which reads as a product bug and is not one.

Both now use find_xlings_bin: newest build under target/, with the
version-mismatch warning. Its comment already records the cost of
getting this wrong once. And "no binary" is now a failure, not a skip —
a test that cannot find what it tests has not tested it.

Both pass with real assertions. index_artifact_update_test.sh was also
unregistered, so it is now E2E-41.
@Sunrisepeak

Copy link
Copy Markdown
Member Author

Pushed a second commit — same family, worse instance. From the e2e job on main:

=== E2E-30: custom_index_artifact_test.sh ===
[test] SKIP: no xlings binary (build first)
PASS: E2E-30 (custom_index_artifact_test.sh, 7ms)

7ms, zero assertions, recorded as a pass. The custom-index-artifact feature (#377/#379, shipped in 0.4.68) has had no CI coverage at all while appearing to have it.

Both custom_index_artifact_test.sh and index_artifact_update_test.sh rolled their own discovery:

XLINGS_BIN="$(find "$PROJECT_DIR/build" -path '*debug*' -name xlings ...)"
[[ -x "$XLINGS_BIN" ]] || { echo "[test] SKIP: no xlings binary"; exit 0; }

It lied in both directions:

  • In CI — run_all.sh passes no argument to E2E-30, and CI builds into target/ via mcpp, never build/. Nothing matched → skip → pass.
  • Standalone on a dev box — the find did match: a three-week-old debug build (build/linux/x86_64/debug/xlings, Jun 25). index_artifact_update_test.sh failed against behaviour that had since changed, which reads as a product bug and is not one. Passing the current binary explicitly: ALL PASSED.

Both now use find_xlings_bin — newest under target/, plus the version-mismatch warning. That helper's own comment already records what this cost once ("a gate absent from a 0.4.66 binary read as the feature not working"); these two tests predate it and never adopted it.

And "no binary" is now a failure, not a skip. A test that cannot find the thing it tests has not tested it.

index_artifact_update_test.sh was also unregistered → now E2E-41.

Worth noting the shape, since it is the third instance today: self update returned 0 on a failed upgrade (#424), doctor's summary was clipped away so a broken home looked unexamined (#424), and a test reported PASS without running. Same failure mode each time — success and "never actually happened" produce identical output.

@Sunrisepeak
Sunrisepeak merged commit 43e1435 into main Jul 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant