fix(install): source the e2e test-mode marker so updater-triggered runs detect CI - #207
Conversation
β¦ns detect CI
The e2e-install harness entrypoint seeds /etc/clawbox/test-mode.env
(CLAWBOX_TEST_MODE=1 + NETWORK_INTERFACE=eth0) before any install.sh runs,
expecting install.sh to read it ("so install.sh knows it's in test mode even
before it writes its own .env"). But install.sh only read CLAWBOX_TEST_MODE
from its process env, so updater-triggered `install.sh --step` runs via
clawbox-root-update@.service β which inherit only /etc/clawbox/network.env,
populated late during step_network_setup β ran with CLAWBOX_TEST_MODE=0. They
then executed the real Jetson/WiFi steps (iw dev eth0, nvpmodel, jetson_clocks)
and failed on the non-Tegra CI host, intermittently breaking e2e-install.
Source the seeded marker at startup so every invocation (bootstrap and
updater-triggered) detects test mode up front. The file exists only in the CI
container, so this is a no-op on real devices.
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: π Files selected for processing (1)
π WalkthroughWalkthrough
ChangesEarly test-mode env bootstrap
Estimated code review effortπ― 1 (Trivial) | β±οΈ ~3 minutes Poem
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 inconclusive)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The
e2e-installCI check fails intermittently with:This is
install.shrunning the real Jetson/WiFi hardware path inside the non-Jetson CI container β it should be skipped underCLAWBOX_TEST_MODE=1.Root cause
The
e2e-installharness entrypoint seeds/etc/clawbox/test-mode.env(CLAWBOX_TEST_MODE=1+NETWORK_INTERFACE=eth0) before any install runs, expecting install.sh to read it β its own comment says "so install.sh knows it's in test mode even before it has had a chance to write its own .env."But
install.shnever sourced that file. It readCLAWBOX_TEST_MODEonly from its process environment. So:clawbox-bootstrap.servicesetsCLAWBOX_TEST_MODE=1directly.install.sh --stepruns viaclawbox-root-update@.serviceinherit onlyEnvironmentFile=-/etc/clawbox/network.env, which gets the flag late (only afterstep_network_setuppersists it). Those runs execute withCLAWBOX_TEST_MODE=0β realiw dev eth0/nvpmodel/jetson_clocksβ fail on the CI host.That's the intermittency: whoever wins/loses the race on when the flag is present.
Fix
Source the seeded marker at install.sh startup (mirrors the existing
source "$IFACE_ENV"a few lines below), so every invocation β bootstrap and updater-triggered β detects test mode up front. The file exists only in the CI container, so it's a no-op on real devices.Validation
bash -n install.shclean./etc/clawbox/test-mode.envpresent βCLAWBOX_TEST_MODE=1,NETWORK_INTERFACE=eth0; absent (real device) βCLAWBOX_TEST_MODE=0.e2e-installcheck on this PR is the real end-to-end proof β it exercises exactly the updater path that was failing.Summary by CodeRabbit