Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakhnov committed Sep 25, 2020
1 parent a269bb3 commit d532077
Showing 1 changed file with 50 additions and 43 deletions.
93 changes: 50 additions & 43 deletions test.sh
Expand Up @@ -10,67 +10,74 @@ function run_test {
python test.py test --settings=$1
result=$?
if [ "$TEST_TYPE" == "memory" ]; then
if [ -n "$PULL_REQUEST_NUMBER" ]; then
export TRAVIS_PULL_REQUEST=$PULL_REQUEST_NUMBER;
else export TRAVIS_PULL_REQUEST='false'; fi
if [ -v COVERALLS_REPO_TOKEN ]; then
coveralls
fi
if [ -v CODACY_PROJECT_TOKEN ]; then
coverage xml
python-codacy-coverage -r coverage.xml
fi
if [ -n "$PULL_REQUEST_NUMBER" ]; then
export TRAVIS_PULL_REQUEST=$PULL_REQUEST_NUMBER;
else
export TRAVIS_PULL_REQUEST='false';
fi
if [ -v COVERALLS_REPO_TOKEN ]; then
coveralls
fi
if [ -v CODACY_PROJECT_TOKEN ]; then
coverage xml
python-codacy-coverage -r coverage.xml
fi
fi
return $result
}

case "$TEST_TYPE" in
memory)
run_test tardis.test_settings
(( exit_status = exit_status || $? ))
;;
run_test tardis.test_settings
(( exit_status = exit_status || $? ))
;;
pg)
run_test tardis.test_on_postgresql_settings
(( exit_status = exit_status || $? ))
;;
run_test tardis.test_on_postgresql_settings
(( exit_status = exit_status || $? ))
;;
mysql)
run_test tardis.test_on_mysql_settings
(( exit_status = exit_status || $? ))
;;
run_test tardis.test_on_mysql_settings
(( exit_status = exit_status || $? ))
;;
pylint)
pylint --rcfile .pylintrc tardis
(( exit_status = exit_status || $? ))
;;
pylint --rcfile .pylintrc tardis
(( exit_status = exit_status || $? ))
;;
behave)
npm install && npm audit --audit-level=high --production && npm run-script build && \
npm test && python test.py behave
(( exit_status = exit_status || $? ))
;;
npm install && \
npm audit --audit-level=high --production && \
npm run-script build && \
npm test && \
python test.py behave
(( exit_status = exit_status || $? ))
;;
templates)
echo $'Validating templates...\n' && \
DJANGO_SETTINGS_MODULE=tardis.test_settings python manage.py validate_templates && \
echo $'\nChecking for tabs in templates...\n' && \
! grep -r $'\t' tardis/tardis_portal/templates/* && \
echo $'\nChecking for duplication in templates...\n' && \
npm install --no-package-lock --no-save jscpd && \
$(npm bin)/jscpd --reporters consoleFull --min-lines 20 \
--threshold 0 tardis/tardis_portal/templates/ &&
npm install --no-package-lock --no-save jscpd && \
$(npm bin)/jscpd --reporters consoleFull --min-lines 20 --threshold 0 tardis/tardis_portal/templates/ &&
echo $'\nRunning bootlint on templates...\n' && \
# npm install --no-package-lock --no-save bootlint && \
# $(npm bin)/bootlint --disable E001,E041,E047,W001,W002,W003,W005 \
# tardis/tardis_portal/templates/tardis_portal/*.html
(( exit_status = exit_status || $? ))
;;
(( exit_status = exit_status || $? ))
;;
*)
run_test tardis.test_settings
(( exit_status = exit_status || $? ))
run_test tardis.test_on_postgresql_settings
(( exit_status = exit_status || $? ))
run_test tardis.test_on_mysql_settings
(( exit_status = exit_status || $? ))
pylint --rcfile .pylintrc tardis
(( exit_status = exit_status || $? ))
;;
run_test tardis.test_settings
(( exit_status = exit_status || $? ))
run_test tardis.test_on_postgresql_settings
(( exit_status = exit_status || $? ))
run_test tardis.test_on_mysql_settings
(( exit_status = exit_status || $? ))
pylint --rcfile .pylintrc tardis
(( exit_status = exit_status || $? ))
npm install && \
npm audit --audit-level=high --production && \
npm run-script build && \
npm test && \
python test.py behave
(( exit_status = exit_status || $? ))
;;
esac

exit $exit_status

0 comments on commit d532077

Please sign in to comment.