Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace length-based tests #2

Merged
merged 1 commit into from
Jan 16, 2024
Merged

Replace length-based tests #2

merged 1 commit into from
Jan 16, 2024

Conversation

teunbrand
Copy link
Contributor

Hello there,

We have been preparing a new release of ggplot2 and during a reverse dependency check, it became apparent that the prospective ggplot2 3.5.0 would break autohrf.

This PR updates some tests that expected that the result of ggplot() has length 9, which is no longer true in the release candidate. These tests have been replaced with tests that check that the outcome of the plotting functions return a ggplot object.

To test the code changes with the release candidate, you can install it with the code below:

remotes::install_github("tidyverse/ggplot2", ref = remotes::github_pull("5592"))

The release of ggplot2 3.5.0 is scheduled for the 12th of Februari. The progress of the release can be tracked in tidyverse/ggplot2#5588. We hope that this PR might help autohrf get out a fix if necessary.

@demsarjure
Copy link
Owner

Hi Teun,

This makes sense, thanks for preparing the PR! Just one quick question before I accept it and merge. Is this solution backwards compatible. In other words, will expect_s3_class(plot, "ggplot") work with current version of ggplot and older versions? Thanks.

@teunbrand
Copy link
Contributor Author

Thank you for the quick response. Yes, the result of ggplot() has been a 'ggplot' S3 class object for many years now I think, so it should be compatible both with the current version of ggplot2 on CRAN and the new release candidate.

Copy link
Owner

@demsarjure demsarjure left a comment

Choose a reason for hiding this comment

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

Looks good and fixes the issue with a new version of ggplot in a backwards compatible manner.

@demsarjure demsarjure changed the base branch from main to develop January 16, 2024 13:34
@demsarjure demsarjure merged commit 01959b9 into demsarjure:develop Jan 16, 2024
@teunbrand teunbrand deleted the ggplot2_3.5.0 branch January 16, 2024 13:35
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