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

Randomized testing #1588

Merged
merged 16 commits into from
Aug 11, 2021
Merged

Randomized testing #1588

merged 16 commits into from
Aug 11, 2021

Conversation

dcoeurjo
Copy link
Member

@dcoeurjo dcoeurjo commented Jul 22, 2021

PR Description

Add an option to cmake to only run and test a random selection of unit-tests (e.g. only 30% of them). Each time cmake is run, a new random selection is performed.

This may speed up CI bots since all PR have many commits involved (and the probability of missing an important test decreases with the number of commits;))

TODO:

  • add a whitelist of tests that must be run/compile (eg, the one impacted by the last commits ?)(I have no idea about how to do that)
  • Do the same for examples
  • force a full test cmake .. -DTHRESHOLD_RANDOM_TESTING=100 when merging a PR

Checklist

  • Unit-test of your feature with Catch.
  • Doxygen documentation of the code completed (classes, methods, types, members...)
  • Documentation module page added or updated.
  • New entry in the ChangeLog.md added.
  • No warning raised in Debug cmake mode (otherwise, Travis C.I. will fail).
  • All continuous integration tests pass (Travis & appveyor)

@dcoeurjo
Copy link
Member Author

I will do the same for the examples to speed up the CI bots.
Maybe DGtalTools as well ?
@kerautret

@dcoeurjo
Copy link
Member Author

dcoeurjo commented Jul 24, 2021

Ideas for the whitelist (to force some tests):

@kerautret
Copy link
Member

nice idea to reduce time, and the random select could be a good compromise instead selecting all tests impacted by a commit.

@kerautret
Copy link
Member

I will do the same for the examples to speed up the CI bots.
Maybe DGtalTools as well ?
@kerautret
For the test itself, we don't have any tests in DGtalTools, however we can see a way to reduce the build with random tools selection ?

@dcoeurjo
Copy link
Member Author

Yes, I meant that in dgtal, Travis also builds the entire dgtaltools for a given dgtal commit (to make sure that the commit does not break up dgtaltools).
This could also be randomized for the CI

@kerautret
Copy link
Member

yes agree to also doing it in the tools!

@dcoeurjo
Copy link
Member Author

Great 👍
I'll do it for DGTAL examples as well (I have an idea to whitelist some tests from the git history)

@kerautret
Copy link
Member

nice the example will looks simple to transpose in the tools, and me know to test or help

.travis/before_global.sh Outdated Show resolved Hide resolved
@dcoeurjo dcoeurjo requested a review from kerautret August 8, 2021 09:06
@dcoeurjo
Copy link
Member Author

dcoeurjo commented Aug 8, 2021

Randomized testing enabled in appveyor as well (not the whitelist that would require a shell command)

Copy link
Member

@kerautret kerautret left a comment

Choose a reason for hiding this comment

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

looks great! I try to apply the same for DGtalTools, perhaps I will have some other comment else I will approve ;)

@@ -4,7 +4,7 @@ $SCRIPT_BEGIN
# OS dependent deps
source "$SRC_DIR/.travis/install_eigen.sh"

BTYPE="$BTYPE -DBUILD_EXAMPLES=true -DBUILD_TESTING=false"
BTYPE="$BTYPE -DBUILD_EXAMPLES=false -DBUILD_TESTING=false"
Copy link
Member

Choose a reason for hiding this comment

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

Did it impact the auto main doxygen generation for including examples like these page: https://dgtal-team.github.io/doc-nightly/examples.html ?

@kerautret kerautret mentioned this pull request Aug 10, 2021
6 tasks
@kerautret
Copy link
Member

@dcoeurjo looks fine for me, perfectly works on my computer. I also do same for DGtalTools here: DGtal-team/DGtalTools#416 and do a related PR to your branch: dcoeurjo#30

@dcoeurjo
Copy link
Member Author

Thx @kerautret

@dcoeurjo dcoeurjo merged commit e775f4c into DGtal-team:master Aug 11, 2021
@dcoeurjo dcoeurjo deleted the randomTesting branch August 11, 2021 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants