Skip to content

fix(test): tolerate version token in snapshot create success grep#2314

Merged
jyaunches merged 7 commits into
mainfrom
fix/snapshot-e2e-assertion-regex
Apr 23, 2026
Merged

fix(test): tolerate version token in snapshot create success grep#2314
jyaunches merged 7 commits into
mainfrom
fix/snapshot-e2e-assertion-regex

Conversation

@cjagwani

@cjagwani cjagwani commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The `test-snapshot-commands.sh` nightly E2E was failing despite `nemoclaw snapshot create` actually succeeding. The test greps for the literal string `"Snapshot created"` but the real success output includes a version token between:

```
✓ Snapshot v1 created (12 directories)
```

Grep didn't match → false red in nightly despite the command succeeding.

Switching to regex `"Snapshot v[0-9]+.*created"` that tolerates the version token.

Why found now

Investigating #2268 revealed this test reporting FAIL on a run where the operation had actually succeeded per the log. Pre-existing on main — predates both #2308 and any recent PR.

Test plan

  • Shell syntax valid (`bash -n`)
  • Nightly E2E shows `snapshot-commands-e2e` green after merge

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved snapshot creation detection to recognize success messages that include version tokens, making snapshot-related validation more tolerant and tests more reliable.

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bce38c95-9800-4cff-9a74-740daf9ea91a

📥 Commits

Reviewing files that changed from the base of the PR and between 0effbcc and 626fc51.

📒 Files selected for processing (1)
  • test/e2e/test-snapshot-commands.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/e2e/test-snapshot-commands.sh

📝 Walkthrough

Walkthrough

The test script's snapshot creation success detection was relaxed: the success check now uses a regex that allows a version token between "Snapshot" and "created" (e.g., Snapshot v<N> ... created) instead of requiring the exact phrase Snapshot created.

Changes

Cohort / File(s) Summary
Test Snapshot Validation
test/e2e/test-snapshot-commands.sh
Replaced exact literal success match with an extended regular expression to accept versioned snapshot output (permits a version token between Snapshot and created).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through logs with regex in paw,
Letting versions sparkle where snapshots saw,
Now "Snapshot vN ... created" sings true,
Tests nod and pass — a soft thump, woohoo! 📸✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating the snapshot creation success detection regex to tolerate a version token, matching the core modification in the test file.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/snapshot-e2e-assertion-regex

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

@wscurran wscurran added bug Something fails against expected or documented behavior fix labels Apr 23, 2026
@prekshivyas prekshivyas requested a review from cv April 23, 2026 18:01
@jyaunches jyaunches merged commit ac8aa97 into main Apr 23, 2026
19 checks passed
jyaunches added a commit that referenced this pull request Apr 23, 2026
Merge main into fix/nightly-e2e-repairs-v4, resolving conflicts:
- nightly-e2e.yaml: keep contains(needs.*.result, 'failure') from #2371,
  remove cloud-experimental-e2e from notify-on-failure needs array
- test-snapshot-commands.sh: keep exit-code check from this PR + tolerant
  grep regex from #2314

Address reviewer feedback:
- Drop NEMOCLAW_RECREATE_SANDBOX from deployment-services to avoid
  re-introducing the delete+create race fixed in #2313 (@prekshivyas)
- Update cloud-experimental-e2e disable comment: drop stale Landlock
  mention (fixed in OpenShell#810 v0.0.32+), reference only docs-drift
  (@prekshivyas)
- Extract dump_diagnostics() in test-snapshot-commands.sh to centralize
  duplicate probes from fail() and Phase 2b (CodeRabbit)
@wscurran wscurran added bug-fix PR fixes a bug or regression and removed fix bug Something fails against expected or documented behavior labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants