Add testthat infrastructure and CI matrix to catch rendering regressions#12
Merged
Conversation
…matrix workflow Agent-Logs-Url: https://github.com/maflot/ggdiceplot/sessions/451f43f3-be88-4db3-b713-a9a5bc4414ce Co-authored-by: maflot <69261571+maflot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve testing infrastructure to catch rendering regressions
Add testthat infrastructure and CI matrix to catch rendering regressions
Mar 27, 2026
Remove unsupported label= arg from expect_s3_class() and info= arg from expect_no_error(). These are valid on expect_true/expect_equal but not on all testthat functions. Remove duplicate Suggests/Config fields in DESCRIPTION.
ggplot2 3.4.0 cannot build from source on R >= 4.5 due to internal R API changes. The effective minimum is 3.5.2 anyway since legendry (a hard dependency) requires it. Test minimum version on R oldrel.
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.
v1.1.0 shipped with
drawDetails.DiceGrobmissing from NAMESPACE, silently rendering every dice plot as a blank panel. No automated tests existed to catch it.Test suite (
tests/testthat/)helper-data.R— shared fixtures:make_simple_data(),make_single_tile_data(n),make_simple_plot(fill_mapped, size_mapped, pip_scale)test-utils.R—make_offsets()for all n=1–6: structure, coordinate bounds, custom tile dimensions, error cases;create_dice_positions(),scale_dots_discrete(),theme_dice()test-rendering.R— S3 dispatch registration check (the v1.1.0 bug);DiceGrobstructure vialayer_grob(); all four draw paths (fill/size mapped × unmapped);pip_scalevariants (0.5, 0.75, 1.0, NULL); ndots=1–6 pip counts; end-to-endggsave()to exercisedrawDetailstest-aesthetics.R— pipcolourneverNA(unmapped, continuous fill, discrete fill); pip x/y within tile bounds; row-count invariant (no silent drops); tile count matches unique(x, y)pairsThe S3 registration test is the direct regression guard:
CI (
.github/workflows/R-CMD-check.yml)6-cell matrix covering the scenarios that were never tested before release:
Non-CRAN ggplot2 versions are installed via
pakafter the standard dependency step, overriding the default CRAN install.DESCRIPTION
Added
testthat (>= 3.0.0)toSuggestsandConfig/testthat/edition: 3.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.