1 Star 0 Fork 0

sumanwu/architecture-components-samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test_all_ftl.sh 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
for line in $(find . -name 'gradlew'); do
p=$(dirname "${line}");
name="${p##*/}";
echo
echo
echo Running unit and Android tests in $name
echo "====================================================================="
pushd $p > /dev/null # Silent pushd
./gradlew :app:assembleDebug -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
code=${PIPESTATUS[0]}
if [ "$code" -ne "0" ]; then
exit $code
fi
./gradlew :app:assembleAndroidTest -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
./gradlew test -PdisablePreDex | sed "s@^@$name @" # Prefix every line with directory
apkfile=app/build/outputs/apk/debug/app-debug.apk
testapkfile=app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
if [ ! -f $apkfile ] || [ ! -f $testapkfile ] ; then
echo "APKs not found, probably due to project using multiple flavors. Skipping $name"
popd > /dev/null # Silent popd
continue
fi
echo "Sending APKs to Firebase..."
echo "y" | sudo /opt/google-cloud-sdk/bin/gcloud firebase test android run --app $apkfile --test $testapkfile -d Nexus5X -v 26 -l fr --results-bucket=android-architecture-components-test-results --results-dir=$CIRCLE_BUILD_NUM/$name
code=${PIPESTATUS[0]}
if [ "$code" -ne "0" ]; then
exit $code
fi
# Copy the test results to the build artifacts folder in CircleCI
sudo /opt/google-cloud-sdk/bin/gsutil -m cp -r -U `sudo /opt/google-cloud-sdk/bin/gsutil ls gs://android-architecture-components-test-results/$CIRCLE_BUILD_NUM/$name/**/test_result*.xml | tail -1` $CIRCLE_ARTIFACTS/ | true
popd > /dev/null # Silent popd
done
echo
echo "ALL TESTS PASS"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sumanwu/architecture-components-samples.git
git@gitee.com:sumanwu/architecture-components-samples.git
sumanwu
architecture-components-samples
architecture-components-samples
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385