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

testthat with windows executables and externally referenced files are not working #196

Open
jdpye opened this issue Jan 5, 2024 · 8 comments
Assignees

Comments

@jdpye
Copy link
Member

jdpye commented Jan 5, 2024

we're experiencing some errors with the merge checking GHA, when it's running the tests in testthat. the ones built to work with VUE.exe and some of the .RDA files that are in the package need to be either excluded or have their references fixed up.

@jdpye jdpye self-assigned this Jan 5, 2024
@mhpob
Copy link
Contributor

mhpob commented Jan 5, 2024

You can add skip_on_ci() to the tests that require executables, etc., that can't be provided in GH Actions.
https://testthat.r-lib.org/articles/skipping.html

Depending on how far down this CI rabbit hole you go, I also wrote a helper that skips some of the RUniverse CI testing:
https://github.com/mhpob/matos/blob/master/tests/testthat/helper-runiverse.R

@mhpob
Copy link
Contributor

mhpob commented Jan 11, 2024

If you really, really want to go down the rabbit hole, you could also configure the action to use the GitLab/GitHub API to download the relevant executable from a private repo, listing the API key as an env var in the GH secrets vault, when building the runner.

@jdpye
Copy link
Member Author

jdpye commented Jan 11, 2024

that would be a fun stretch goal. might save that one for @jackVanish to practice advanced GitHub Action-fu with.

@mhpob
Copy link
Contributor

mhpob commented Jan 11, 2024

There seem to be murmurings that you could convert the exe to binary locally (base64?), store the binary as a GH secret/variable, then convert the secret back to an exe when setting up the runner. This got over my head very quickly when I was looking into it so I haven't figured out if that's actually a viable solution.

This is all assuming (I think correctly?) that you can't include vue.exe or vdat.exe in the repo due to distribution and licensing restrictions.

@jdpye
Copy link
Member Author

jdpye commented Jan 11, 2024

there are 11 ways i'd be uncomfortable doing that, (in binary). I think the skip is going to be the right way to approach this problem. I'll try and bake something in.

@mhpob
Copy link
Contributor

mhpob commented Jan 13, 2024

Depending on how far down this CI rabbit hole you go, I also wrote a helper that skips some of the RUniverse CI testing: https://github.com/mhpob/matos/blob/master/tests/testthat/helper-runiverse.R

Hey @jdpye, sorry to lead you on a wild goose chase with this one, but you won't need the Runiverse skip. skip_on_ci will cover it.

I needed a special Runiverse skipper since some tests in matos used GH Secrets, which are not available when Runiverse runs their build/checks. So, I didn't want it to skip on CI, since my GH repo has the secret to run the tests, just on Runiverse, which didn't.

@mhpob
Copy link
Contributor

mhpob commented Feb 16, 2024

Closed in #204 and #214

@mhpob
Copy link
Contributor

mhpob commented Feb 22, 2024

Alright, I went down the rabbit hole and used the GitLab API + personal access token + GitHub secrets to get the R CMD check CI to work with the vdat executables.

https://github.com/mhpob/rvdat/blob/main/.github/workflows/R-CMD-check.yaml#L34-L55

It'll take some finagling to get set up in glatos, but the shape now exists.

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

No branches or pull requests

2 participants