<commit_before>#!/bin/sh

BUILD_ID=$1
TEST_DIR=$2

test_apk() {
	RESULTS_DIR=$1_$BUILD_ID

    gcloud firebase test android run \
	    --type instrumentation \
	    --app $2 \
	    --test $3 \
	    --device model=Nexus6P,version=27,locale=en_US,orientation=portrait \
	    --timeout 30m \
	    --results-bucket cloud-test-android-devrel-ci \
	    --results-dir=$RESULTS_DIR \
	    --no-record-video \
	    --no-performance-metrics

    # Make result dir
    mkdir -p "$TEST_DIR/$RESULTS_DIR"

	# Pull down test results
	gsutil -m cp -r -U "gs://android-devrel-ci/$RESULTS_DIR/*" "$TEST_DIR/$RESULTS_DIR"
}

test_apk \
	"app" \<commit_msg>Update test result bucket location<commit_after>#!/bin/sh

BUILD_ID=$1
TEST_DIR=$2

test_apk() {
	RESULTS_DIR=$1_$BUILD_ID

    gcloud firebase test android run \
	    --type instrumentation \
	    --app $2 \
	    --test $3 \
	    --device model=Nexus6P,version=27,locale=en_US,orientation=portrait \
	    --timeout 30m \
	    --results-bucket cloud-test-android-devrel-ci \
	    --results-dir=$RESULTS_DIR \
	    --no-record-video \
	    --no-performance-metrics

    # Make result dir
    mkdir -p "$TEST_DIR/$RESULTS_DIR"

	# Pull down test results
	gsutil -m cp -r -U "gs://cloud-test-android-devrel-ci/$RESULTS_DIR/*" "$TEST_DIR/$RESULTS_DIR"
}

test_apk \
	"app" \
{'fraction_non_alphanumeric': 0.14984709480122324, 'fraction_numerical': 0.01529051987767584, 'mean_word_length': 2.606060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4087226', 'n_tokens_mistral': 523, 'n_tokens_neox': 467, 'n_words': 92}