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

Add CI only tests #726

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

oneElectron
Copy link
Contributor

This resolves issue #708.
Any test that requires being run on the CI server is marked with #[ignore = ci].
I added -- --ignored to both the miri and build-and-test jobs.
Opened as a draft because I don't know if anyone will have a problem with this solution.

@oneElectron
Copy link
Contributor Author

oneElectron commented Aug 2, 2023

An alternative that I have already tested is to create an env variable CI=1 which build.rs checks for and sets a cfg in rust. Any test that fails locally would be marked with #[cfg(is_ci)]

EDIT: This is a solution, but the issue is that marking a function with #[cfg(is_ci)] causes it not to compile, which means it generates warnings about unused imports and helper functions

@oneElectron
Copy link
Contributor Author

The other method I see is to create a function fn quit_if_not_ci(), and call it in any test that fails locally. This is (at least to me) not the most ideal solution because it would requires importing the function and any test marked with this function will always pass, which may lead to confusion.

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.

1 participant