Skip to content

Run the tests in R CMD check, and test that the docs keep up - #26

Merged
chross22 merged 2 commits into
masterfrom
enforce-documentation
Aug 7, 2026
Merged

Run the tests in R CMD check, and test that the docs keep up#26
chross22 merged 2 commits into
masterfrom
enforce-documentation

Conversation

@chross22

@chross22 chross22 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Two things, both about documentation staying true rather than the code being correct.

The test suite was not running under check

tests/testthat.R had test_check("datamatch") commented out. It was commented on 23 July in a commit titled "update readme" — almost certainly a debugging leftover never restored.

Since then R CMD check has reported checking tests ... OK while running nothing, and CI has done the same. Every green CI run today included no tests.

The suite has been passing throughout — my reports of that came from testthat::test_local(), which does run it — but nothing was enforcing it. A regression would have reached master unnoticed.

Uncommented. 759 tests now run under check, 0 failures, 0 skips.

Tests that the documentation keeps up

Guarding the failure mode that keeps recurring here: code lands, the documentation describing it does not, and nothing notices. Seven exported functions were once implemented, tested, and absent from the README entirely.

  • every exported function is named in the README
  • every climate index, catalog variable, and bathymetry layer is too
  • DESCRIPTION does not still describe matchData() as species-specific, and does mention what the package grew
  • NEWS.md has a version heading R can parse — what stops the No news entries found NOTE coming back

The first one failed on its first run and found six: copernicus_variables, covariate_columns, product_url, forecast_variables, climate_indices, grid_resolution. They now have a Looking things up section in the README, rather than a weakened test.

On paths

They prefer the source tree over the installed copy, so a local run checks what is about to be committed. R CMD check has no source tree and falls through to the installed files — which came from the tarball being checked, so they are current too. That is why these run rather than skip under check.

An earlier version used relative paths only and errored under check when read.dcf() got NA before the skip guard. Caught by enabling test_check() in the same change.

Verification

R CMD checkStatus: OK, with the suite actually executing. Installed into both R 4.6.1 and 4.3.2.

🤖 Generated with Claude Code

chross22 and others added 2 commits August 7, 2026 16:03
Two things, both about the documentation staying true rather than the
code being correct.

tests/testthat.R had test_check("datamatch") commented out. It was
commented on 23 July in a commit titled "update readme", so almost
certainly a debugging leftover that was never restored. Since then
R CMD check has reported "checking tests ... OK" while running nothing,
and CI has done the same. The suite has been passing throughout - every
report of that came from testthat::test_local(), which does run it - but
nothing was enforcing it. Uncommented: 759 tests now run under check.

The new tests guard the failure mode that keeps recurring here: code
lands, the documentation describing it does not, and nothing notices.
Seven exported functions were once implemented, tested, and absent from
the README entirely. So:

  - every exported function is named in the README
  - every climate index, catalog variable, and bathymetry layer is too
  - DESCRIPTION does not still describe matchData() as species-specific,
    and does mention what the package grew
  - NEWS.md has a version heading R can parse, which is what stops the
    "No news entries found" NOTE coming back

The first of those failed on its first run and found six: copernicus_
variables, covariate_columns, product_url, forecast_variables,
climate_indices, and grid_resolution. They now have a "Looking things
up" section rather than a weakened test.

Paths prefer the source tree over the installed copy, so a local run
checks what is about to be committed. R CMD check has no source tree and
falls through to the installed files, which came from the tarball being
checked and are current too - which is why these run rather than skip
under check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Everything this package returns comes from someone else's data, and the
obligation to cite travels with the data rather than with the package.
The README had citations for the two indices published with papers and
nothing for the Copernicus products, ETOPO, or the software - so someone
publishing from a run had no list to work from.

A References section at the bottom now covers all of it, grouped so only
what a run actually used needs citing. Every DOI came from an
authoritative source rather than from memory: the Copernicus ones from
`copernicusmarine describe`, the package ones from citation(), and ETOPO
from NCEI. All twelve were then checked to resolve.

Two came back wrong.

The Copernicus Marine Toolbox DOI I first wrote was a 404 - recalled,
not looked up. There is no DOI for the client, so the section now points
at its documentation and says to cite the products.

More seriously, the AMOC reference in the catalog cited
10.5285/223b34a3-..., which also 404s. BODC mints a DOI per RAPID
release and retires the old one; that was the 2004-2020 version. Now
10.5285/48d0bf43-... for v2024.1a, with the full author list, verified
to resolve. A test pins it, since a dead DOI looks like a citation and
sends the reader nowhere - worse than having none.

Also adopts Copernicus's own required citation form, which asks for an
access date, and adds a test that every data source has a DOI or a named
provider in the reference list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chross22
chross22 merged commit 70eb8f7 into master Aug 7, 2026
5 checks passed
@chross22
chross22 deleted the enforce-documentation branch August 7, 2026 20:17
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