forked from MetadataConsulting/ModelCataloguePlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-all-tests.sh
executable file
·87 lines (71 loc) · 2.75 KB
/
run-all-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
# fail if any line fails
set -e
if [[ "$1" != "" ]]; then
TEST_SUITE="$1"
fi
# karma and functional tests needs to fetch the bower components
if [ "$TEST_SUITE" = "core_integration" ] || [ "$TEST_SUITE" = "app_functional" ] || [ "$TEST_SUITE" = "forms_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./setup-frontend.sh
fi
cd ModelCatalogueCorePlugin
# local builds needs to run in clean environment
if [ -z "$TEST_SUITE" ]; then
./grailsw clean-all
./grailsw refresh-dependencies
fi
# plugin unit tests
if [ "$TEST_SUITE" = "core_unit" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app unit:
mkdir -p $HOME/reports/unit-tests-reports
cp -Rf target/test-reports $HOME/reports/unit-tests-reports
fi
# plugin integration tests
if [ "$TEST_SUITE" = "core_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app integration: org.modelcatalogue.**.*
mkdir -p $HOME/reports/fast-integration-tests-reports
cp -Rf target/test-reports $HOME/reports/fast-integration-tests-reports
fi
# slow and polluting (imports)
if [ "$TEST_SUITE" = "core_integration_slow" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app integration: x.org.modelcatalogue.**.*
mkdir -p $HOME/reports/slow-integration-tests-reports
cp -Rf target/test-reports $HOME/reports/slow-integration-tests-reports
fi
cd ..
cd ModelCatalogueFormsPlugin
if [ "$TEST_SUITE" = "forms_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app integration:
fi
cd ..
cd ModelCatalogueGenomicsPlugin
if [ "$TEST_SUITE" = "gel_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app integration:
fi
cd ..
cd ModelCatalogueCorePlugin
# karma tests, part of the integration as they needs the fixtures generated from the integration tests
if [ "$TEST_SUITE" = "core_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./node_modules/karma/bin/karma start --single-run --browsers Firefox
fi
cd ..
cd ModelCatalogueCorePluginTestApp
# if we're running app tests
if [ "$TEST_SUITE" = "app_integration" ] || [ "$TEST_SUITE" = "app_functional" ] || [ "$TEST_SUITE" = "" ] ; then
# local builds needs to run in clean environment
if [ -z "$TEST_SUITE" ]; then
./grailsw clean-all
./grailsw refresh-dependencies
fi
fi
if [ "$TEST_SUITE" = "app_integration" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app integration:
mkdir -p $HOME/reports/test-app-integration-tests-reports
cp -Rf target/test-reports $HOME/reports/test-app-integration-tests-reports
fi
if [ "$TEST_SUITE" = "app_functional" ] || [ "$TEST_SUITE" = "" ] ; then
./grailsw test-app functional: -war
mkdir -p $HOME/reports/test-app-functional-tests-reports
cp -Rf target/test-reports $HOME/reports/test-app-functional-tests-reports
fi
cd ..