Add show-config command to print resolved configuration#772
Open
MatthewMckee4 wants to merge 2 commits into
Open
Add show-config command to print resolved configuration#772MatthewMckee4 wants to merge 2 commits into
show-config command to print resolved configuration#772MatthewMckee4 wants to merge 2 commits into
Conversation
Merging this PR will not alter performance
|
Replace the manual `ProjectSettings::to_options()` round-trip with a `Serialize` derive on each settings struct. Runtime-only fields (`filter`, `run_ignored`) are skipped; `Duration` fields serialize as fractional seconds; `MaxFail::unlimited()` is omitted via `skip_serializing_if`. Adding a new setting now only requires extending the canonical struct.
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
Closes #763. Adds a
karva show-configsubcommand that resolves the sameSettingsthe test runner builds — defaults layered withkarva.toml/pyproject.tomland the selected profile — and prints them as TOML. This gives users a way to ask "what config is karva actually running with?" when debugging precedence between built-in defaults,[profile.default], a named profile, and CLI overrides.The command takes the same
--config-fileand--profile/-Pflags askarva test, so the resolution path matches what the runner would use. Output is a flat TOML body of the merged option groups (src,terminal,test,coverage) with every field populated to make defaults explicit.karva show-config # default profile karva show-config --profile ciThe round-trip from resolved
ProjectSettingsback toOptionslives onProjectSettings::to_options()so there is a single source of truth (defaults still flow throughto_settings). Runtime-only fields (filter,run_ignored, coveragedisabled) are excluded since they don't come from configuration files, andfail_fastis omitted becausemax_failis the canonical form. A future--sourceflag, as mentioned in the issue, would build on the same plumbing to annotate each value with its origin.Test Plan
ci