-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Description
For medium–large scale projects, or projects that have a lot of integrations with third party services. It would nice to be able to ignore tests based on the environment the tests are being run in. One example would be to run tests if an environment variable is present.
You can workaround this with something like the following, however the output of the test is ok
and not ignored
, misleading the user that the test was successful.
#[test]
fn foo() {
if env::var("FOO").is_none() { return; }
let foo = env::var("FOO").unwrap();
}
ArniDagur, alindima, newAM, Kxuan, yanganto and 58 more
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.Relevant to the dev-tools subteam, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Type
Projects
Status
No status