Closed cschwan closed 2 years ago
Are you really sure you want to test the full hardcoded docstring? If at some point you'll want to update clap
version and they even change something minor (say spacing) it will break all the tests...
The --help
tests are just a basic implementation of the more general idea to test coverage of all subcommands. Note that the version of clap
is pinned.
I agree that clap
won't update on its own (and that's a good thing), nevertheless at some point you might want to do it manually (and this was the meaning of the original observation).
I agree that coverage is a good thing, but nor 100% is granting to be bug free, neither any other reason exists to make 100% strictly required: for as long as you know what you are testing, and more important what not, that's perfectly fine (but this of course is only my personal point of view).
My point is more that we don't have any tests for the CLI, which is potentially dangerous. While writing tests I already discovered a problem that is also present in master (fixed in commit 10c659ea6631b87a0bd86e0a76b9f934baf5de23). I agree that the --help
tests are unnecessarily fragile, but once we have proper tests we can probably remove them.
Merging #95 (8fa4fb1) into master (38cb9f8) will decrease coverage by
0.09%
. The diff coverage is88.47%
.
@@ Coverage Diff @@
## master #95 +/- ##
==========================================
- Coverage 86.00% 85.91% -0.10%
==========================================
Files 14 31 +17
Lines 2080 3025 +945
==========================================
+ Hits 1789 2599 +810
- Misses 291 426 +135
Impacted Files | Coverage Δ | |
---|---|---|
pineappl_cli/src/plot.rs | 92.10% <ø> (ø) |
|
pineappl_cli/src/merge.rs | 53.33% <53.33%> (ø) |
|
pineappl_cli/src/remap.rs | 68.83% <68.83%> (ø) |
|
pineappl_cli/src/diff.rs | 69.53% <73.33%> (ø) |
|
pineappl_cli/src/subgrids.rs | 77.27% <77.27%> (ø) |
|
pineappl_cli/src/helpers.rs | 91.01% <85.71%> (ø) |
|
pineappl_cli/src/sum.rs | 94.11% <94.11%> (ø) |
|
pineappl_cli/src/info.rs | 96.96% <96.96%> (ø) |
|
pineappl_cli/src/pull.rs | 97.59% <97.59%> (ø) |
|
pineappl_cli/src/pdfunc.rs | 97.82% <97.82%> (ø) |
|
... and 19 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 38cb9f8...8fa4fb1. Read the comment docs.
This branch is supposed to rework the CLI to
clap
's derive feature that makes it much easier to write an easy-to-understand subcommand andchannels
convolute
diff
info
luminosity
merge
optimize
orders
pdf_uncertainty
plot
pull
remap
set
subgrids
sum
upgrade