Skip to content

test + ci: workspace unit coverage, cargo-matrix/nextest pipeline, and CI/dep refresh#259

Merged
CraZySacX merged 6 commits into
masterfrom
249-v1511-enhancements
Jun 14, 2026
Merged

test + ci: workspace unit coverage, cargo-matrix/nextest pipeline, and CI/dep refresh#259
CraZySacX merged 6 commits into
masterfrom
249-v1511-enhancements

Conversation

@CraZySacX

@CraZySacX CraZySacX commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary

Add the first-ever unit tests to all three Barto binaries (bartoc, barto-cli, bartos) and the libbarto doctests, migrate the test/coverage pipeline to cargo-matrix, switch CI tests to cargo-nextest, and refresh pinned action SHAs and workspace dependencies for the v1.5.11 release.

  • bartoc — 57 tests across 7 modules (first tests ever in this crate)
  • barto-cli — 43 tests across 5 modules (first tests ever in this crate)
  • bartos — ~36 tests across 7 modules (first tests ever in this crate)
  • Mark live-I/O code (needs a running bartos, MariaDB, platform keychain, or OS signals) with #[cfg_attr(coverage_nightly, coverage(off))] so it doesn't drag down coverage
  • Harden the barto-cli handler display arithmetic with saturating_sub (and max(1) on the print_height modulo divisor) so a narrow/headless terminal no longer panics on underflow
  • cargo-matrix migration — add [package.metadata.cargo-matrix] default/coverage channels to all four crates (the coverage channel always_includes unstable); run_all.fish / run_all.ps1 now run tests via cargo matrix nextest run (+ libbarto doctests) and coverage via cargo matrix -c coverage llvm-cov nextest --no-report
  • barto-cli: enable unstable = ["libbarto/unstable"]
  • Dependency updates (depsup); pin alloc-no-stdlib due to an upstream packaging issue

CI & dependency refresh

  • Tests now run under cargo-nextest in CI — bump the rustyhorde/workflows reusable-workflow pin to 60c2f58 (which adds optional nextest support) and set nextest: true on the three 🧪 Test jobs, matching the local pipeline. Coverage already uses nextest via COVERAGE_RUN_CMD. Job names are unchanged, so the master ruleset required-status-check list needs no update.
  • Refresh third-party action pins in release.yml / audit.yml:
    • Wandalen/wretry.actione68c23e (v3.8.0)
    • actions/checkoutdf4cb1c (v6.0.3)
    • cargo-bins/cargo-binstall252c5e7 (main)
    • rustyhorde/audit-checka6c4633 (v0.3.0 → v1.0.0; retains the token/deny/create_issue inputs)
  • Workspace dependency bumps: bon 3.9.1 → 3.9.2, getset 0.1.6 → 0.1.7, time 0.3.47 → 0.3.49, uuid 1.23.1 → 1.23.3, pin rpassword 7.5.4 and notify-debouncer-mini 0.7.0; promote regex to a workspace dependency (1.12.4) referenced from bartos and libbarto.

bartoc modules covered

Module Tests What
error.rs 9 All error Display strings
db/data/output.rs 9 OutputKey/OutputValue From<&Output> + Display
db/data/status.rs 8 StatusKey/StatusValue From<&Status> + Display
handler/stream.rs 7 HMAC replay-nonce protection logic
db/mod.rs 8 redb write/flush round-trips, cleanup, compaction
config/mod.rs 3 Path resolution with and without CLI override
runtime/cli.rs 13 All CLI flags and PathDefaults/PathDefaultsExt defaults

barto-cli modules covered

Module Tests What
error.rs 3 All error Display strings
runtime/cli.rs ~20 Flag/subcommand parsing, Source::collect, PathDefaults
config/mod.rs 4 Getters/setter and TracingConfig/TracingConfigExt impls
handler/mod.rs 8 maxes_* width calcs, handle_message, handle_binary dispatch
runtime/mod.rs 8 build_message for every Commands variant

bartos modules covered

Module Tests What
common/mod.rs 5 Clients add/remove/by-name/add-data, WorkerSignal equality
config/mod.rs 3 Defaults + TracingConfig/TracingConfigExt impls
error.rs 3 All error Display strings
db/utils.rs 4 apt/garuda/pacman/cachyos update-output filters
endpoints/insecure/mod.rs 3 Name / ip / describe helpers
endpoints/insecure/worker.rs 4 build_init_bytes, build_cleanup_bytes, sign_worker_payload
runtime/cli.rs ~11 All CLI flags, Source::collect, PathDefaults

Skipped / coverage-off (require live network, keychain, MariaDB, OS signals, or full runtime): bartoc runtime/mod::run, Handler::handle/wait_for_close, runtime/secrets.rs keyring fns, service.rs (Windows-only); bartos runtime/mod setup/server/signal/watcher fns, db/mysql handler, endpoints/insecure/{cli,worker} async handlers, handler/cli impl.

Test plan

  • cargo matrix nextest run — all tests pass
  • scripts/run_all.fish --no-install --no-musl — full CI pipeline passes (no lint errors)
  • CI green on this PR with the new nextest test step and refreshed action pins

