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

Configuring tests using environment variables #31

Merged
merged 3 commits into from
Feb 3, 2021

Conversation

Ilia-Kosenkov
Copy link
Member

Continues discussion in and fixes #30.
The idea is to be able to control how {rextendr} builds rust code in tests using environment variables.
E.g., if tests should be executed using a different toolchain, use REXTENDR_TOOLCHAIN:

Sys.setenv(REXTENDR_TOOLCHAIN = "stable-x86_64-pc-windows-gnu")
rcmdcheck::rcmdcheck(".")

Currently, only two variables are supported, REXTENDR_TOOLCHAIN and REXTENDR_PATCH_CRATES_IO.
Different crates patches can be separated using ';'.

If the environment variable is not set (or it is an equivalent of an empty string), default values from rust_source are used.

tests/testthat.R Outdated Show resolved Hide resolved
tests/testthat.R Outdated Show resolved Hide resolved
@Ilia-Kosenkov
Copy link
Member Author

@clauswilke,
So what is your opinion on this? Should I proceed?

@clauswilke
Copy link
Member

Sure, go ahead.

@clauswilke
Copy link
Member

For some reason, my local checks fail now with object 'rust_source_defaults' not found. Not sure what is happening.

But also, now that I think about it, as it is currently implemented this is somewhat problematic, as it now requires every additional test to set the toolchain and patch.crates_io arguments. We may have to rethink this.

@Ilia-Kosenkov Ilia-Kosenkov mentioned this pull request Feb 4, 2021
3 tasks
@Ilia-Kosenkov Ilia-Kosenkov deleted the env-vars-in-tests branch December 12, 2021 17:41
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.

Using environment variables to cofigure tests
2 participants