Skip to content

Improved vdiffr setup #2856

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

Merged
merged 9 commits into from
Sep 1, 2018
Merged

Improved vdiffr setup #2856

merged 9 commits into from
Sep 1, 2018

Conversation

clauswilke
Copy link
Member

As discussed under #2842. I have purposefully committed a breaking visual test, so if everything is right with this initial PR then the release build will fail and all others will succeed.

@clauswilke
Copy link
Member Author

@hadley @lionel- Could you take a look at this when you have a moment? The build is breaking only for R release on Travis, so that's the only place now where the visual tests are actually run.

With this setup, can we re-enable tests based on sf, or are there additional concerns?

@lionel-
Copy link
Member

lionel- commented Aug 26, 2018

Should we keep it on r-devel? This way we can monitor changes to graphics devices etc.

can we re-enable tests based on sf, or are there additional concerns?

I found these tests to be dependent on system versions of sf dependencies (gdal, geos). If possible, they should be changed (for instance to use fabricated data) so they are not affected by these system libraries.

@clauswilke
Copy link
Member Author

If sf tests depend on gdal and geos (makes sense, now that I think about it) then anything involving a coordinate transformation or other calculation on geospatial data (e.g., centroid calculation, graticules) is likely going to be unstable. We can probably visually test basic drawing of simple features but not much else.

I’ll let @hadley make the call on whether visual tests should run on r-devel.

@hadley
Copy link
Member

hadley commented Aug 27, 2018

The problem with checking on R devel is that any breaking r devel change will show up on a unrelated diff. I think testing with r release is likely to cause fewer false positives

@clauswilke
Copy link
Member Author

I have fixed the broken reference image and otherwise left the PR as is. I'll leave the problem with sf tests for now; I don't know how to resolve it. This means the PR is ready to be merged from my side.

@lionel-
Copy link
Member

lionel- commented Aug 28, 2018

@hadley I was thinking getting the r-devel failures is desirable because it allows us to monitor the effects of upstream changes on ggplot2.

@hadley
Copy link
Member

hadley commented Aug 28, 2018

Yes, but we get them in a very un-informative way - it will all depend on the timing of when the travis request is kicked off. If we cared about r-devel changes (which I don't know if we do), it would be better to do a daily run of CRAN ggplot2 against latest r-devel

.travis.yml Outdated
matrix:
include:
- r: 3.1
env: SKIP_VDIFFR=true
Copy link
Member

Choose a reason for hiding this comment

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

Can we flip this around to make skipping the default, so we only set VDIFFR=true for R-release?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, however that requires another environmental variable. We want the visual tests to run when manually testing, e.g. in R Studio, so the default has to be on. I can add a variable that indicates a CI run, and make the presence of that variable turn vdiffr off unless VDIFFR=true is also set.

Copy link
Member

@hadley hadley Aug 31, 2018

Choose a reason for hiding this comment

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

Oh that makes sense. Maybe we could turn off by default when the TRAVIS (IIRC) env var is set?

Copy link
Member Author

Choose a reason for hiding this comment

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

I find having a separate variable we define slightly preferable, because that means vdiffr runs can be fully controlled in any testing environment where these tests may be run, whether on travis or not.

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking we could do both - if USE_VDIFFR is set, use its value, otherwise look at TRAVIS and don't run vdiffr if set.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, this seems to be working now. I put the broken image back in as a check to see which builds run vdiffr.

.travis.yml Outdated
env: SKIP_VDIFFR=true
- r: oldrel
env: SKIP_VDIFFR=true
- r: release
Copy link
Member

Choose a reason for hiding this comment

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

Since you're in here, would you mind re-organsing so the versions are in reverse chronological order? That way the most recent versions (which are mostly likely to reveal problems) will be run first

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

@hadley hadley 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, although I had an idea that might simplify things still further. Feel free to implement or not as you desire.

env:
global:
# don't treat missing suggested packages as error
- _R_CHECK_FORCE_SUGGESTS_=false
Copy link
Member

Choose a reason for hiding this comment

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

It just occurred to me that we could set USE_VDIFFR to false here, and then I think the specific matrix env var would override this one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me try that.

@clauswilke clauswilke merged commit 6e545dc into tidyverse:master Sep 1, 2018
@clauswilke clauswilke deleted the vdiffr-setup branch September 1, 2018 21:49
@lock
Copy link

lock bot commented Feb 28, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Feb 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants