-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #314 from EpistasisLab/unit_test_runner_refactor
Unit test runner refactor, Github Actions update
- Loading branch information
Showing
4 changed files
with
72 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# unit test runner for jest javascript tests | ||
|
||
export JEST_JUNIT_OUTPUT_DIR="${REPORT_PATH}" | ||
|
||
echo "starting '/lab' jest reports" | ||
cd "/appsrc/lab/" | ||
npm run test | ||
|
||
|
||
echo "starting '/lab/webapp' jest reports" | ||
cd "/appsrc/lab/webapp/" | ||
npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
# unit test runner for python tests | ||
REPORT_PATH="/appsrc/target/test-reports" | ||
COVERAGE_PATH="/appsrc/target/test-reports/cobertura" | ||
NOSE_LOG_PATH="/appsrc/target/test-reports/nose.log" | ||
|
||
|
||
NOSE_TESTS="/appsrc/ai/tests/test_recommender.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/tests/test_ai.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/tests/test_ai_and_api_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/tests/test_api_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/tests/test_knowledgebase_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/metalearning/tests/test_dataset_describe.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/ai/metalearning/tests/test_get_metafeatures.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/machine/test/learn_tests.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/lab/pyutils/tests/test_loadInitialDatasets.py" | ||
NOSE_TESTS="${NOSE_TESTS} /appsrc/lab/pyutils/tests/test_validateDataset.py" | ||
##NOSE_TESTS="${NOSE_TESTS} ai/tests/test_knowledgebase_utils_profile.py" | ||
|
||
MOCHA_TESTS="/appsrc/machine/test/test.js" | ||
|
||
|
||
rm -f "${REPORT_PATH}/nose_xunit.xml" | ||
rm -f "${REPORT_PATH}/mocha_xunit.xml" | ||
rm -drf "${COVERAGE_PATH}" | ||
|
||
mkdir -p "${REPORT_PATH}/cobertura/html" | ||
mkdir -p "${REPORT_PATH}/html" | ||
|
||
echo "starting nosetest" | ||
echo $NOSE_TESTS | ||
|
||
coverage run -m nose -s \ | ||
--with-xunit --xunit-file="${REPORT_PATH}/nose_xunit.xml" \ | ||
--with-html --html-file="${REPORT_PATH}/html/nose.html" \ | ||
-v $NOSE_TESTS \ | ||
#--verbosity=4 | ||
#--verbosity=4 > $NOSE_LOG_PATH 2>&1 | ||
|
||
coverage combine | ||
coverage html -d "${COVERAGE_PATH}/html" | ||
coverage xml -o "${COVERAGE_PATH}/nose_cover.xml" | ||
|
||
#echo "coverage erase" | ||
#coverage erase | ||
|
||
echo "starting mocha tests" | ||
mocha --reporter xunit --reporter-options output="${REPORT_PATH}/mocha_xunit.xml" $MOCHA_TESTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,7 @@ | ||
#!/bin/bash | ||
|
||
REPORT_PATH="/appsrc/target/test-reports" | ||
COVERAGE_PATH="/appsrc/target/test-reports/cobertura" | ||
NOSE_LOG_PATH="/appsrc/target/test-reports/nose.log" | ||
dos2unix /appsrc/tests/unit/py_tests.sh | ||
dos2unix /appsrc/tests/unit/js_tests.sh | ||
|
||
|
||
NOSE_TESTS="ai/tests/test_recommender.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/tests/test_ai.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/tests/test_ai_and_api_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/tests/test_api_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/tests/test_knowledgebase_utils.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/metalearning/tests/test_dataset_describe.py" | ||
NOSE_TESTS="${NOSE_TESTS} ai/metalearning/tests/test_get_metafeatures.py" | ||
NOSE_TESTS="${NOSE_TESTS} machine/test/learn_tests.py" | ||
NOSE_TESTS="${NOSE_TESTS} lab/pyutils/tests/test_loadInitialDatasets.py" | ||
NOSE_TESTS="${NOSE_TESTS} lab/pyutils/tests/test_validateDataset.py" | ||
##NOSE_TESTS="${NOSE_TESTS} ai/tests/test_knowledgebase_utils_profile.py" | ||
|
||
MOCHA_TESTS="machine/test/test.js" | ||
|
||
rm -f "${REPORT_PATH}/nose_xunit.xml" | ||
rm -f "${REPORT_PATH}/mocha_xunit.xml" | ||
rm -drf "${COVERAGE_PATH}" | ||
|
||
mkdir -p target/test-reports/cobertura/html | ||
mkdir -p target/test-reports/html | ||
|
||
echo "starting nosetest" | ||
echo $NOSE_TESTS | ||
|
||
coverage run -m nose -s \ | ||
--with-xunit --xunit-file="${REPORT_PATH}/nose_xunit.xml" \ | ||
--with-html --html-file="${REPORT_PATH}/html/nose.html" \ | ||
-v $NOSE_TESTS \ | ||
#--verbosity=4 | ||
#--verbosity=4 > $NOSE_LOG_PATH 2>&1 | ||
|
||
coverage combine | ||
coverage html -d "${COVERAGE_PATH}/html" | ||
coverage xml -o "${COVERAGE_PATH}/nose_cover.xml" | ||
|
||
echo "coverage erase" | ||
coverage erase | ||
|
||
echo "starting mocha tests" | ||
mocha --reporter xunit --reporter-options output="${REPORT_PATH}/mocha_xunit.xml" $MOCHA_TESTS | ||
|
||
|
||
# jest tests | ||
export JEST_JUNIT_OUTPUT_DIR="${REPORT_PATH}" | ||
|
||
echo "starting lab jest reports" | ||
cd "/appsrc/lab/" | ||
npm run test | ||
|
||
|
||
echo "starting webapp jest reports" | ||
cd "/appsrc/lab/webapp/" | ||
npm run test | ||
|
||
# todo: check for generated files and potentially remove | ||
# jest - snapshots, potentially use or disable | ||
. /appsrc/tests/unit/py_tests.sh | ||
. /appsrc/tests/unit/js_tests.sh |