aboutsummaryrefslogtreecommitdiff
path: root/.github/actions/test-shard-run/run_tests.sh
blob: 1f312bbc0119adb86e1e51b4f76e507d56fa2d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
set -e

export TEST_GROUPS_COUNT=${1}
export TEST_GROUP_INDEX=${2}
MODULE=${3}
EXTRA_ARGS=${4}

echo "Will run tests for module '${MODULE}' with extra args '${EXTRA_ARGS}' for group-index ${TEST_GROUP_INDEX} out of ${TEST_GROUPS_COUNT} groups:"

./scripts/download_robolectric_jars_to_machine.sh

#extra args needs to come before the coverage task so "--tests" will be passed to the test tasks
# we automatically re-try on gradle crash
./scripts/retry-on-SIGSEGV.sh 2 6,134 ./gradlew "${MODULE}testDebugUnitTest" ${EXTRA_ARGS} "${MODULE}testDebugUnitTestCoverage"

#see https://github.com/actions/cache/issues/133
[[ -n "${GITHUB_ACTIONS}" ]] && chmod -R a+rwx .