material-components_materia.../travis_run_unit_tests.sh
Miguel Yáñez Barreto 6da2b792d7 Improve Travis CI configuration.
-Removes unnecessary packages that were being installed before having the Google Maven Repository.
-Splits Travis CI builds into separate jobs, one containing unit tests only and the rest containing instrumentation tests. This helps keep lint and unit test results separate from other checks and improves performance.
-Makes sure unit test jobs do not bring up any emulators.
-Makes sure instrumentation test jobs don't run any unit tests.
-Adds 3 environments to run tests in, android-16, android-19 and android-21.
-- Each of these environments installs its dependencies dynamically, so the build takes the least amount of time installing stuff

Notice SnackBarTest is flaky, but fails often in android-21, and AppBarWithCollapsingToolbarTest.testPinnedToolbarWithMargins fails constantly on all three targets.

This is not the case with internal tools, so these failures have to be debugged manually in external configurations.

PiperOrigin-RevId: 169721027
2017-09-22 15:15:51 -04:00

18 lines
380 B
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "TEST_TYPE=$TEST_TYPE"
echo "EMULATOR_API=$EMULATOR_API"
echo "ABI=$ABI"
if [ "$TEST_TYPE" == "unit" ]; then
echo "Starting unit tests..."
./gradlew assemble lint build test -PdisablePreDex;
elif [ "$TEST_TYPE" == "instrumentation" ]; then
echo "Skipping unit tests for instrumentation builds."
else
echo "Unknown test type"
exit 1
fi