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

github actions build and test on major architectures #817

Merged
merged 55 commits into from
Feb 22, 2022

Conversation

philipcraig
Copy link
Contributor

@philipcraig philipcraig commented Feb 20, 2022

Fixes #796

Adds test and examples workflows for ubuntu-latest (stable, beta, nightly), macos nightly, windows nightly (msvc and gnu), tighter clippy, and outdated package notification

  • autocxx-reduce and autocxx-gen excluded on Windows targets as creduce isn't packaged there
  • s2 and chromium-fake-render-frame-host examples fail to link on Windows, so excluded there
  • clippy check is made stronger
  • small clippy fixes included to get clippy green
  • outdated check will generally fail. It should be used for notification, not as a PR-merge requirement
  • all checks scheduled daily for 1.40 am
  • Several beta integration tests give a compiler panic. This seems to be a known issue Decide what to do about failing tests on beta channel #818
  • windows test failures ignored Triage integration tests that fail on windows #819

@adetaylor
Copy link
Collaborator

This looks amazing. I'm not going to formally review it until it's all green and you tell me it's ready for review, but thanks a ton for all this! Proper amount of effort to get all those fiddly details right, cheers!

tighten scope so that workflows only run on pushes to main
turn on clippy for PR runs instead of just scheduled runs
@philipcraig philipcraig marked this pull request as draft February 20, 2022 16:14
no longer needed as the cmd_test is correctly marked as an integration
test, so that its binaries are built before tests are run
This ensure that cargo builds its required binaries before running the
test, which is a requirement for these tests
reduce_test should be an integration test, as it depends
upon its binaries to run tests

This change lets `cargo test` work without a prior `cargo build`
@@ -12,13 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::test_utils::{
mod test_utils;
Copy link
Collaborator

Choose a reason for hiding this comment

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

JFYI I am likely to use these test_utils to implement an mdbook doctest macro per #797.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JFYI I am likely to use these test_utils to implement an mdbook doctest macro per #797.

Thanks for the heads up. I turned it back into draft because I'm seeing flaky integration tests on some of the architectures. I don't know the cause. A possible cause could be a compiler bug (and in fact the error messages literally always say that it's a compiler bug). However, before giving up on having reliable non-compiler-crashing integration tests, I thought I'd like to see if I could get the tests to run just via cargo test without a cargo build needed first. That means turning the tests that need binaries to work into Rust "integration tests" and that's the work you can see being partially done here.

I wish I could do it all locally, but I haven't got a way of running github actions across multiple architectures locally.

I can reproduce the flaky test failures on beta and nightly Rust channels locally. Anyway, that's where it's at.

Obviously if you merge #797 first I will have to deal. Otherwise we'll find some way of sharing the code that needs to be shared between integration tests and the mdbook, I'm sure.

separate lists for:
* windows (msvc)
* windows (gnu)
* beta

Make integration tests into integration tests. This lets
`cargo test` succeed, as it then builds the needed
dev-dependencies before running the tests
@adetaylor
Copy link
Collaborator

Yep! Also, consider splitting this into two PRs? If there are some platforms which work reliably let's get them merged!

add the msvc flag that turns on exception handling to builds
try building chromium on Windows with exceptions
hard-code the clang c++14 flag again

Seems that using `flag_if_supported` interacts poorly
with the code in the `test_stringview` test that sets
c++17. Look at in a future PR
@philipcraig philipcraig marked this pull request as ready for review February 22, 2022 00:26
@philipcraig
Copy link
Contributor Author

Yep! Also, consider splitting this into two PRs? If there are some platforms which work reliably let's get them merged!

All known issues are dealt with. Issues raised to triage further post merge

@philipcraig
Copy link
Contributor Author

@adetaylor this is ready for review and potential merge

Copy link
Collaborator

@adetaylor adetaylor left a comment

Choose a reason for hiding this comment

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

This is great! Only one absolutely tiny nit and a question. Thanks!

@@ -382,7 +384,8 @@ where
.host(&target)
.target(&target)
.opt_level(1)
.flag("-std=c++14");
.flag("-std=c++14") // For clang
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be flag_if_supported? It seems surprising this works! Obviously, it does though...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Raied #824

[[test]]
name = "integration_tests"
path = "tests/lib.rs"
harness = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please could you add a newline at the end?

@adetaylor adetaylor merged commit a7c8b65 into google:main Feb 22, 2022
@adetaylor
Copy link
Collaborator

In fact I just went ahead and merged this - I'll raise a PR to add the missing newline as a way of testing this.

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.

Run test suite & examples on more platforms in CI
2 participants