<commit_before>#!/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}");
   echo
   echo
   echo Running unit and Android tests in $p
   echo "====================================================================="

   pushd $p > /dev/null  # Silent pushd
   ./gradlew :app:assembleDebug -PdisablePreDex | sed "s@^@$p @"  # Prefix every line with directory
   code=${PIPESTATUS[0]}
   if [ "$code" -ne "0" ]; then
       exit $code
   fi

   ./gradlew :app:assembleAndroidTest -PdisablePreDex | sed "s@^@$p @"  # Prefix every line with directory
   ./gradlew test -PdisablePreDex | sed "s@^@$p @"  # 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 $p"
      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 21,25 -l fr --results-bucket cloud-test-android-devrel-ci
   code=${PIPESTATUS[0]}
   if [ "$code" -ne "0" ]; then
       exit $code
   fi
   popd > /dev/null  # Silent popd
done

echo
echo "ALL TESTS PASS"<commit_msg>WIP: Sending CircleCI results to a different bucket<commit_after>#!/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}");
   echo
   echo
   echo Running unit and Android tests in $p
   echo "====================================================================="

   pushd $p > /dev/null  # Silent pushd
   ./gradlew :app:assembleDebug -PdisablePreDex | sed "s@^@$p @"  # Prefix every line with directory
   code=${PIPESTATUS[0]}
   if [ "$code" -ne "0" ]; then
       exit $code
   fi

   ./gradlew :app:assembleAndroidTest -PdisablePreDex | sed "s@^@$p @"  # Prefix every line with directory
   ./gradlew test -PdisablePreDex | sed "s@^@$p @"  # 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 $p"
      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
   code=${PIPESTATUS[0]}
   if [ "$code" -ne "0" ]; then
       exit $code
   fi
   popd > /dev/null  # Silent popd
done

echo
echo "ALL TESTS PASS"
{'fraction_non_alphanumeric': 0.17293997965412003, 'fraction_numerical': 0.0054255679891488644, 'mean_word_length': 3.1086350974930363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6669738', 'n_tokens_mistral': 1044, 'n_tokens_neox': 971, 'n_words': 302}