🤖 Generated with Claude Code

Add best-effort test coverage to the bartoc binary: error display strings,
redb data type conversions and Display formatting, HMAC replay-nonce
protection logic, database round-trips (write/flush/cleanup/compact),
config path resolution, and CLI flag parsing.

Also widen set_redb_path visibility to pub(crate) to support Config
construction in tests outside the config module, and update run_all.fish /
run_all.ps1 to include bartoc in both the test step and coverage step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@CraZySacX CraZySacX self-assigned this Jun 14, 2026
@CraZySacX CraZySacX added the enhancement New feature or request label Jun 14, 2026
@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.51043% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.44%. Comparing base (a09dda7) to head (2fa1bac).

Files with missing lines Patch % Lines
barto-cli/src/runtime/cli.rs 93.28% 9 Missing ⚠️
barto-cli/src/handler/mod.rs 95.61% 5 Missing ⚠️
barto-cli/src/runtime/mod.rs 98.63% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (a09dda7) and HEAD (2fa1bac). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (a09dda7) HEAD (2fa1bac)
8 4
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #259       +/-   ##
===========================================
- Coverage   97.57%   84.44%   -13.13%     
===========================================
  Files          31       57       +26     
  Lines        4858     7979     +3121     
===========================================
+ Hits         4740     6738     +1998     
- Misses        118     1241     +1123     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CraZySacX and others added 3 commits June 14, 2026 10:34
Add 43 unit tests across error, runtime/cli, config, handler, and
runtime/mod, bringing barto-cli in line with bartoc's coverage.

- error: Display strings for all Error variants
- runtime/cli: flag/subcommand parsing, Source::collect, PathDefaults
- config: getters/setter and TracingConfig/TracingConfigExt impls
- handler: maxes_* width calcs, handle_message, handle_binary dispatch
- runtime/mod: build_message for every Commands variant

Mark live-I/O code that needs a running bartos or platform keychain with
#[cfg_attr(coverage_nightly, coverage(off))]: runtime::run,
Handler::handle/wait_for_close, and the secrets keyring functions.

Harden the handler display arithmetic with saturating_sub (and max(1)
for the print_height modulo divisor) so a narrow or headless terminal
no longer panics on underflow.

Stop excluding barto-cli from scripts/run_all.fish test and coverage
runs. Add uuid as a dev-dependency for building UuidWrapper keys in tests.

Mark xtask as skip-package for cargo-matrix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CraZySacX CraZySacX changed the title test(bartoc): add 57 unit tests across 7 modules test: add unit coverage for bartoc and barto-cli Jun 14, 2026
Add the first unit tests to the bartos crate and switch the test/coverage
pipeline to cargo-matrix so coverage builds run with the `unstable` feature.

- bartos: ~36 tests across common, config, error, db/utils,
  endpoints/insecure, and runtime/cli (first tests ever in this crate)
- Mark live-I/O code (needs a running server, MariaDB, or OS signals) with
  #[cfg_attr(coverage_nightly, coverage(off))] so it doesn't drag coverage down
- Add [package.metadata.cargo-matrix] default/coverage channels to all four
  crates; the coverage channel always includes `unstable`
- barto-cli: enable unstable = ["libbarto/unstable"]
- run_all.fish/run_all.ps1: use `cargo matrix nextest run` and
  `cargo matrix -c coverage llvm-cov nextest`, plus libbarto doctests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CraZySacX CraZySacX changed the title test: add unit coverage for bartoc and barto-cli test: add unit coverage for bartoc, barto-cli, and bartos Jun 14, 2026
Bump the rustyhorde/workflows reusable workflow pin to 60c2f58, which
adds optional nextest support, and enable `nextest: true` on the three
test jobs so CI tests run under cargo-nextest (matching the local
pipeline). Coverage already uses nextest via COVERAGE_RUN_CMD.

Refresh third-party action pins in release.yml and audit.yml to their
current upstream commits:
- Wandalen/wretry.action -> e68c23e (v3.8.0)
- actions/checkout -> df4cb1c (v6.0.3)
- cargo-bins/cargo-binstall -> 252c5e7 (main)
- rustyhorde/audit-check -> a6c4633 (v0.3.0 -> v1.0.0)

audit-check v1.0.0 retains the token/deny/create_issue inputs, so the
existing usage is compatible. Job names are unchanged, so the master
ruleset required-status-check list needs no update.

Update workspace dependencies: bon 3.9.1 -> 3.9.2, getset 0.1.6 ->
0.1.7, time 0.3.47 -> 0.3.49, uuid 1.23.1 -> 1.23.3, pin rpassword
7.5.4 and notify-debouncer-mini 0.7.0. Promote regex to a workspace
dependency (1.12.4) and reference it from bartos and libbarto.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CraZySacX CraZySacX changed the title test: add unit coverage for bartoc, barto-cli, and bartos test + ci: workspace unit coverage, cargo-matrix/nextest pipeline, and CI/dep refresh Jun 14, 2026
@CraZySacX CraZySacX merged commit 0f96e7f into master Jun 14, 2026
25 checks passed
@CraZySacX CraZySacX deleted the 249-v1511-enhancements branch June 14, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants