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

Disable test suites that contain no tests #4391

Open
brson opened this Issue Mar 18, 2019 · 3 comments

Comments

2 participants
@brson
Copy link
Contributor

commented Mar 18, 2019

I haven't looked closely at this, but I'm hopeful that some compile time can be saved by not building empty test suites and doc test suites.

I think cargo has some ability to control which targets are built for testing. I hope it can control which are doc-tested.

So the task here is to find all of the empty test suites run by cargo test --all and disable them in Cargo.toml by setting either test = false or doctest = false. Then time cargo test --all --no-run before and after.

@brson brson added this to To do in Improve compile times via automation Mar 18, 2019

kisom added a commit to kisom/tikv that referenced this issue Mar 28, 2019

Cargo.toml: ignore empty test cases
This change ignores the test cases with empty tests, as per tikv#4391.

kisom added a commit to kisom/tikv that referenced this issue Mar 28, 2019

Cargo.toml: ignore empty test cases
This change ignores the test cases with empty tests, as per tikv#4391.

Signed-off-by: Kyle Isom <kyle@imap.cc>
@jswh

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2019

Do you mean to add #[cfg(test)] to those test functions ?

@brson

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2019

@jswh no, it's not that there are test cases that are missing the attribute, but that there are test suites with no test cases at all. And compiling them costs time. There is though a PR open for this.

@jswh

This comment has been minimized.

Copy link
Contributor

commented Apr 11, 2019

I did some search but only found the cargo test --all --exclude <spec> command that can exclude specific test suites.
The empty test suties could be found by the test output. For example,the test_storage has no cases as the output says

Running /mnt/c/Codes/third/tikv/target/debug/deps/test_storage-436a8955ad0b3b77

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

The list was found with a little script as

  • fuzz
  • bfuzz_targets
  • fuzzer_afl
  • fuzzer_honggfuzz
  • fuzzer_libfuzzer
  • panic_hook
  • test_raftstore
  • test_storage

And when I try to run the tests with time cargo test --all --no-run --exclude fuzz fuzzer_afl fuzzer_honggfuzz fuzzer_libfuzzer panic_hook test_raftstore test_storage it shows some error

error: Found argument 'fuzzer_honggfuzz' which wasn't expected, or isn't valid in this context

I am not sure if it is what the wanted and what to do next.
Newbee here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.