Skip to content

feat: devcontainer tests, action defaults tests, testnet widget, output-panel benchmarks#934

Merged
Gbangbolaoluwagbemiga merged 1 commit into
HyperSafeD:mainfrom
leojay-net:feat/issues-622-626-737-609-tests-widget-benchmarks
Jun 26, 2026
Merged

feat: devcontainer tests, action defaults tests, testnet widget, output-panel benchmarks#934
Gbangbolaoluwagbemiga merged 1 commit into
HyperSafeD:mainfrom
leojay-net:feat/issues-622-626-737-609-tests-widget-benchmarks

Conversation

@leojay-net

Copy link
Copy Markdown
Contributor

Summary

This PR addresses four issues in a single pass, all centred on hardening tests, adding
fixtures, and delivering new production-ready features with CI coverage.


#622 – vscode-extension: devcontainer integration tests + fixtures

New files

  • vscode-extension/src/devcontainer.test.ts — 17 Jest tests covering devcontainer.json structure, Soroban project detection via Cargo.toml, remote workspace URI scheme detection, and shell-injection safety checks
  • vscode-extension/src/test/fixtures/devcontainer/devcontainer.json — canonical fixture
  • vscode-extension/src/test/fixtures/devcontainer/soroban-cargo.toml — Soroban project fixture
  • vscode-extension/src/test/fixtures/devcontainer/plain-cargo.toml — non-Soroban project fixture

Modified

  • .github/workflows/vscode-extension-ci.yml — added .devcontainer/** to path triggers
  • Fixed pre-existing package.json JSON parse errors (duplicate description/command/test/lint keys) and tsconfig.json duplicate exclude field that prevented npm test from running
  • Cleaned up src/analyzer.test.ts and src/test/analyzer.test.ts which had corrupted content from multiple merged versions; all 83 pre-existing passing tests are preserved

#626 – action.yml: unit tests + fixtures for inputs validation and defaults

New files

  • tests/action/test_action_defaults.py — 24 unit tests covering default values, all allowed severities and formats, boolean normalisation (true/yes/1, false/no/0, uppercase), write_env_file output content and security properties, and fixture-driven validation
  • tests/action/fixtures/valid_action_inputs.yml — 9 valid input combinations
  • tests/action/fixtures/invalid_action_inputs.yml — 9 invalid input combinations with expected error fragments
  • tests/__init__.py and tests/action/__init__.py for python -m unittest discover -t . support

#737 – Live testnet status widget on docs site

New files

  • frontend/app/api/testnet-status/route.ts — API route: Soroban RPC getLatestLedger for network health + ledger; Stellar Expert REST API per contract; Promise.allSettled parallel fetch with 8 s timeouts; 30 s Cache-Control header
  • frontend/app/components/TestnetStatusWidget.tsx — React client component with Live/Offline badges, animated status dots, ledger display, Stellar Expert deep-links, last-updated timestamp, manual refresh, and auto-refresh every 30 s
  • frontend/app/components/TestnetStatusWidget.test.tsx — 16 Vitest tests covering all widget states and accessibility

Modified

  • DOCUMENTATION_INDEX.md — added entry linking the widget, API route, and LIVE_TESTNET.md

#609 – vscode-extension: output panel performance benchmarks + budgets

New files

  • vscode-extension/src/output-format.ts — centralised output-channel formatting utilities
  • vscode-extension/src/output-format.test.ts — 29 Jest tests with performance budget assertions: 1 000 findings rendered in <5 ms, 10 000-char stderr line in <1 ms, 1 MB truncation in <10 ms, 100 mixed lines in <2 ms

Test plan

  • cd vscode-extension && npm test — 112 Jest tests pass (5 suites)
  • python -m unittest discover -s tests/action -p "test_*.py" -t . — 44 Python tests pass
  • cd frontend && npx vitest run app/components/TestnetStatusWidget.test.tsx — 16 tests pass
  • Full CI matrix: vscode-extension-ci.yml (Ubuntu / macOS / Windows) and ci.yml pass

Closes #622
Closes #626
Closes #737
Closes #609

HyperSafeD#622, HyperSafeD#626, HyperSafeD#737, HyperSafeD#609)

Issue HyperSafeD#622 – vscode-extension: devcontainer integration tests + fixtures
- Add src/devcontainer.test.ts with 17 Jest tests covering devcontainer.json
  structure, Soroban project detection via Cargo.toml, remote workspace URI
  handling, and shell-injection safety checks on postCreateCommand
- Add fixture files: devcontainer.json, soroban-cargo.toml, plain-cargo.toml
  under src/test/fixtures/devcontainer/
- Extend .github/workflows/vscode-extension-ci.yml to trigger on
  .devcontainer/** path changes so devcontainer config is covered by CI
- Fix pre-existing package.json JSON errors (duplicate keys) and
  tsconfig.json duplicate "exclude" field that broke test runs
- Clean up src/analyzer.test.ts and src/test/analyzer.test.ts which had
  corrupted mixed content from multiple merged versions; consolidate into
  clean Jest-style files (83 tests → 83 tests, all passing)

Issue HyperSafeD#626 – action.yml: unit tests + fixtures for inputs validation and defaults
- Add tests/action/test_action_defaults.py with 24 unit tests covering:
  default value verification, all allowed severities/formats, boolean
  normalisation (true/yes/1/false/no/0/uppercase variants), write_env_file
  output content and line discipline, and fixture-driven validation
- Add tests/action/fixtures/valid_action_inputs.yml (9 valid test cases)
- Add tests/action/fixtures/invalid_action_inputs.yml (9 invalid test cases)
- Add tests/__init__.py and tests/action/__init__.py to allow Python
  unittest discover to work correctly with -t option

Issue HyperSafeD#737 – live testnet status widget on docs site
- Add frontend/app/api/testnet-status/route.ts: Next.js API route that
  queries Soroban Testnet RPC (getLatestLedger) for network health and
  Stellar Expert REST API for per-contract live status; 30 s cache header
- Add frontend/app/components/TestnetStatusWidget.tsx: client component
  showing network status, ledger number, per-contract Live/Offline badges,
  explorer links, last-refresh time, and manual refresh button
- Add frontend/app/components/TestnetStatusWidget.test.tsx: 16 Vitest +
  Testing Library tests covering loading, success, offline, error, refresh,
  and accessibility scenarios
- Update DOCUMENTATION_INDEX.md to link the widget and API route

Issue HyperSafeD#609 – vscode-extension: output panel performance benchmarks + budgets
- Add src/output-format.ts: centralised output-channel formatting module
  (formatLine, formatScanStart, formatCliExit, formatFindings,
  renderOutputBlock, truncateOutput)
- Add src/output-format.test.ts: 29 Jest tests including performance budget
  assertions — 1 000 findings rendered in <5 ms, 10 000-char stderr line
  in <1 ms, 1 MB truncation in <10 ms, 100 mixed lines in <2 ms

Closes HyperSafeD#622
Closes HyperSafeD#626
Closes HyperSafeD#737
Closes HyperSafeD#609
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@leojay-net is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@leojay-net Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Gbangbolaoluwagbemiga Gbangbolaoluwagbemiga merged commit fb53380 into HyperSafeD:main Jun 26, 2026
12 of 27 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

2 participants