Skip to content

fix(tools): apply runtime contracts to std examples - #1057

Merged
LunaStev merged 4 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/std-example-contracts-994
Nov 2, 2026
Merged

LunaStev merged 4 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/std-example-contracts-994

Conversation

@hiyouwhatsapp

@hiyouwhatsapp hiyouwhatsapp commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #994

The std example runner only accepted exit 0 and wasn't checking output fixtures, so a broken example could still pass.

It now uses the existing test-contract helpers for expected exits, stdin, environment and stdout/stderr. Unsupported run modes fail explicitly, and reports cannot overwrite borrowed fixtures.

Fixture variables overlay the supplied compiler environment, preserving compiler SDK settings and other inherited values. Reports retain actual_exit for completed processes and use null when execution never completes.

The reported KeyError came from the fake compiler's 200 ms startup timeout: an ordinary failure could be classified as a timeout before it returned exit 7. The regression now allows startup time while still checking real timeout termination, captured output and JSON exit reporting.

Validation:

  • Focused corpus, runtime-contract and metadata tests: 46 run, 2 skipped, no failures.
  • Full local Python discovery attempted: Windows symlink permissions prevented four subcases; two encoding checks passed when rerun with CI's UTF-8 setting.
  • All 50 upstream CI checks pass on commit 0ac994e. CI results

@LunaStev

LunaStev commented Nov 1, 2026

Copy link
Copy Markdown
Member

The runtime-contract validation is a useful improvement, but the current CI reports a regression in tools.test_corpus_execution.CorpusProcessTests.test_nonzero_and_per_file_timeout_keep_output_and_json_results.

The test fails with:

KeyError: 'actual_exit'

Please investigate why the execution report no longer contains the expected actual_exit field, preserve the existing reporting contract, and add or update regression coverage.

Also, please verify that fixture-defined environment variables preserve the necessary compiler execution environment instead of unintentionally replacing it.

Once these issues are addressed, please rerun the full CI suite.

Overlay fixture variables on the supplied compiler environment. Keep actual_exit present for unfinished cases, and give real fake-compiler processes sufficient startup time before testing timeout handling.

Signed-off-by: devlewanabe <[email protected]>
@LunaStev
LunaStev merged commit d7c7fad into wavefnd:master Nov 2, 2026
50 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

Development

Successfully merging this pull request may close these issues.

Apply declared execution contracts when running standard-library examples

2 participants