#!/bin/bash

# script/test: Run static code checks and unit tests

source "$(dirname "${0}")"/../script/include/global_header.inc.sh

export FLASK_ENV=test

# Enable database resetting
RESET_DB="true"

# Define all relevant python files and directories for this app
PYTHON_FILES="./app.py ./atst/** ./config"

# Enable Python testing
RUN_PYTHON_TESTS="true"

# Enable Javascript testing
RUN_JS_TESTS="true"

# Check python formatting
output_divider "Run formatting check"
source ./script/format check

# Check for secrets
output_divider "Run detect secrets"
./script/detect_secrets

# Run the shared test script
source ./script/include/run_test
