Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
8a6f8de
fix: ensure teardown always runs even when setup fails
andreasjansson Feb 2, 2026
874eb82
deps: add ctrlc crate for signal handling
andreasjansson Feb 2, 2026
f6a00e0
feat: add signal handler for graceful shutdown with teardown
andreasjansson Feb 2, 2026
8b7eab2
feat: add interrupted flag for signal handling
andreasjansson Feb 2, 2026
f6b3e28
feat: check for interruption during test execution
andreasjansson Feb 2, 2026
3e14487
fix: remove stray quote in Cargo.toml
andreasjansson Feb 2, 2026
635c69e
test(teardown): add failing setup fixture
andreasjansson Feb 2, 2026
e86e08f
test(teardown): add teardown fixture that writes marker
andreasjansson Feb 2, 2026
0c33f4e
test(teardown): add main test in failing setup fixture
andreasjansson Feb 2, 2026
7dc03dd
test(teardown): add corpus test for teardown-always-runs
andreasjansson Feb 2, 2026
f621566
test(teardown): use /tmp marker files for cross-process detection
andreasjansson Feb 2, 2026
676072b
test(teardown): use /tmp marker for teardown detection
andreasjansson Feb 2, 2026
b1be53e
test(teardown): use /tmp marker for main test detection
andreasjansson Feb 2, 2026
ac40b7b
test(teardown): rewrite test to use /tmp marker files
andreasjansson Feb 2, 2026
d217940
test(teardown): fix expected output format
andreasjansson Feb 2, 2026
4017850
test(teardown): add slow_tests fixture for signal testing
andreasjansson Feb 2, 2026
6c6dd86
test(teardown): add teardown for signal test
andreasjansson Feb 2, 2026
e05b1e5
test(teardown): add slow tests for signal interruption testing
andreasjansson Feb 2, 2026
d3dd53d
test(teardown): add SIGTERM signal handling test
andreasjansson Feb 2, 2026
8631a5f
feat: enable termination feature in ctrlc for SIGTERM handling
andreasjansson Feb 2, 2026
470c935
refactor: make signal handler more robust
andreasjansson Feb 2, 2026
a9a6b61
feat: check for interruption between individual tests
andreasjansson Feb 2, 2026
ac528a3
debug: add tracing for teardown execution
andreasjansson Feb 2, 2026
9787969
fix: add ignore_interruption param to run_corpus_file for teardown
andreasjansson Feb 2, 2026
e84d1a8
fix: respect ignore_interruption flag in test loop
andreasjansson Feb 2, 2026
d1182df
fix: pass ignore_interruption=false to setup and main tests
andreasjansson Feb 2, 2026
1be97cc
fix: pass ignore_interruption=true to teardown
andreasjansson Feb 2, 2026
cac98cf
chore: remove debug statements
andreasjansson Feb 2, 2026
d3c1154
test(teardown): increase delay for signal test reliability
andreasjansson Feb 2, 2026
8a153fe
test(teardown): mark signal test as skip with explanation
andreasjansson Feb 2, 2026
20408c1
docs: clarify teardown always runs, even when setup fails or on SIGIN…
andreasjansson Feb 2, 2026
fa07893
chore: update Cargo.lock and format code
andreasjansson Feb 2, 2026
a393429
test(teardown): add Windows failing setup fixture
andreasjansson Feb 2, 2026
afd96a0
test(teardown): add Windows teardown fixture
andreasjansson Feb 2, 2026
fd23b0e
test(teardown): add Windows main test fixture
andreasjansson Feb 2, 2026
e8c2f56
test(teardown): add Windows teardown tests
andreasjansson Feb 2, 2026
40960d8
fix: check for interruption after each test completes for faster resp…
andreasjansson Feb 2, 2026
bf099ca
test(signal): add signal sync fixture setup
andreasjansson Feb 2, 2026
3316f6f
test(signal): add signal sync fixture teardown
andreasjansson Feb 2, 2026
cd28d69
test(signal): add signal sync fixture tests with synchronization marker
andreasjansson Feb 2, 2026
9adb18c
test(signal): add comprehensive SIGINT test with synchronization
andreasjansson Feb 2, 2026
f3f1a88
test(signal): use exec to ensure signal reaches cctr directly
andreasjansson Feb 2, 2026
f70d8c1
test(signal): add helper script for signal testing
andreasjansson Feb 2, 2026
49a8293
debug: add logging for interrupt flag checking
andreasjansson Feb 2, 2026
2a90894
debug: add logging for interrupt check after test
andreasjansson Feb 2, 2026
b47c649
debug: add more verbose logging
andreasjansson Feb 2, 2026
66cb71b
test(signal): improve synchronization in signal test script
andreasjansson Feb 2, 2026
8dc5987
debug: add PID to signal handler message
andreasjansson Feb 2, 2026
8a9b917
chore: remove debug logging
andreasjansson Feb 2, 2026
957533d
chore: remove more debug logging
andreasjansson Feb 2, 2026
39a3e3a
chore: remove last debug logging
andreasjansson Feb 2, 2026
e9d4b66
chore: remove PID from signal handler message
andreasjansson Feb 2, 2026
101acff
test(signal): update test to call helper script
andreasjansson Feb 2, 2026
9190d75
test(signal): simplify signal test assertions
andreasjansson Feb 2, 2026
cab0005
test(signal): suppress extra output from helper script
andreasjansson Feb 2, 2026
68dd221
test(signal): comprehensive SIGINT handling test with helper script
andreasjansson Feb 2, 2026
12018d0
fix: ensure test files keep LF line endings on Windows
andreasjansson Feb 2, 2026
893dfb0
fix: allow too_many_arguments for run_corpus_file
andreasjansson Feb 2, 2026
d486edf
chore: bump version to 0.27.0
andreasjansson Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# Use bd merge for beads JSONL files
.beads/issues.jsonl merge=beads

