Repository navigation
Commit 62f7243
authored
test(e2e): migrate test-credential-sanitization.sh to vitest (#5336)
## Summary
Migrate `test/e2e/test-credential-sanitization.sh` with the simplest
equivalent Vitest coverage.
## Related Issues
Refs #5098
Refs #156
Refs #1438
## Contract mapping
- Legacy assertion: migration bundle config strips credential fields,
removes `auth-profiles.json`, preserves non-secret workspace/config
data, and keeps symlink traversal out of sensitive-file removal.
- Replacement: `test/e2e-scenario/live/credential-sanitization.test.ts`
local product-code assertions using `sanitizeConfigFile`,
`stripCredentials`, `isSensitiveFile`, and `isCredentialField`.
- Boundary preserved: real filesystem bundle mutation plus product
sanitization code.
- Legacy assertion: blueprint digest is not empty and tracks the pinned
sandbox image digest.
- Replacement: `credential-sanitization.test.ts` parses
`nemoclaw-blueprint/blueprint.yaml` and asserts `sha256:<64hex>` plus
image-digest equality.
- Boundary preserved: shipped blueprint YAML.
- Legacy assertion: after install/onboard, sandbox agent state does not
expose `auth-profiles.json` or secret-shaped `nvapi-`/`ghp_`/`npm_`
values.
- Replacement: `credential-sanitization.test.ts` runs `bash install.sh
--non-interactive --yes-i-accept-third-party-software`, then probes the
real OpenShell sandbox filesystem from Vitest.
- Boundary preserved: `install.sh`, Docker/OpenShell, real sandbox exec,
`NVIDIA_API_KEY` secret redaction.
## Simplicity check
- Test shape: simple live Vitest test with local helper functions.
- Original runner/lane: `nightly-e2e.yaml` job
`credential-sanitization-e2e`, `runs-on: ubuntu-latest`,
Docker/OpenShell, `NVIDIA_API_KEY`, timeout 60 minutes.
- Replacement runner: same `ubuntu-latest` class in
`.github/workflows/e2e-vitest-scenarios.yaml` job
`credential-sanitization-vitest`, with Docker/OpenShell and
`NVIDIA_API_KEY`.
- New shared helpers: none.
- New framework/registry/ledger: **none**.
- Workflow changes: add selective free-standing Vitest job
`credential-sanitization-vitest`; legacy shell deletion and shell
workflow retirement deferred to #5098 Phase 11.
- Selective dispatch: `gh workflow run e2e-vitest-scenarios.yaml --repo
NVIDIA/NemoClaw --ref e2e-migrate/test-credential-sanitization -f
jobs=credential-sanitization-vitest -f pr_number=<PR>`.
## Verification
- `npm ci --ignore-scripts`
- `npm run build:cli`
- `npx vitest run --project e2e-vitest-support
test/e2e-scenario/support-tests/e2e-scenarios-workflow.test.ts
--silent=false --reporter=default`
- `NEMOCLAW_RUN_E2E_SCENARIOS=1 npx vitest run --project
e2e-scenarios-live
test/e2e-scenario/live/credential-sanitization.test.ts --silent=false
--reporter=default` (local no-secret run: product-code assertions pass,
live sandbox section skips on missing `NVIDIA_API_KEY`)
- `npx vitest run test/validate-blueprint.test.ts
src/lib/security/credential-filter.test.ts --silent=false
--reporter=default`
- `npm run typecheck:cli`
- `git diff --check`
- PR: #5336
- Same-runner selective run:
https://github.com/NVIDIA/NemoClaw/actions/runs/27432354309 —
`credential-sanitization-vitest` passed on `ubuntu-latest` with
Docker/OpenShell and `NVIDIA_API_KEY` after latest main merge/dependency
fix (`f2cd7cc46`).
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Added a live end-to-end test that validates credential sanitization
during install/onboarding, checks sandbox filesystem boundaries, ensures
sensitive fields are redacted, and emits a scenario artifact summarizing
assertions.
* **Chores**
* CI updated to add a dedicated credential-sanitization job to
validation, matrix generation and PR reporting; job runs the new live
scenario, handles Docker auth with fallback/retry and ensures cleanup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 7a8fcae commit 62f7243
4 files changed
Lines changed: 476 additions & 3 deletions
File tree
- .github/workflows
- test/e2e-scenario
- live
- support-tests
- tools/e2e-scenarios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
696 | 780 | | |
697 | 781 | | |
698 | 782 | | |
| |||
1792 | 1876 | | |
1793 | 1877 | | |
1794 | 1878 | | |
| 1879 | + | |
1795 | 1880 | | |
1796 | 1881 | | |
1797 | 1882 | | |
| |||
0 commit comments