Repository navigation
Add integration test harness and GitHub Actions CI - #4
Merged
Merged
Conversation
- tests/run_tests.sh: builds agc, compiles and runs every tests/*.ag in a temp dir, prints per-test PASS/FAIL and a summary, exits nonzero on any failure. Supports running a single test by name. Syscall tests expect exit code 42 (they invoke sys_exit(42) per the runtime migration plan). - .github/workflows/ci.yml: on push/PR, installs LLVM 22 (matching inkwell llvm22-1 / llvm-sys 221 with LLVM_SYS_221_PREFIX), caches cargo, runs cargo test -p agc and the integration harness. - Delete stale tests/CMakeLists.txt and examples/CMakeLists.txt: both include(SilverUtils), which does not exist anywhere in the repo. - Update tests/README.md to document the new harness. Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a repo-local integration test harness for Silver (tests/*.ag) and wires both Rust unit tests (cargo test -p agc) and integration tests into a new GitHub Actions CI workflow, while removing unused CMake-based test/example scaffolding.
Changes:
- Add
tests/run_tests.shto buildagc, compile eachtests/*.ag, execute binaries, and summarize PASS/FAIL (with per-test expected exit codes and timeouts). - Add
.github/workflows/ci.ymlto run compiler unit tests and the new integration harness on push/PR. - Remove dead CMakeLists files and update
tests/README.mdto document the new flow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/run_tests.sh | New bash harness to build the compiler and run .ag integration tests with logging and expected-exit handling. |
| tests/README.md | Updates test documentation to describe the new harness and how to run tests locally/CI. |
| tests/CMakeLists.txt | Deletes unused/invalid CMake-based test definitions. |
| examples/CMakeLists.txt | Deletes unused/invalid CMake-based example build definitions. |
| .github/workflows/ci.yml | Adds CI workflow to install LLVM 22, cache Cargo, and run unit + integration tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+44
to
+51
| is_skipped() { | ||
| for skip in $SKIP_TESTS; do | ||
| if [ "$skip" = "$1" ]; then | ||
| return 0 | ||
| fi | ||
| done | ||
| return 1 | ||
| } |
| ``` | ||
|
|
||
| Tests return exit code 0 on success, 1 on failure, making them compatible with CTest. | ||
| Tests return exit code 0 on success, 1 on failure. |
Comment on lines
+18
to
+23
| wget -q https://apt.llvm.org/llvm.sh | ||
| chmod +x llvm.sh | ||
| sudo ./llvm.sh 22 | ||
| # llvm.sh installs the clang/lld toolchain; llvm-sys additionally | ||
| # needs the LLVM development files (llvm-config, headers, libs). | ||
| sudo apt-get install -y llvm-22-dev libpolly-22-dev libzstd-dev zlib1g-dev |
This was referenced Jul 20, 2026
CierCier
added a commit
that referenced
this pull request
Aug 1, 2026
Add integration test harness and GitHub Actions CI
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.
Summary
tests/run_tests.sh— new integration test harness: buildsagc(cargo build -p agc), then compiles everytests/*.agto a temp dir and runs it, printing a per-testPASS/FAILline and a final summary; exits nonzero if any test fails. Supports running a single test by name (bash tests/run_tests.sh vec_test). Failed compile/run logs are dumped inline for CI debugging. ASKIP_TESTSlist exists but is empty — all 18 tests currently pass. The two syscall tests intentionally exit with code 42 (sys_exit(42), perplan/runtime-migration.mdPhase 1), encoded via a per-testexpected_exittable..github/workflows/ci.yml— single job on push + pull_request (ubuntu-24.04): installs LLVM 22 from apt.llvm.org (matching inkwell'sllvm22-1feature /llvm-sys221, withLLVM_SYS_221_PREFIX=/usr/lib/llvm-22), caches cargo registry + target keyed onCargo.lock, then runscargo test -p agcfollowed bybash tests/run_tests.sh.tests/CMakeLists.txtandexamples/CMakeLists.txt— bothinclude(SilverUtils), which does not exist anywhere in the repo, so they were dead.tests/README.md— rewritten to document the new harness instead of the defunct CMake/CTest flow.Test plan
bash tests/run_tests.sh— 18/18 PASS, exit 0cargo test -p agc— 220 passed🤖 Generated with Claude Code
Greptile Summary
This PR replaces the defunct CMake/CTest build system (which depended on a non-existent
SilverUtilsmodule) with a self-contained bash integration harness (tests/run_tests.sh) and a GitHub Actions CI workflow (.github/workflows/ci.yml). It also rewrites the tests README to match the new harness.tests/run_tests.shbuildsagc, discovers everytests/*.agfile via glob, compiles and runs each in an isolated scratch directory with a 120-second timeout, per-test expected exit codes (syscall_test/syscall_wrapper_testintentionally exit 42), a skip list, and inline log dumps on failure..github/workflows/ci.ymlruns on push tomainand on all pull requests; installs LLVM 22 via the official apt repository (replacing the previously flaggedllvm.shapproach), caches cargo artifacts under a key that includesllvm-22, then runscargo test -p agcfollowed bybash tests/run_tests.sh.CMakeLists.txtfiles (bothinclude(SilverUtils)which never existed) are removed.Confidence Score: 5/5
Safe to merge — the harness and workflow are well-structured, critical failure paths are explicitly checked, and the two deleted CMakeLists files were confirmed dead.
The changes are additive (a new bash harness, a new CI workflow, documentation, and two dead-file deletions) with no modifications to compiler or runtime code. All critical branches in run_tests.sh have explicit guards. The CI workflow now correctly restricts push triggers to main and includes LLVM version in the cache key. The two nits found — a wget failure that would surface later as an apt error, and a missing nullglob guard in the test glob — do not affect the correctness of any current CI run.
No files require special attention; both findings are in low-risk areas (CI diagnostics and an unreachable glob edge case).
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A([bash tests/run_tests.sh]) --> B{Argument given?} B -- yes --> C[Resolve single tests/name.ag] B -- no --> D[Glob tests/*.ag into array] C --> E[cargo build -p agc] D --> E E -- fail --> F([exit 1]) E -- success --> G[Check binary exists] G -- missing --> F G -- ok --> H[mktemp WORKDIR / set EXIT trap] H --> I[[For each test]] I --> J{is_skipped?} J -- yes --> K[SKIP] J -- no --> L[agc compile to WORKDIR/name] L -- fail --> M[FAIL: compile error, print log] L -- success --> N[timeout run in scratch rundir] N --> O{exit == expected_exit?} O -- yes --> P[PASS] O -- no, 124 --> Q[FAIL: timed out, print log] O -- no, other --> R[FAIL: wrong exit, print log] K --> I P --> I M --> I Q --> I R --> I I -- done --> S[Print summary] S --> T{any failed?} T -- yes --> U([exit 1]) T -- no --> V([exit 0])%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A([bash tests/run_tests.sh]) --> B{Argument given?} B -- yes --> C[Resolve single tests/name.ag] B -- no --> D[Glob tests/*.ag into array] C --> E[cargo build -p agc] D --> E E -- fail --> F([exit 1]) E -- success --> G[Check binary exists] G -- missing --> F G -- ok --> H[mktemp WORKDIR / set EXIT trap] H --> I[[For each test]] I --> J{is_skipped?} J -- yes --> K[SKIP] J -- no --> L[agc compile to WORKDIR/name] L -- fail --> M[FAIL: compile error, print log] L -- success --> N[timeout run in scratch rundir] N --> O{exit == expected_exit?} O -- yes --> P[PASS] O -- no, 124 --> Q[FAIL: timed out, print log] O -- no, other --> R[FAIL: wrong exit, print log] K --> I P --> I M --> I Q --> I R --> I I -- done --> S[Print summary] S --> T{any failed?} T -- yes --> U([exit 1]) T -- no --> V([exit 0])Reviews (3): Last reviewed commit: "tests: support inline comments in skip l..." | Re-trigger Greptile