Skip to content

Add test coverage analysis with prioritized improvement recommendations#45

Open
gacolitti wants to merge 2 commits into
mainfrom
claude/analyze-test-coverage-T5LfD
Open

Add test coverage analysis with prioritized improvement recommendations#45
gacolitti wants to merge 2 commits into
mainfrom
claude/analyze-test-coverage-T5LfD

Conversation

@gacolitti

Copy link
Copy Markdown
Owner

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

- 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
@gacolitti gacolitti force-pushed the claude/analyze-test-coverage-T5LfD branch from 972cb9f to 99189ed Compare February 6, 2026 14:36
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
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.

2 participants