-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Actually skip flaky tests on CI #626
Conversation
.travis.yml
Outdated
@@ -22,7 +22,7 @@ jobs: | |||
rust: stable | |||
cache: cargo | |||
script: | |||
- cargo test --locked --no-default-features | |||
- (cd proxy && exec cargo test --locked --no-default-features) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In proxy/Dockerfile we have cargo test -p conduit-proxy --frozen --no-default-features
. Unless there's a specific reason why we can't do so, I think it's good to be consistent. Which is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo test -p conduit-proxy --frozen --no-default-features
will not correctly pass the --no-default-features
flag; the flaky tests will still be run. I can change the Dockerfile to cd
into the proxy
dir as well; I forgot about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is exec
necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olix0r so that we don't create a new process --- StackOverflow said to and it seemed like good hygiene?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to omit exec -- it's not used consistently and doesn't solve a problem we have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please consistently use exec
or no exec
in Travis CI and the Dockerfile.
Flaky proxy tests were not actually being ignored properly. This is due to our use of a Cargo workspace; as it turns out that Cargo doesn't propagate feature flags from the workspace to the crates in the workspace (see rust-lang/cargo#4753).
If I run
cargo test --no-default-features
in the root directory, theflaky_tests
feature is still passed, and the flaky tests still run:This also happens if the
-p
flag is used to run tests only in theconduit-proxy
crate:However, if I
cd
into theproxy
directory (so that Cargo treats theconduit-proxy
crate as the root project, rather than the workspace) and pass the--no-default-features
flag, the flaky tests are skipped as expected:I'm wrapping the
cd
andcargo test
command in a subshell so that the CWD on Travis is still in the repo root when the command exits, but the return value fromcargo test
is propagated.Closes #625