# Keep test corpus files with LF endings (Unix-style) on all platforms
# This ensures the corpus parser works correctly on Windows
test/**/*.txt text eol=lf
*.sh text eol=lf
Empty file added .veta/.lock
Empty file.
1 change: 1 addition & 0 deletions .veta/counter
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
Binary file removed .veta/db.sqlite
Binary file not shown.
6 changes: 6 additions & 0 deletions .veta/notes/1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"body": "When running cctr tests that call cctr recursively (e.g., tests that run 'cctr $CCTR_FIXTURE_DIR/tests'), the nested invocation uses the installed cctr binary (e.g., ~/.local/bin/cctr), NOT the debug build (./target/debug/cctr).\n\nThis causes confusing test failures when developing new features - the outer test uses the new code, but inner tests use the old installed version.\n\nFix: Run './script/install' to update the installed binary before running tests, or use PATH manipulation to ensure the debug build is found first.",
"modified": "2026-01-29 00:12:54",
"references": [],
"title": "cctr: nested tests use installed binary, not debug build"
}
8 changes: 8 additions & 0 deletions .veta/notes/2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"body": "When bumping the version, update all 3 occurrences in the root Cargo.toml:\n\n1. [workspace.package] version = \"X.Y.Z\"\n2. cctr-expr = { version = \"X.Y.Z\", ... }\n3. cctr-corpus = { version = \"X.Y.Z\", ... }\n\nAll three must match or cargo build will fail.",
"modified": "2026-01-29 00:15:33",
"references": [
"Cargo.toml"
],
"title": "cctr: version bump requires 3 places in Cargo.toml"
}
6 changes: 6 additions & 0 deletions .veta/notes/3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"body": "GitHub CI runs fmt and clippy checks that will fail if code isn't formatted or has warnings.\n\nBefore pushing, always run:\n1. cargo fmt --all\n2. cargo clippy --all-targets --all-features -- -D warnings\n\nOr just run ./script/test which does both.",
"modified": "2026-01-29 00:20:33",
"references": [],
"title": "cctr: always run cargo fmt and clippy before pushing"
}
8 changes: 8 additions & 0 deletions .veta/notes/4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"body": "cmd.exe has several issues with multi-line commands:\n1. `cmd /C` only executes the first line of a multi-line command\n2. For loop variables need `%%i` in batch files but `%i` interactively\n3. `echo content >` includes trailing space before redirect - need `echo content>`\n4. Same trailing space issue with pipes: `echo hello |` vs `echo hello|`\n\nPowerShell is cleaner:\n- `powershell -Command` handles multi-line commands directly (like bash -c)\n- Consistent $variable syntax in scripts and interactive\n- No trailing space issues\n- Can use: `powershell -ExecutionPolicy Bypass -Command $command`\n\nDecision: Default to PowerShell on Windows, bash on Unix. Add %shell directive for override.",
"modified": "2026-01-29 07:11:39",
"references": [
"crates/cctr/src/runner.rs"
],
"title": "Windows shell execution: PowerShell vs cmd.exe"
}
10 changes: 10 additions & 0 deletions .veta/notes/5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"body": "Refactored directive design:\n\n## %skip\n- Works at: _setup.txt (skips suite), file-level, test-level\n- Syntax: %skip, %skip(message), %skip if: command, %skip(message) if: command \n- Conditional skip runs in the file's shell (or default)\n\n## %platform (NEW)\n- Works at: _setup.txt, file-level only\n- Syntax: %platform windows or %platform unix, mac, linux\n- Comma-separated list, no 'not' support\n- Skips all tests if current platform not in list\n\n## %shell\n- Works at: file-level only (no test-level!)\n- Co-validated with %platform before tests run\n- Error if incompatible (e.g. %shell cmd + %platform unix)\n\nDefaults: bash on Unix, PowerShell on Windows",
"modified": "2026-01-29 09:25:56",
"references": [
"crates/cctr/src/runner.rs",
"crates/cctr-corpus/src/lib.rs",
"README.md"
],
"title": "cctr directive design: %skip, %platform, %shell"
}
9 changes: 9 additions & 0 deletions .veta/notes/6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"body": "On Windows, `bash` in PATH may point to WSL's bash.exe (in C:\\Windows\\System32) which:\n1. Doesn't work with Windows filesystem paths \n2. Errors out asking you to install a WSL distribution\n\nv0.23.1 tried to fix this by hardcoding Git Bash path, but that broke systems without Git Bash.\n\nv0.23.2 fix: Use OnceLock to cache bash detection. Try `bash -c 'echo ok'` first - if it returns 'ok', use PATH bash. Otherwise fall back to Git Bash at C:\\Program Files\\Git\\bin\\bash.exe.\n\nAdded test/windows/bash.txt to verify bash works on Windows CI.",
"modified": "2026-01-29 11:41:12",
"references": [
"crates/cctr/src/runner.rs:15-45",
"test/windows/bash.txt"
],
"title": "Windows bash detection: WSL vs Git Bash"
}
10 changes: 10 additions & 0 deletions .veta/notes/7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"body": "v0.24.0 adds -vv flag for streaming test output in real-time.\n\nImplementation:\n- Uses mpsc channel to receive lines from stdout/stderr as they arrive\n- Two threads read stdout and stderr separately, sending lines to the channel\n- Main thread receives lines and calls the callback immediately\n- StreamingContext struct holds progress_tx and test metadata for sending TestOutput events\n\nKey files:\n- runner.rs: run_command_streaming(), StreamingContext\n- output.rs: print_progress() handles TestOutput event\n- cli.rs: verbose is now u8 (count) instead of bool\n\nNote: With -vv, stdout/stderr lines may interleave in non-deterministic order since both are read concurrently.",
"modified": "2026-01-30 14:35:38",
"references": [
"crates/cctr/src/runner.rs:205-270",
"crates/cctr/src/output.rs:41-80",
"crates/cctr/src/cli.rs"
],
"title": "cctr -vv streaming output implementation"
}
10 changes: 10 additions & 0 deletions .veta/notes/8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"body": "v0.24.0 adds automatic stripping of ANSI escape codes from command output using the strip-ansi-escapes crate.\n\nThis allows testing CLI tools that output colored text without needing to disable colors or match escape sequences.\n\nImplementation:\n- Added strip-ansi-escapes = \"0.2\" dependency\n- Both run_command() and run_command_streaming() strip ANSI codes\n- Stripping happens per-line in streaming mode, on combined output in normal mode\n\nTest: test/ansi_stripping/ verifies bold, color, 256-color, RGB, and cursor movement codes are all stripped.",
"modified": "2026-01-30 23:05:42",
"references": [
"crates/cctr/Cargo.toml",
"crates/cctr/src/runner.rs:191-199",
"test/ansi_stripping/"
],
"title": "cctr strips ANSI escape codes from command output"
}
9 changes: 9 additions & 0 deletions .veta/notes/9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"title": "Teardown always runs - implementation details",
"body": "v0.27.0 adds guaranteed teardown execution:\n\n1. Teardown runs even when setup fails (was returning early before)\n2. Teardown runs on SIGINT/SIGTERM (ctrlc crate with termination feature)\n3. Added ignore_interruption param to run_corpus_file for teardown\n\nSignal handling gotcha: When cctr runs in a subshell (bash -c), signal handling may not work reliably because the process can be terminated before teardown runs. Works correctly when cctr runs directly.\n\nKey code changes:\n- run_suite no longer returns early on setup failure\n- Added is_interrupted() check between tests (but not for teardown)\n- run_teardown_if_exists passes ignore_interruption=true",
"references": [
"crates/cctr/src/runner.rs:640-775",
"crates/cctr/src/main.rs:20-30"
],
"modified": "2026-02-02 22:00:07"
}
1 change: 1 addition & 0 deletions .veta/tags/cctr/1.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/2.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/3.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/4.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/5.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/6.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/7.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/8.json
1 change: 1 addition & 0 deletions .veta/tags/cctr/9.json
1 change: 1 addition & 0 deletions .veta/tags/debugging/1.json
1 change: 1 addition & 0 deletions .veta/tags/debugging/6.json
1 change: 1 addition & 0 deletions .veta/tags/decisions/4.json
1 change: 1 addition & 0 deletions .veta/tags/feature/5.json
1 change: 1 addition & 0 deletions .veta/tags/feature/7.json
1 change: 1 addition & 0 deletions .veta/tags/feature/8.json
1 change: 1 addition & 0 deletions .veta/tags/feature/9.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/1.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/2.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/3.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/4.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/6.json
1 change: 1 addition & 0 deletions .veta/tags/gotchas/9.json
1 change: 1 addition & 0 deletions .veta/tags/release/2.json
1 change: 1 addition & 0 deletions .veta/tags/shell/5.json
1 change: 1 addition & 0 deletions .veta/tags/windows/4.json
1 change: 1 addition & 0 deletions .veta/tags/windows/6.json
1 change: 1 addition & 0 deletions .veta/tags/workflow/3.json
91 changes: 88 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.26.0"
version = "0.27.0"
edition = "2021"
authors = ["Andreas Jansson"]
license = "MIT"
homepage = "https://github.com/andreasjansson/cctr"
repository = "https://github.com/andreasjansson/cctr"

[workspace.dependencies]
cctr-expr = { version = "0.26.0", path = "crates/cctr-expr" }
cctr-corpus = { version = "0.26.0", path = "crates/cctr-corpus" }
cctr-expr = { version = "0.27.0", path = "crates/cctr-expr" }
cctr-corpus = { version = "0.27.0", path = "crates/cctr-corpus" }

[profile.release]
lto = true
Expand Down
Loading