Skip to content

Commit 6d8047d

Browse files
Update keploy.yml
1 parent bf1d850 commit 6d8047d

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

.github/workflows/keploy.yml

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
1-
name: Run Keploy API Tests
1+
name: Keploy API Test
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
78

89
jobs:
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

0 commit comments

Comments
 (0)