Skip to content

fix(ci): restore test fixtures stripped by overbroad .gitignore#2

Merged
xsoheilalizadeh merged 17 commits intomainfrom
fix/ci-restore-test-fixtures
Apr 27, 2026
Merged

fix(ci): restore test fixtures stripped by overbroad .gitignore#2
xsoheilalizadeh merged 17 commits intomainfrom
fix/ci-restore-test-fixtures

Conversation

@xsoheilalizadeh
Copy link
Copy Markdown
Contributor

Summary

  • The *.txt rule in .gitignore was excluding test fixtures that tests include_str!(). CI has been red since the initial public commit.
  • Drop the *.txt rule (target/, **/obj/, dist/, **/node_modules/ already cover the build outputs).
  • Add the missing fixtures (parse/tsc.txt, parse/dotnet.txt, encoding tests, etc.).

Test plan

  • cargo test --workspace passes locally
  • cargo clippy --workspace --all-targets -- -D warnings passes locally
  • 8v check . passes

The `*.txt` rule in .gitignore (with a single `!ai_section.txt`
exception) was excluding 10+ test fixture files that
`include_str!()` in tests, breaking CI immediately on Linux.

- Drop the `*.txt` ignore rule. `target/`, `**/obj/`, `dist/`,
  `**/node_modules/` already cover the build outputs we want excluded.
- Add the missing parse/encoding/multi-ext test fixtures to git.
`parse_suite_summary` only handled nightly NDJSON output, so on
stable toolchains it returned None and the renderer emitted a
degenerate "tests failed {ms}" line without counts. The
`test_rust_fail_shows_structured_output` e2e test caught this
on CI (which uses dtolnay/rust-toolchain@stable) but it slipped
through locally where nightly is active.

Add a fallback that parses libtest's stable `test result: ok. N
passed; M failed; X ignored; ...` summary lines, summing across
multiple test binaries.
macOS runner left go undiscoverable for the spawned subprocess, causing
build_go_* e2e tests to fail in 1ms with SpawnError. Pin go 1.21 (matches
fixtures' go.mod) on both ubuntu and macOS for deterministic e2e runs.

Separately note: o8v/src/commands/build.rs:130 currently treats
ExitOutcome::SpawnError as plain build failure with empty stderr —
violates rule #4 (no silent fallbacks). Tracked as follow-up.
e2e_deno tests spawn 'deno check' — was producing
'No such file or directory (os error 2)' on ubuntu CI.
The e2e suite spawns ~14 external binaries (hadolint, helm, kustomize,
terraform, tflint, ktlint, ruff, mypy, biome, prettier, eslint, oxlint,
tsc, rubocop, staticcheck, deno, go) plus per-OS extras. Inlining all
the setup steps in the workflow was unreadable; a composite action keeps
ci.yml short and the install list maintainable in one place.
setup-beam@v1 rejected '3.22' — no matching tag in erlang/rebar3 releases.
Ubuntu's system gem/npm dirs need root; macOS Homebrew/nvm versions don't.
Also: pip --user (avoids dist-packages permission), add ~/.local/bin to PATH.
go vet -json writes findings to stderr on older toolchains and stdout on
newer ones. The parser previously read only stdout, so on a runner where
go writes to stderr the parser got nothing and reported zero diagnostics
on a fixture with a clear Printf format violation.

Pick the stream that actually starts with '{'. Mark Unparsed only when
both streams are empty (Parsed otherwise, matching prior behavior).
Some go toolchains interleave '# package/path' header lines with the
JSON stream that 'go vet -json' emits — and either stream (stdout or
stderr) may carry the JSON depending on toolchain version. The previous
parser only read stdout and choked on the first '#' character, so on a
runner where comments and JSON were mixed it produced zero diagnostics
on a fixture with a clear Printf format violation.

Strip lines starting with '#' from both streams, concatenate the
remainder, then deserialize. Adds a regression test mixing '# pkg' lines
with '{}' objects.
ruff/mypy were installed but not found on macOS — pip --user puts bins
under ~/Library/Python/<ver>/bin, not ~/.local/bin. Compute the actual
USER_BASE at install time and append <USER_BASE>/bin to GITHUB_PATH.
The flag was intended to fail 8v's own build on warnings, but it was
exported to every spawned cargo subprocess — including the ones the
e2e tests start, which then escalated warning-level diagnostics like
unused_imports to errors and broke severity assertions.

Clippy's own job already enforces -D warnings via the cargo clippy CLI.
The Append handler used a read-then-decide-then-append flow: it read the
file, checked the trailing byte to decide if a separator newline was
needed, then appended. Concurrent appends on a file missing a trailing
newline both observed the missing byte, both prepended their own
separator, and produced "\n\n" between contributions — an extra blank
line per race.

Push the separator decision into the fs layer behind an exclusive
advisory flock so peek-last-byte + conditional separator + content +
trailing newline are serialized. Adds safe_append_with_separator in
o8v-fs and a 50-thread regression test.

CRLF preservation in append is dropped for now (defer); the LF behavior
matches the original test fixture and the cross-OS expectations.
@xsoheilalizadeh xsoheilalizadeh added chore Refactor, cleanup, or infrastructure area/ci CI workflows and toolchain setup labels Apr 27, 2026
- Update security_path_traversal_dotdot to assert against the current
  error wording ("path escapes project directory") rather than the stale
  set — ContainmentViolation emits "path escapes", which was not in the
  OR conditions, causing the assertion to always fail on dotdot traversal.
- Fix RUSTSEC-2026-0104/-0098/-0099 (rustls-webpki 0.101.7): upgrade
  ureq from 2.8.0 → 2.12.1 (option b) by running cargo update; the
  new version depends on rustls 0.23 → rustls-webpki 0.103.13.
  Also rename the feature flag from the removed "rustls" to "tls" in
  o8v/Cargo.toml and o8v-testkit/Cargo.toml to match ureq 2.12.1's API.
@xsoheilalizadeh xsoheilalizadeh merged commit 1f11468 into main Apr 27, 2026
5 checks passed
@xsoheilalizadeh xsoheilalizadeh deleted the fix/ci-restore-test-fixtures branch April 27, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI workflows and toolchain setup chore Refactor, cleanup, or infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant