Add test coverage analysis with prioritized improvement recommendations#45
Open
gacolitti wants to merge 2 commits into
Open
Add test coverage analysis with prioritized improvement recommendations#45gacolitti wants to merge 2 commits into
gacolitti wants to merge 2 commits into
Conversation
- Leaderboard tests: add skip guards when DK_IV/DK_JWE env vars are missing, since the functions abort before httptest2 can intercept - Optimize tests: replace file-level check_solver() (which crashes all tests via cli_abort) with per-test skip_if_not_installed() guards - test-coverage workflow: explicitly install ROI.plugin.glpk so the optimizer tests run under covr - Fix incorrect comments (NBA tests were labeled as NFL) https://claude.ai/code/session_01VKRqCx6Tc61KDVFLnG9q7E
972cb9f to
99189ed
Compare
New test files (680 lines, ~70 new test cases): - test-utils.R: clean_names() regex rules, special chars, CamelCase, non-ASCII fallback, data.frame/vector modes; check_df() missing cols and wrong class errors; check_solver() happy/error paths - test-utils-time.R: format_time() boundary conditions at each unit threshold; format_duration(); pretty_duration() early return, prefix, pluralization - test-httr2-wrappers.R: all 7 add_*() functions tested for both NULL (no-op) and non-NULL (modification) paths - test-error-handling.R: all cli_abort/rlang::abort error paths across the package — missing args, invalid inputs, missing cookies - test-optimize-extended.R: dk_extract_solution() structure, dk_get_optimal_lineups() multi-lineup iteration, dk_write_csv() CSV output, print methods, dk_prepare_schematic() edge cases (exclude/ include players, exclude_questionable, custom exp_fp, validation) - test-req.R: dk_req() configuration options (base_url, paths, method, query_params, headers); dk_req_process() all output modes (request, json, response) https://claude.ai/code/session_01VKRqCx6Tc61KDVFLnG9q7E
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.
Static analysis of all 15 source files against 6 test files reveals ~35-45%
estimated coverage. Key gaps: utility functions (clean_names, check_df,
format_time) have zero direct tests, dk_get_optimal_lineups and dk_write_csv
are completely untested, and no error paths are tested anywhere.
https://claude.ai/code/session_01VKRqCx6Tc61KDVFLnG9q7E