Skip to content

Commit 646d75f

Browse files
authored
Postman collection (#7)
* Redis-based session management * Postman collection * postman e2e test suite
1 parent d83015a commit 646d75f

File tree

3 files changed

+413
-1
lines changed

3 files changed

+413
-1
lines changed

.github/workflows/postman-e2e.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Postman E2E
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
postman-e2e:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 20
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20"
19+
20+
- name: Install Newman
21+
run: npm install -g newman
22+
23+
- name: Start services
24+
run: docker compose up -d --build
25+
26+
- name: Wait for backend
27+
run: |
28+
for i in {1..30}; do
29+
if curl -fsS http://localhost:8080/api/tags >/dev/null; then
30+
exit 0
31+
fi
32+
sleep 2
33+
done
34+
echo "Backend did not become ready in time" >&2
35+
docker compose ps
36+
exit 1
37+
38+
- name: Run Postman collection
39+
run: |
40+
ATTACHMENT_FILE="/tmp/postman-attachment.txt"
41+
echo "postman attachment" > "$ATTACHMENT_FILE"
42+
UNIQUE_SUFFIX="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
43+
newman run backend/docs/postman_collection.json \
44+
--env-var baseUrl=http://localhost:8080 \
45+
--env-var username=postman-$UNIQUE_SUFFIX \
46+
--env-var email=postman+$UNIQUE_SUFFIX@example.com \
47+
--env-var password=password123 \
48+
--env-var attachment_file=$ATTACHMENT_FILE
49+
50+
- name: Backend logs (on failure)
51+
if: failure()
52+
run: docker compose logs --no-color
53+
54+
- name: Shutdown
55+
if: always()
56+
run: docker compose down -v

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: tests
1+
name: Backend Unit Tests
22

33
on:
44
push:

0 commit comments

Comments
 (0)