test + ci: workspace unit coverage, cargo-matrix/nextest pipeline, and CI/dep refresh#259
Merged
Conversation
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>
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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>
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>
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>
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
Add the first-ever unit tests to all three Barto binaries (
bartoc,barto-cli,bartos) and thelibbartodoctests, 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)bartos, MariaDB, platform keychain, or OS signals) with#[cfg_attr(coverage_nightly, coverage(off))]so it doesn't drag down coveragebarto-clihandler display arithmetic withsaturating_sub(andmax(1)on theprint_heightmodulo divisor) so a narrow/headless terminal no longer panics on underflow[package.metadata.cargo-matrix]default/coveragechannels to all four crates (thecoveragechannelalways_includesunstable);run_all.fish/run_all.ps1now run tests viacargo matrix nextest run(+libbartodoctests) and coverage viacargo matrix -c coverage llvm-cov nextest --no-reportbarto-cli: enableunstable = ["libbarto/unstable"]depsup); pinalloc-no-stdlibdue to an upstream packaging issueCI & dependency refresh
rustyhorde/workflowsreusable-workflow pin to60c2f58(which adds optional nextest support) and setnextest: trueon the three🧪 Testjobs, matching the local pipeline. Coverage already uses nextest viaCOVERAGE_RUN_CMD. Job names are unchanged, so themasterruleset required-status-check list needs no update.release.yml/audit.yml: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; retains thetoken/deny/create_issueinputs)bon3.9.1 → 3.9.2,getset0.1.6 → 0.1.7,time0.3.47 → 0.3.49,uuid1.23.1 → 1.23.3, pinrpassword7.5.4 andnotify-debouncer-mini0.7.0; promoteregexto a workspace dependency (1.12.4) referenced frombartosandlibbarto.bartocmodules coverederror.rsDisplaystringsdb/data/output.rsOutputKey/OutputValueFrom<&Output>+Displaydb/data/status.rsStatusKey/StatusValueFrom<&Status>+Displayhandler/stream.rsdb/mod.rsconfig/mod.rsruntime/cli.rsPathDefaults/PathDefaultsExtdefaultsbarto-climodules coverederror.rsDisplaystringsruntime/cli.rsSource::collect,PathDefaultsconfig/mod.rsTracingConfig/TracingConfigExtimplshandler/mod.rsmaxes_*width calcs,handle_message,handle_binarydispatchruntime/mod.rsbuild_messagefor everyCommandsvariantbartosmodules coveredcommon/mod.rsClientsadd/remove/by-name/add-data,WorkerSignalequalityconfig/mod.rsTracingConfig/TracingConfigExtimplserror.rsDisplaystringsdb/utils.rsapt/garuda/pacman/cachyosupdate-output filtersendpoints/insecure/mod.rsName/ip/describehelpersendpoints/insecure/worker.rsbuild_init_bytes,build_cleanup_bytes,sign_worker_payloadruntime/cli.rsSource::collect,PathDefaultsSkipped / coverage-off (require live network, keychain, MariaDB, OS signals, or full runtime):
bartocruntime/mod::run,Handler::handle/wait_for_close,runtime/secrets.rskeyring fns,service.rs(Windows-only);bartosruntime/modsetup/server/signal/watcher fns,db/mysqlhandler,endpoints/insecure/{cli,worker}async handlers,handler/cliimpl.Test plan
cargo matrix nextest run— all tests passscripts/run_all.fish --no-install --no-musl— full CI pipeline passes (no lint errors)🤖 Generated with Claude Code