Skip to content

test(lib): support independently enabled optional features - #1513

Merged
jdx merged 2 commits into
mainfrom
codex/debian-feature-tests
Sep 28, 2026
Merged

jdx merged 2 commits into
mainfrom
codex/debian-feature-tests

Conversation

@jdx

@jdx jdx commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/usage/trails/59

Downstream packagers test each optional feature independently. Four configurations failed even though the workspace's all-features tests passed: usage-argv with only complete, diagnostics, or spec, and usage-rs with only test.

Make diagnostics assertions match the enabled renderer, gate advanced-help and completion tests on the features they exercise, and account for usage-test enabling advanced help transitively. Add separate CI invocations for all four configurations so workspace feature unification cannot mask these failures. Runtime behavior and public APIs are unchanged.

This upstreams the two test patches in Debian packaging MR !1447. Debian can remove them when packaging a release containing this change.

Also normalize existing trail-runner JSON formatting to keep the CI formatting step from leaving a dirty checkout; parsed JSON values are unchanged.

Validation: all four affected feature configurations passed, as did both crates with all features and the existing trimmed static_endpoint tests (including both expected-panic tests). Rust formatting, Prettier, actionlint, and diff whitespace checks passed.


Note

Low Risk
Changes are limited to tests and CI; runtime behavior and public APIs are unchanged per the PR intent.

Overview
Downstream packagers build optional features in isolation, but workspace --all-features CI was masking failures for usage-argv (complete, diagnostics, spec) and usage-rs (test). This PR adds a dedicated “test library features independently” workflow step and adjusts tests so assertions match whichever renderer/API is actually enabled.

