Skip to content

test: add pyhl::Runtime integration tests - #61

Merged
danbugs merged 1 commit into
mainfrom
test/pyhl-runtime-integration
May 17, 2026
Merged

test: add pyhl::Runtime integration tests#61
danbugs merged 1 commit into
mainfrom
test/pyhl-runtime-integration

Conversation

@danbugs

@danbugs danbugs commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 13 integration tests for the pyhl::Runtime library API, exercising the programmatic interface that downstream consumers use:

  • Basic execution: hello world, pandas import
  • Exit code propagation: sys.exit(0), sys.exit(42), unhandled exception
  • Hermetic execution: verifies globals don't leak between run_code() calls, repeated stable runs
  • Filesystem via Preopen: write+read, listdir, mkdir+stat — verifies host-side files match
  • Network policy: AllowList permits allowed host, blocks unlisted host, disabled by default

All tests self-skip gracefully if pyhl isn't set up or no hypervisor is available (same pattern as snapshot_roundtrip.rs).

Test plan

  • All 13 tests pass locally with cargo test --test pyhl_runtime -- --test-threads=1
  • cargo clippy clean
  • cargo fmt clean
  • Tests self-skip on machines without /dev/kvm or pyhl setup

Signed-off-by: danbugs <danilochiarlone@gmail.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux Benchmarks

Details
Benchmark suite Current: c64d5c8 Previous: 86d2609 Ratio
hello_world (median) 20 ms 20 ms 1
pandas (median) 100 ms 110 ms 0.91
density (per VM) 7 MB 7 MB 1
snapshot (disk) 385 MiB 385 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Benchmarks

Details
Benchmark suite Current: c64d5c8 Previous: 86d2609 Ratio
hello_world (median) 225 ms 245 ms 0.92
pandas (median) 658 ms 725 ms 0.91
density (per VM) 6 MB 6 MB 1
snapshot (disk) 392 MiB 392 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

@danbugs
danbugs merged commit 2c92788 into main May 17, 2026
79 checks passed
@danbugs
danbugs deleted the test/pyhl-runtime-integration branch May 17, 2026 06:14
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