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 test that runs every nannou example listed in the Cargo.toml #287

Merged

Conversation

mitchmindtree
Copy link
Member

This adds an example that runs each nannou example listed in the
Cargo.toml for a few seconds each, one at a time.

This is useful for finding panic!s that only occur at runtime, as
while cargo test does compile the examples, it does not try and
execute them.

The test has the #[ignore] attribute so that cargo test does not run
the example by default. This is because 1. the test takes a looong time
to run and 2. travis is likely incapable of running a lot of the tests
as it doesn't have a windowing system etc. As a result, to run the test
locally use cargo test -- --ignored. We should try to ensure we run
this at least once before publishing each major release.

Specifically, this test was created to help with testing for vulkano
image layout bugs (#271). cc @freesig just pinging you as you might
find this useful for this reason too!

This adds an example that runs each nannou example listed in the
Cargo.toml for a few seconds each, one at a time.

This is useful for finding `panic!`s that only occur at runtime, as
while `cargo test` does compile the examples, it does not try and
execute them.

The test has the `#[ignore]` attribute so that `cargo test` does not run
the example by default. This is because 1. the test takes a looong time
to run and 2. travis is likely incapable of running a lot of the tests
as it doesn't have a windowing system etc. As a result, to run the test
locally use `cargo test -- --ignored`. We should try to ensure we run
this at least once before publishing each major release.

Specifically, this test was created to help with testing for vulkano
image layout bugs (nannou-org#271). cc @freesig just pinging you as you might
find this useful for this reason too!
@mitchmindtree
Copy link
Member Author

Travis seems to be failing due to a bug in the latest nightly (rustc overflowing its stack while building docs):

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: Could not document `num-traits`.
Caused by:
  process didn't exit successfully: `rustdoc --crate-name num_traits /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.6/src/lib.rs --cap-lints allow --color always -o /home/travis/build/nannou-org/nannou/target/doc --cfg 'feature="default"' --cfg 'feature="std"' -L dependency=/home/travis/build/nannou-org/nannou/target/debug/deps --cfg has_i128` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
error: build failed
The command "cargo doc -v" exited with 101.

@mitchmindtree
Copy link
Member Author

mitchmindtree commented Mar 30, 2019

Here is the relevant issue rust-lang/rust#59502

Going to merge this for now as stable and beta seem to be building fine and it looks like there is a PR up already for fixing the issue above in rustc.

@mitchmindtree mitchmindtree merged commit 91ed070 into nannou-org:master Mar 30, 2019
@mitchmindtree mitchmindtree deleted the test_run_all_examples branch March 30, 2019 06:15
@mitchmindtree
Copy link
Member Author

mitchmindtree commented Mar 30, 2019

Just a heads up that using cargo test -- --ignored will actually also try to compile and run examples that have been ignored throughout the docs. The correct way to run the new example would be to use:

cargo test run_all_examples -- --ignored

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