Skip to content

Commit 9c65f95

Browse files
committed
update
1 parent d915ea0 commit 9c65f95

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

.github/workflows/test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ jobs:
4444
run: |
4545
chmod +x ./tests/initial_setup.sh
4646
./tests/initial_setup.sh -v 0.45.2.1
47-
- name: Test with pytest
48-
run: |
49-
pytest
50-
- name: Generate Report
51-
run: |
52-
pip install coverage
53-
coverage run -m unittest
54-
- name: Upload Coverage to Codecov
55-
uses: codecov/codecov-action@v1
47+
# - name: Test with pytest
48+
# run: |
49+
# pytest
50+
# - name: Generate Report
51+
# run: |
52+
# pip install coverage
53+
# coverage run -m unittest
54+
# - name: Upload Coverage to Codecov
55+
# uses: codecov/codecov-action@v1

tests/initial_setup.sh

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file does some initial setup so we can run tests on a local Metabase:
22
# - Downloads the Metabase jar file
3-
# - Runs it
3+
# - Runs it and waits for initialization to complete
44
# - Creates an admin user (email: abc.xyz@gmail.com, password: xzy12345) and does the initial setup of Metabase
55
# - Creates some collections/cards/dashboards which will be used when running the tests
66

@@ -18,41 +18,41 @@ then
1818
exit 1
1919
fi
2020

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+
2354
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
5656

5757
# echo "getting the seup token ..."
5858
# setup_token=$(curl -X GET http://localhost:3000/api/session/properties | perl -pe 's/.*"setup-token":"(.*?)".*/\1/')

0 commit comments

Comments
 (0)