|
1 | 1 | # This file does some initial setup so we can run tests on a local Metabase:
|
2 | 2 | # - Downloads the Metabase jar file
|
3 |
| -# - Runs it |
| 3 | +# - Runs it and waits for initialization to complete |
4 | 4 | # - Creates an admin user (email: abc.xyz@gmail.com, password: xzy12345) and does the initial setup of Metabase
|
5 | 5 | # - Creates some collections/cards/dashboards which will be used when running the tests
|
6 | 6 |
|
|
18 | 18 | exit 1
|
19 | 19 | fi
|
20 | 20 |
|
21 |
| -echo https://downloads.metabase.com/v$MB_VERSION/metabase.jar |
22 |
| -pwd |
| 21 | +echo "downloading metabase jar ..." |
| 22 | +wget https://downloads.metabase.com/v$MB_VERSION/metabase.jar |
| 23 | +echo "starting metabase jar locally ..." |
| 24 | +java -jar metabase.jar > logs 2>&1 & |
| 25 | + |
| 26 | +echo "waiting 60 seconds for the initialization to complete ..." |
| 27 | +sleep 60 |
| 28 | + |
| 29 | +# checking whether the metabase initialization has completed. If not, wait another 60 seconds |
| 30 | +success='False' |
| 31 | +grep -q "Metabase Initialization COMPLETE" logs |
| 32 | +if [[ $? -eq 0 ]] |
| 33 | +then |
| 34 | + echo 'success!' |
| 35 | + success='True' |
| 36 | +else |
| 37 | + echo "Waiting an extra 60 seconds for the initialization to complete" |
| 38 | + sleep 60 |
| 39 | + grep -q "Metabase Initialization COMPLETE" logs |
| 40 | + if [[ $? -eq 0 ]] |
| 41 | + then |
| 42 | + echo 'success!' |
| 43 | + success='True' |
| 44 | + else |
| 45 | + echo 'failure!' |
| 46 | + fi |
| 47 | +fi |
| 48 | + |
| 49 | +if [[ $success = 'False' ]] |
| 50 | +then |
| 51 | + exit 1 |
| 52 | +fi |
| 53 | + |
23 | 54 | ls -l
|
24 |
| -#cp tests/data/test_db.sqlite plugins |
25 |
| - |
26 |
| -# wget https://downloads.metabase.com/v$MB_VERSION/metabase.jar |
27 |
| -# echo "starting metabase jar locally ..." |
28 |
| -# java -jar metabase.jar > logs 2>&1 & |
29 |
| - |
30 |
| -# echo "waiting 60 seconds for the initialization to complete ..." |
31 |
| -# sleep 60 |
32 |
| - |
33 |
| -# success='False' |
34 |
| -# grep -q "Metabase Initialization COMPLETE" logs |
35 |
| -# if [[ $? -eq 0 ]] |
36 |
| -# then |
37 |
| -# echo 'success!' |
38 |
| -# success='True' |
39 |
| -# else |
40 |
| -# echo "Waiting an extra 60 seconds for the initialization to complete" |
41 |
| -# sleep 60 |
42 |
| -# grep -q "Metabase Initialization COMPLETE" logs |
43 |
| -# if [[ $? -eq 0 ]] |
44 |
| -# then |
45 |
| -# echo 'success!' |
46 |
| -# success='True' |
47 |
| -# else |
48 |
| -# echo 'failure!' |
49 |
| -# fi |
50 |
| -# fi |
51 |
| - |
52 |
| -# if [[ $success = 'False' ]] |
53 |
| -# then |
54 |
| -# exit 1 |
55 |
| -# fi |
| 55 | +cp tests/data/test_db.sqlite plugins |
56 | 56 |
|
57 | 57 | # echo "getting the seup token ..."
|
58 | 58 | # setup_token=$(curl -X GET http://localhost:3000/api/session/properties | perl -pe 's/.*"setup-token":"(.*?)".*/\1/')
|
|
0 commit comments