Skip to content

fix(install): source the e2e test-mode marker so updater-triggered runs detect CI - #207

Merged
KrasimirKralev merged 1 commit into
ID-Robots:betafrom
KrasimirKralev:fix/e2e-install-test-mode-propagation
Jun 16, 2026
Merged

KrasimirKralev merged 1 commit into
ID-Robots:betafrom
KrasimirKralev:fix/e2e-install-test-mode-propagation

Conversation

@KrasimirKralev

@KrasimirKralev KrasimirKralev commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem

The e2e-install CI check fails intermittently with:

[5/18] Detecting WiFi interface...
Error: WiFi interface 'eth0' not found or not wireless.
clawbox-bootstrap.service: Main process exited, code=exited, status=1/FAILURE
install.sh: line N: nvpmodel: command not found
β†’ install.sh did not finish within 40 min

This is install.sh running the real Jetson/WiFi hardware path inside the non-Jetson CI container β€” it should be skipped under CLAWBOX_TEST_MODE=1.

Root cause

The e2e-install harness 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.sh never sourced that file. It read CLAWBOX_TEST_MODE only from its process environment. So:

  • The first-boot bootstrap is fine β€” clawbox-bootstrap.service sets CLAWBOX_TEST_MODE=1 directly.
  • But updater-triggered install.sh --step runs via clawbox-root-update@.service inherit only EnvironmentFile=-/etc/clawbox/network.env, which gets the flag late (only after step_network_setup persists it). Those runs execute with CLAWBOX_TEST_MODE=0 β†’ real iw 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.sh clean.
  • Simulated: with /etc/clawbox/test-mode.env present β†’ CLAWBOX_TEST_MODE=1, NETWORK_INTERFACE=eth0; absent (real device) β†’ CLAWBOX_TEST_MODE=0.
  • The e2e-install check on this PR is the real end-to-end proof β€” it exercises exactly the updater path that was failing.

Summary by CodeRabbit

  • Bug Fixes
    • Improved installer reliability in test environments by ensuring test mode is properly detected and hardware-dependent steps are appropriately skipped during installation.

…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.
@KrasimirKralev
KrasimirKralev requested a review from a team as a code owner June 16, 2026 09:49
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 142ac25b-2d88-41c0-81a1-22d8368f807b

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between eeb6d37 and 8b8e107.

πŸ“’ Files selected for processing (1)
  • install.sh

πŸ“ Walkthrough

Walkthrough

install.sh gains a 13-line block that sources /etc/clawbox/test-mode.env early in execution, before CLAWBOX_TEST_MODE is set and is_test_mode() is defined, so CI test containers consistently activate test mode for all invocations including updater-triggered --step runs.

Changes

Early test-mode env bootstrap

Layer / File(s) Summary
Early test-mode.env loader
install.sh
Sources /etc/clawbox/test-mode.env when the file exists, injecting test-mode environment variables before any test-mode initialization logic runs in the installer.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

πŸ‡ Hop, hop, before the gate swings wide,
A tiny env file slips inside.
No hardware tricks shall fool the test,
The CI bunny knows what's best!
Source it early, source it right β€” βœ…

πŸš₯ Pre-merge checks | βœ… 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides comprehensive problem context, root cause analysis, and validation details, but lacks completion of the required PR description template sections. Fill out the template sections including Type of change, How was this tested checkboxes, and the Checklist items to match repository standards.
βœ… Passed checks (4 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and specifically describes the main change: sourcing the test-mode marker file to fix updater-triggered CI detection.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests

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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KrasimirKralev
KrasimirKralev merged commit b77d9b9 into ID-Robots:beta Jun 16, 2026
6 of 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