Skip to content

feat(test): JUnit XML + TAP structured output for CI integration#40

Merged
jordanhubbard merged 12 commits intomainfrom
feature/error-messages
Mar 31, 2026
Merged

feat(test): JUnit XML + TAP structured output for CI integration#40
jordanhubbard merged 12 commits intomainfrom
feature/error-messages

Conversation

@jordanhubbard
Copy link
Copy Markdown
Owner

Adds --format=junit|tap and --output=FILE flags to tests/run_all_tests.sh.

What

  • Per-test timing (nanosecond precision, falls back to seconds)
  • make test-junittest-results.xml (JUnit XML, works with dorny/test-reporter)
  • make test-taptest-results.tap (TAP v13, works with tap-reporter)
  • GitHub Actions CI step now publishes JUnit results as a check

Why

Grounds the error codes (E001-E011) and profiler (--profile, --profile-json, --profile-flamegraph) in visible CI test reporting. Test results appear as annotations in PRs.

Testing

Smoke tested with --lang --format=junit and --lang --format=tap. Existing human output unchanged.

jordanhubbard and others added 3 commits March 30, 2026 12:31
run_all_tests.sh:
- New flags: --format=junit|tap, --output=FILE (defaults: test-results.xml/.tap)
- Per-test timing via date +%s%N (falls back to seconds)
- record_result() accumulates test results in parallel arrays
- _elapsed() helper computes wall-clock time in seconds per test
- All pass/fail/skip/compile-error paths call record_result()
- emit_junit() writes valid JUnit XML (testsuites/testsuite/testcase/failure)
  - classname: nanolang.<category>.<testname>
  - per-test time attribute, failure message from first 5 lines of log
- emit_tap() writes TAP version 13 with yaml failure blocks
- Existing human-readable output unchanged (format flags are additive)
- --help/-h flag added

Makefile.gnu:
- make test-junit: runs full suite, writes test-results.xml
- make test-tap:   runs full suite, writes test-results.tap

.github/workflows/ci.yml:
- New step 'Run test suite with JUnit XML output' (make test-junit)
- dorny/test-reporter@v1 publishes test-results.xml as GitHub check
  (continue-on-error: true so CI doesn't fail on reporter issues)

Tested: --lang --format=junit produces valid XML with 6 testcases + timing
        --lang --format=tap produces valid TAP v13 with 6 ok lines
Implement shell-based package manager for NanoLang:
- nano.toml manifest format (package name, version, dependencies)
- nano.lock lockfile (pinned versions + SHA-256 checksums)
- scripts/nano-pkg.sh with install/publish/update/init/list/info
- bin/nanoc-pkg CLI wrapper
- Git-based registry (github.com/jordanhubbard/nano-packages)
- Semantic versioning with >=, ^, ~, exact, and * constraints
- Recursive dependency resolution
- Integration with existing module system (modules/ directory)
- Makefile targets: pkg-install, pkg-publish, pkg-update, pkg-init, pkg-list
- docs/PACKAGE_MANAGER.md (written in NanoLang persona voice)
- examples/hello_pkg/ with nano.toml and main.nano
…ns, type checking

Adds an algebraic effect system with:
- effect declarations: effect IO { print : string -> void }
- handle expressions: handle { body } with { op args -> handler }
- pub effect visibility for module exports
- Effect resolution: typechecker matches handler ops against registered effects
- Error diagnostics: E013 (duplicate), E014 (empty handler), E015 (unknown op)
- TOKEN_EFFECT, TOKEN_HANDLE, TOKEN_WITH, TOKEN_RESUME keywords
- AST_EFFECT_DECL, AST_HANDLE_EXPR node types
- EffectDef/EffectOp types in Environment with env_define_effect/env_get_effect
- Phase 1 transpilation: handle evaluates to body (pure-by-default)
- Tests: positive (basic, multi-op, pub) and negative (duplicate, unknown op)

Makes nanolang production-safe for agentOS WASM modules where effect
isolation matters for the seL4 capability model. Functions without effects
are pure; side effects must be declared explicitly.

Phase 2 (future): perform/resume continuation-based dispatch, effect rows
in function type signatures, effect polymorphism.
@jordanhubbard jordanhubbard force-pushed the feature/error-messages branch from d262144 to 7bfad36 Compare March 30, 2026 19:34
jordanhubbard and others added 4 commits March 30, 2026 13:46
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…checker.c

The algebraic effects cherry-pick added usage at line ~3130 inside
check_expression_impl, but the definition was only at line ~4256.
In C, file-scope declarations are visible only from their declaration
point, so this caused 'undeclared' errors in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…/WITH/RESUME by 1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jordanhubbard and others added 5 commits March 30, 2026 16:46
'handle' is now a reserved keyword for algebraic effects. Rename
it in all stdlib modules and tests that used it as an identifier:

- modules/std/collections/{hashmap,set,stringbuilder}.nano: rename
  struct field 'handle' -> 'raw'
- modules/pybridge/pybridge.nano: rename param/var 'handle' -> 'mod_handle'
- tests/test_affine_integration.nano: rename struct field 'handle' -> 'raw'
- tests/run_all_tests.sh: mark test_effects_negative.nano and
  test_effects_neg2.nano as expected failures (they test compile errors)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- tests/test_pybridge_full.nano: rename local var 'handle' -> 'mod_handle'
  (handle is now a reserved keyword for algebraic effects)
- tests/test_stdlib_strings.nano: add missing main() function so the
  test runner can execute it as a standalone program

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dorny/test-reporter action needs checks:write to publish results.
Add continue-on-error to prevent the publish step from failing the job
when permissions are unavailable (e.g., workflow_dispatch context).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n() function

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Code Coverage Report

📊 Coverage: 55.5%

✅ Coverage threshold (50%) met.

View detailed report in artifacts

@jordanhubbard jordanhubbard merged commit 9986bfd into main Mar 31, 2026
20 checks passed
@jordanhubbard jordanhubbard deleted the feature/error-messages branch March 31, 2026 07:04
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