Skip to content

Fix and tweak integration tests #2715

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

Merged
merged 1 commit into from
May 20, 2018
Merged

Fix and tweak integration tests #2715

merged 1 commit into from
May 20, 2018

Conversation

nrc
Copy link
Member

@nrc nrc commented May 18, 2018

And emit rustfmt output so they can be debugged

@nrc
Copy link
Member Author

nrc commented May 18, 2018

Ping @gnzlbg - I've been trying to get more of the integration tests passing, but I can't get any useful info to debug. I've tried a few of these crates locally and they pass rustfmt-ing. Do you have any idea why the integeration tests are failing and why I don't see the output from rustfmt?

check_fmt
if [[ $? != 0 ]]; then
return 1
fi
Copy link
Contributor

@gnzlbg gnzlbg May 18, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that stdsimd was broken because the doc tests failed to build after a reformat. IMO we should be checking that if the library builds correctly before formatting, it should also build correctly afterwards, and that applies to all its tests, including doc tests.

Running the tests is not necessary, but the time it takes to run the tests of these libraries is negligible compared to the time it takes to build the tests. And knowing whether formatting changes alter the results of the tests in these libraries allows us to at least ping their maintainers on the nursery, or send PRs when things break.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. I'll add that back in once I've worked out what is going on with the rustfmt failures

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many of the failures are either warnings because the crates need pull request to remove deprecated options, or because rustfmt emits warnings or errors that the user cannot do anything about.

If there is nothing that the user can do about a warning or internal error, then the diagnostic should IMO be opt-in (e.g. behind a rustfmt --debug-output or similar).

I've tried to enable these diagnostics here because even if they are opt-in, they should be fixed at some point. However a "red" allowed to fail travis build bot because of a warning can hide a change that actually breaks the build so... I did not know what the right way to proceed was here and did not wanted to add all buildbots twice...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's puzzling me is that some of the errors are meant to be opt-in with --error-on-unformatted and when I run locally I don't see the errors, but running on CI is doing something different to my local setup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe is a different rustfmt being picked up? I had that problem when I enabled the cargo cache on travis, so I disabled it. Or maybe your local rustfmt is different than the one here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it out! The directories here are nested under rustfmt, whereas my local tests were not, that means they see rustfmt's rustfmt.toml which opts into the debug mode stuff. Testing now without that...

@nrc nrc force-pushed the integr branch 5 times, most recently from 5854e61 to 653f6f4 Compare May 18, 2018 23:58
@nrc nrc changed the title Try and run less when doing integration tests Fix and tweak integration tests May 18, 2018
@nrc
Copy link
Member Author

nrc commented May 18, 2018

r? @gnzlbg

@gnzlbg
Copy link
Contributor

gnzlbg commented May 19, 2018

This LGTM. A way to fix #2274 would be to run cargo test before the formatting, and if that fails just return 0 instead of 1, e.g., by adding

cargo test --all	
if [[ $? != 0 ]]; then	
      return 0	
fi

before the touch rustfmt.toml line. That should make stdsimd pass for the time being, since it currently doesn't build (but we should still leave it as allow_failure).

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.

2 participants