Test updates branch on cfg features: error-message checks expect user-facing diagnostics when diagnostics is on and Debug-style text when it is off; advanced-help and completion coverage is limited to help-advanced / complete; static_endpoint panic guards treat the test feature like help-advanced because usage-test enables it transitively. .entire/runners/*.json only reformats trigger_types arrays (no behavior change).

Reviewed by Cursor Bugbot for commit 3bfba22. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Tests
    • Expanded automated checks across multiple feature configurations, including command-line completion, diagnostics, specifications, and usage testing.
    • Updated error-message checks to reflect whether diagnostic details are enabled, and adjusted help and metadata tests for applicable build configurations.
  • Other
    • Runner configuration formatting was standardized; trigger options and behavior are unchanged.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: bdf650db-1fdc-4ee5-838e-cd9a741593c4

📥 Commits

Reviewing files that changed from the base of the PR and between 2f2f991 and 3bfba22.

📒 Files selected for processing (12)
  • .entire/runners/trail-confidence.json
  • .entire/runners/trail-drift.json
  • .entire/runners/trail-review.json
  • .entire/runners/trail-risk.json
  • .entire/runners/trail-security.json
  • .entire/runners/trail-summary.json
  • .github/workflows/test-impl.yml
  • argv/src/embedded.rs
  • argv/src/help.rs
  • argv/src/spec.rs
  • usage-rs/tests/harness.rs
  • usage-rs/tests/static_endpoint.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The workflow adds locked test runs for selected feature configurations. Test assertions and compile gates now account for those configurations. Six runner configuration files also reformat trigger arrays without changing their values.

Changes

Feature-specific test matrix

Layer / File(s) Summary
Feature-aware test assertions and gates
argv/src/embedded.rs, argv/src/help.rs, argv/src/spec.rs, usage-rs/tests/harness.rs, usage-rs/tests/static_endpoint.rs
Tests check feature-dependent error text and compile only when their required features are enabled.
Locked feature-specific test runs
.github/workflows/test-impl.yml
The workflow runs locked tests for usage-argv with complete, diagnostics, and spec separately, plus usage-rs with its test feature.

Runner trigger formatting

Layer / File(s) Summary
Trigger array formatting
.entire/runners/trail-*.json
Six runner configuration files place their trigger arrays on one line. The configured values remain unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 3bfba

The changes improve coverage of selected feature configurations without changing runtime behavior or runner triggers; no concrete merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 5 files. (7 skipped: 7…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding test support for independently enabled optional features.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Test suite now validates optional features independently.

The PR appears safe to merge; no new actionable issue was identified in the changes since the previous review.

Summary

The PR adds tests and CI invocations for independently enabled optional features, while aligning assertions and test gates with those configurations.

  • The changes since the previous review only reformat six runner JSON files.

Reviews (2) · Last reviewed commit: "style: format trail runner configuration"

@jdx
jdx enabled auto-merge (squash) September 28, 2026 21:23
@jdx
jdx merged commit 1bb16fd into main Sep 28, 2026
15 checks passed
@jdx
jdx deleted the codex/debian-feature-tests branch September 28, 2026 21:27
@github-actions

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown █▂▂▁▂▅▄▅▄▅ 286,027,020 → 286,043,489 +0.01% 49.90 → 50.04ms +0.27%
startup ▆▆▆███▆▆▁▇ 1,053,908 → 1,060,731 +0.65% 1.37 → 1.35ms -1.28%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework stripped binary, bytes
usage 1261952
bpaf 2494656
clap 3100904
framework instructions, cold parse vs usage
usage 8530 —
clap 6314977 740x
bpaf 21909298 2568x
                                              min       p01       p10    median
usage-rs: argv -> struct                      788       798       802       815  ns
clap: build tree + parse -> struct        1238644   1247968   1258970   1275952  ns
bpaf: build parser + parse -> struct      3418081   3418081   3435760   3452222  ns

usage: argv -> struct                             756 ns      0.76 µs
clap: build tree + parse -> struct            1257246 ns   1257.25 µs
clap: parse -> struct, tree reused              49935 ns     49.94 µs
clap: build tree only                          750253 ns    750.25 µs

3bfba22424a2 vs 2f2f99184b99 · measured on the runner, not pushed to the history.

mise-en-dev added a commit that referenced this pull request Oct 6, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/usage/trails/58
<!-- entire-trail-link-end -->

### ⚡ Performance

- reduce development debug info by [@jdx](https://github.com/jdx) in
[#1525](#1525)

### 🧪 Testing

- **(lib)** support independently enabled optional features by
[@jdx](https://github.com/jdx) in
[#1513](#1513)

### 🛡️ Security

- restrict AI replies on Discussions and Issues and note the instant ban
by [@jdx](https://github.com/jdx) in
[#1522](#1522)

### 🔍 Other Changes

- **(entire)** store checkpoints in a private repository by
[@jdx](https://github.com/jdx) in
[190ff3e](190ff3e)
- **(entire)** commit codex session hooks by
[@jdx](https://github.com/jdx) in
[abee1b8](abee1b8)
- **(entire)** commit claude session hooks by
[@jdx](https://github.com/jdx) in
[364d74e](364d74e)
- **(entire)** restore lower-cost trail findings by
[@jdx](https://github.com/jdx) in
[2f2f991](2f2f991)
- limit each contributor to one open draft PR by
[@jdx](https://github.com/jdx) in
[#1519](#1519)
- add hk pre-commit hook by [@jdx](https://github.com/jdx) in
[#1523](#1523)
- update pr-closer policy by [@jdx](https://github.com/jdx) in
[a2608b7](a2608b7)

### 📦️ Dependency Updates

- update ubuntu:26.04 docker digest to da6fc2b by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1514](#1514)
- update jdx/renovate-config action to v1.0.1 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1515](#1515)
- update mise tools to latest by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1516](#1516)
- update dependency communique to latest by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1518](#1518)
- update dependency aube to latest by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1520](#1520)
- run go mod tidy on Renovate branches by [@jdx](https://github.com/jdx)
in [#1521](#1521)
- update module github.com/urfave/cli/v3 to v3.13.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1517](#1517)
- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1524](#1524)
- update dependency golangci-lint to v2.14.0 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1526](#1526)
- update jdx/mise-action action to v5 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#1527](#1527)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant