feat(test): JUnit XML + TAP structured output for CI integration#40
Merged
jordanhubbard merged 12 commits intomainfrom Mar 31, 2026
Merged
feat(test): JUnit XML + TAP structured output for CI integration#40jordanhubbard merged 12 commits intomainfrom
jordanhubbard merged 12 commits intomainfrom
Conversation
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.
d262144 to
7bfad36
Compare
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>
'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>
Code Coverage Report📊 Coverage: 55.5% ✅ Coverage threshold (50%) met. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
--format=junit|tapand--output=FILEflags totests/run_all_tests.sh.What
make test-junit→test-results.xml(JUnit XML, works with dorny/test-reporter)make test-tap→test-results.tap(TAP v13, works with tap-reporter)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=junitand--lang --format=tap. Existing human output unchanged.