Skip to content

Add maglab/magmap tests, coverage CI workflow and AGENTS.md - #21

Merged
asgr merged 3 commits into
masterfrom
copilot/create-unit-tests-ci-agents-md
Nov 6, 2026
Merged

asgr merged 3 commits into
masterfrom
copilot/create-unit-tests-ci-agents-md

Conversation

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Improves test coverage, adds a coverage CI job and documents the package for contributors and agents. R was not available in the authoring environment, so none of this has been run. Please run the tests and the new workflow before merging.

  • Tests (tests/testthat/test-maglab-magmap.R)
    • The existing suite covers most plotting functions but never tests maglab or magmap directly, so I added those.
    • maglab tests cover the return structure, trim, log label placement, and the error when usemultloc is used without log=TRUE.
    • magmap tests cover the output range and that flip=TRUE inverts the mapping.
    • Expectations come from reading the code and haven't been checked against R, so a failure may be a wrong expectation rather than a bug.
    • magband, magproj, magMWdust and magimageRGB still appear to lack direct tests. I chose targets by reading the test files, not from a coverage report.
  • CI (.github/workflows/test-coverage.yaml)
    • New covr job on Ubuntu, run on push and PR to main/master. It prints coverage and writes a Cobertura report. It does not upload results or enforce a threshold.
    • R-CMD-check.yaml is unchanged.
  • AGENTS.md
    • Covers the package layout, including exportPattern exports and the hand-written man/ Rd files.
    • Covers the ParmOff dependency, test and check commands, the null-device convention for plotting tests, CI, and style.

Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Copilot AI and others added 2 commits November 6, 2026 04:15
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Co-authored-by: asgr <5617132+asgr@users.noreply.github.com>
Copilot AI requested a review from asgr November 6, 2026 04:16
@asgr
asgr marked this pull request as ready for review November 6, 2026 05:32
Copilot AI balanced review requested due to automatic review settings November 6, 2026 05:32
@asgr
asgr merged commit a856e4b into master Nov 6, 2026
4 checks passed
@asgr
asgr deleted the copilot/create-unit-tests-ci-agents-md branch November 6, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The requested pre-merge R tests and coverage workflow have not been executed, leaving runtime behavior and CI dependency installation unverified.

No open issues 🎉

What changed in this PR

Adds direct tests for maglab and magmap, coverage reporting in CI, and contributor guidance for the magicaxis R package.

Changes:

  • Tests label structure, trimming, logarithmic placement, invalid options, mapping bounds, and flipped mappings.
  • Adds an Ubuntu coverage workflow that prints coverage and generates a Cobertura report without uploading results or enforcing a threshold.
  • Documents package layout, dependencies, development commands, and testing conventions.

The new tests and workflow remain unverified at runtime.

File Description
tests/​testthat/​test-maglab-magmap.R Adds computational tests for label generation and numeric mapping.
AGENTS.md Documents contributor and agent guidance.
.github/​workflows/​test-coverage.yaml Adds coverage reporting for pushes and pull requests targeting main or master.

Review effort: Balanced

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.

3 participants