Skip to content

Commit

Permalink
test: Pick platform randomly in "sloppy" mode.
Browse files Browse the repository at this point in the history
This will give us more coverage of android when we're running tools/test
in sloppy mode (which is the default).

This does make things somewhat flaky, but on the whole it makes us more
likely to notice failures that only occur on one platform sooner.

See prior discussion:
#4700 (comment)
  • Loading branch information
WesleyAC authored and chrisbobbe committed Jun 18, 2021
1 parent 606796a commit 3f7c015
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/test
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,18 @@ run_jest() {
;;
esac

PLATFORMS=("ios" "android")
RANDOM_PLATFORM=${PLATFORMS[RANDOM%2]}

case "$platform" in
ios) jest_args+=( --selectProjects ios );;
android) jest_args+=( --selectProjects android );;
both) jest_args+=( --selectProjects ios android );;

# This is where `sloppy` is sloppy: we just choose iOS, so the
# tests will run faster, but at the expense of a (relatively
# small) loss of coverage.
sloppy) jest_args+=( --selectProjects ios );;
# This is where `sloppy` is sloppy: we choose a platform randomly, so
# the tests will run faster, but at the expense of a (relatively small)
# loss of coverage.
sloppy) jest_args+=( --selectProjects "$RANDOM_PLATFORM");;
esac

check_node || return
Expand Down

0 comments on commit 3f7c015

Please sign in to comment.