File tree Expand file tree Collapse file tree 1 file changed +31
-12
lines changed
Expand file tree Collapse file tree 1 file changed +31
-12
lines changed Original file line number Diff line number Diff line change 1- name : Run Keploy API Tests
1+ name : Keploy API Test
22
33on :
44 push :
5- branches :
6- - main
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
78
89jobs :
9- keploy-tests :
10+ run- keploy-tests :
1011 runs-on : ubuntu-latest
1112
13+ services :
14+ mongo :
15+ image : mongo:4.4
16+ options : >-
17+ --health-cmd="mongo --eval 'db.runCommand({ ping:1 })'"
18+ --health-interval=10s --health-timeout=5s --health-retries=5
19+ --name mongo
20+
1221 steps :
13- - name : Checkout Repo
22+ - name : Checkout
1423 uses : actions/checkout@v3
1524
16- - name : Set up Python
17- uses : actions/setup-python@v4
25+ - name : Setup Node.js
26+ uses : actions/setup-node@v3
1827 with :
19- python -version : ' 3.10 '
28+ node -version : ' 18 '
2029
2130 - name : Install dependencies
31+ run : npm install
32+ working-directory : ./bookvault-api
33+
34+ - name : Wait for MongoDB to be ready
2235 run : |
23- python -m pip install --upgrade pip
24- pip install -r requirements.txt
36+ for i in {1..10}; do
37+ nc -z localhost 27017 && echo "Mongo is up" && break
38+ echo "Waiting for Mongo..."
39+ sleep 5
40+ done
2541
2642 - name : Install Keploy
2743 run : |
28- curl -s https://keploy.io/install.sh | bash
44+ curl -L https://github.com/keploy/keploy/releases/latest/download/keploy-linux-amd64 -o keploy
45+ chmod +x keploy
46+ sudo mv keploy /usr/local/bin/keploy
2947
3048 - name : Run Keploy tests
3149 run : |
32- keploy test --delay 5
50+ keploy test -c "npm start" --delay 20 --url http://localhost:5000/api/books
51+ working-directory: ./bookvault-api
You can’t perform that action at this time.
0 commit comments