<commit_before>#!/usr/bin/env bash

set -eu

function log {
   echo "$(date +"%T") - BUILD INFO - $*"
}

# We don't care about migrations; __init__.py can have unused imports
# wsgi.py and scripts/ are handled below
log Running lint
./scripts/devhelpers/lint.sh

./scripts/docker/dev/wait-for-dependencies.sh

## This sometimes hangs if the makemigrations prompts. Latest 1.11 and 2.1 versions of Django have a --check option
log Running makemigrations
python manage.py makemigrations rsr | grep -i "no changes"

log Building node environment
pushd akvo/rsr/front-end
npm install
npm run dev
npm run test
popd

pushd akvo/rsr/spa
npm run test -- --ci --passWithNoTests
popd

pushd akvo/rsr/dir
npm run test -- --ci --passWithNoTests
popd

log Building assets
python manage.py collectstatic --noinput

log Running tests
COVERAGE_PROCESS_START=.coveragerc coverage run --parallel-mode --concurrency=multiprocessing manage.py test --parallel 4 akvo

log Coverage
coverage combine
coverage report -m

log Done<commit_msg>ci: activate deprecation warnings on tests<commit_after>#!/usr/bin/env bash

set -eu

function log {
   echo "$(date +"%T") - BUILD INFO - $*"
}

# We don't care about migrations; __init__.py can have unused imports
# wsgi.py and scripts/ are handled below
log Running lint
./scripts/devhelpers/lint.sh

./scripts/docker/dev/wait-for-dependencies.sh

## This sometimes hangs if the makemigrations prompts. Latest 1.11 and 2.1 versions of Django have a --check option
log Running makemigrations
python manage.py makemigrations rsr | grep -i "no changes"

log Building node environment
pushd akvo/rsr/front-end
npm install
npm run dev
npm run test
popd

pushd akvo/rsr/spa
npm run test -- --ci --passWithNoTests
popd

pushd akvo/rsr/dir
npm run test -- --ci --passWithNoTests
popd

log Building assets
python manage.py collectstatic --noinput

log Running tests
export PYTHONWARNINGS=all
COVERAGE_PROCESS_START=.coveragerc coverage run --parallel-mode --concurrency=multiprocessing manage.py test --parallel 4 akvo
export -n PYTHONWARNINGS

log Coverage
coverage combine
coverage report -m

log Done
{'fraction_non_alphanumeric': 0.08656575212866603, 'fraction_numerical': 0.005676442762535478, 'mean_word_length': 3.964788732394366, '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': '210912', 'n_tokens_mistral': 723, 'n_tokens_neox': 677, 'n_words': 251}