|
1 |
| -#!/bin/bash |
2 |
| - |
3 |
| -set -e |
4 |
| - |
5 |
| -REGUSER="" |
6 |
| -PI="" |
7 |
| -CD="" |
8 |
| -CS="" |
9 |
| -PUB="" |
10 |
| -WAREHOUSE="" |
11 |
| - |
12 |
| -if [ "$1" = "--junit-output-dir" ]; |
13 |
| -then |
14 |
| - REGUSER="--log-junit $2/xdmod-supremm-regression-user.xml" |
15 |
| - PI="--log-junit $2/xdmod-supremm-regression-principalinvestigator.xml" |
16 |
| - CD="--log-junit $2/xdmod-supremm-regression-centerdirector.xml" |
17 |
| - CS="--log-junit $2/xdmod-supremm-regression-centerstaff.xml" |
18 |
| - PUB="--log-junit $2/xdmod-supremm-regression-public.xml" |
19 |
| - WAREHOUSE="--log-junit $2/xdmod-supremm-regression-warehouse.xml" |
20 |
| -fi |
21 |
| - |
22 |
| -cd $(dirname $0) |
23 |
| - |
24 |
| -if [ ! -e ../../../xdmod/tests/ci/testing.json ]; |
25 |
| -then |
26 |
| - echo "ERROR missing .secrets.json file." >&2 |
27 |
| - echo >&2 |
28 |
| - cat README.md >&2 |
29 |
| - exit 126 |
30 |
| -fi |
31 |
| - |
32 |
| -phpunit="$(readlink -f ../../../xdmod/vendor/bin/phpunit)" |
33 |
| - |
34 |
| -if [ ! -x "$phpunit" ]; then |
35 |
| - echo phpunit not found, run \"composer install\" 1>&2 |
36 |
| - exit 127 |
37 |
| -fi |
38 |
| - |
39 |
| -export REG_TEST_BASE=${REG_TEST_BASE:-/../../../../../xdmod-supremm/tests/artifacts/regression/current/} |
40 |
| - |
41 |
| -function run_warehouse_raw_data_tests { |
42 |
| - # Need to ignore the values of deidentified usernames when comparing the |
43 |
| - # actual and expected data because the values will be different depending |
44 |
| - # on whether XDMOD_TEST_MODE is set to 'upgrade' or 'fresh_install' since |
45 |
| - # these two testing pipelines produce different hashes for the usernames. |
46 |
| - REG_TEST_USER_ROLE=usr \ |
47 |
| - REG_TEST_REGEX='/[0-9a-f]{40}/' \ |
48 |
| - REG_TEST_REPLACE='<username>' \ |
49 |
| - $phpunit $WAREHOUSE --group warehouseRawData . |
50 |
| -} |
51 |
| - |
52 |
| -if [ "$REG_TEST_ALL" == "1" ]; then |
53 |
| - set +e |
54 |
| - REG_TEST_USER_ROLE=cd $phpunit $CD --exclude-group warehouseRawData . |
55 |
| - |
56 |
| - #REG_TEST_USER_ROLE=usr $phpunit $REGUSER ./lib/Controllers/UsageExplorerSupremmTest.php |
57 |
| - #REG_TEST_USER_ROLE=pi $phpunit $PI ./lib/Controllers/UsageExplorerSupremmTest.php |
58 |
| - #REG_TEST_USER_ROLE=cs $phpunit $CS ./lib/Controllers/UsageExplorerSupremmTest.php |
59 |
| - #$phpunit $PUB ./lib/Controllers/UsageExplorerSupremmTest.php |
60 |
| - |
61 |
| - run_warehouse_raw_data_tests |
62 |
| -else |
63 |
| - REG_TEST_USER_ROLE=cd $phpunit $CD --exclude-group warehouseRawData . & cdpid=$! |
64 |
| - |
65 |
| - #REG_TEST_USER_ROLE=usr $phpunit $REGUSER ./lib/Controllers/UsageExplorerSupremmTest.php & usrpid=$! |
66 |
| - #REG_TEST_USER_ROLE=pi $phpunit $PI ./lib/Controllers/UsageExplorerSupremmTest.php & pipid=$! |
67 |
| - #REG_TEST_USER_ROLE=cs $phpunit $CS ./lib/Controllers/UsageExplorerSupremmTest.php & cspid=$! |
68 |
| - #$phpunit $PUB ./lib/Controllers/UsageExplorerSupremmTest.php & pubpid=$! |
69 |
| - |
70 |
| - run_warehouse_raw_data_tests & warehousepid=$! |
71 |
| - |
72 |
| - EXIT_STATUS=0 |
73 |
| - for pid in $usrpid $pipid $cdpid $cspid $pubpid $warehousepid; |
74 |
| - do |
75 |
| - wait "$pid" |
76 |
| - if [ "$?" -ne "0" ]; |
77 |
| - then |
78 |
| - EXIT_STATUS=1 |
79 |
| - fi |
80 |
| - done |
81 |
| - exit $EXIT_STATUS |
82 |
| -fi |
| 1 | +source $XDMOD_SRC_DIR/tests/regression/runtests.sh |
0 commit comments