<commit_before>#!/usr/bin/env bash
set -eu

if [[ $# -eq 0 ]]; then
    echo "USAGE: $0 STEP [ARGS]"
    exit 1
fi

BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"
PROJECTS=(
    recipe-client-addon
    recipe-server
    mock-recipe-server
    lints
    compose
    eslint-config-normandy
)

count=0
step=$1
shift 1

for project in "${PROJECTS[@]}"; do
    step_script="${BASE_DIR}/${project}/bin/ci/${step}"
    if [[ -f "${step_script}" ]]; then
        count=$((count + 1))
        echo "============================================================"
        echo "Running ${step} for ${project} (${count})"
        echo "============================================================"

        pushd ${BASE_DIR}/${project}
        "${step_script}" "$@" | cat
        popd
    fi
done

if [[ $count -eq 0 ]]; then<commit_msg>Run functional tests in CI.<commit_after>#!/usr/bin/env bash
set -eu

if [[ $# -eq 0 ]]; then
    echo "USAGE: $0 STEP [ARGS]"
    exit 1
fi

BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)"
PROJECTS=(
    recipe-client-addon
    recipe-server
    mock-recipe-server
    functional_tests
    lints
    compose
    eslint-config-normandy
)

count=0
step=$1
shift 1

for project in "${PROJECTS[@]}"; do
    step_script="${BASE_DIR}/${project}/bin/ci/${step}"
    if [[ -f "${step_script}" ]]; then
        count=$((count + 1))
        echo "============================================================"
        echo "Running ${step} for ${project} (${count})"
        echo "============================================================"

        pushd ${BASE_DIR}/${project}
        "${step_script}" "$@" | cat
        popd
    fi
done

if [[ $count -eq 0 ]]; then
{'fraction_non_alphanumeric': 0.30978575564562827, 'fraction_numerical': 0.010422698320787493, 'mean_word_length': 3.027972027972028, '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': '1950095', 'n_tokens_mistral': 579, 'n_tokens_neox': 549, 'n_words': 132}