File tree 3 files changed +64
-3
lines changed
3 files changed +64
-3
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ jobs:
21
21
- name : Build and test
22
22
run : |
23
23
docker compose version
24
+ # Ensure tests directory exists and is copied to the right place
25
+ mkdir -p docker/backend/tests
26
+ cp tests/test_api.py docker/backend/tests/
24
27
docker compose -f docker-compose.dev.yml build
25
28
docker compose -f docker-compose.dev.yml up -d
26
29
docker compose -f docker-compose.dev.yml exec -T reproschema-server pip install pytest pytest-asyncio pytest-cov
27
- docker compose -f docker-compose.dev.yml exec -T reproschema-server python -m pytest tests/
30
+ docker compose -f docker-compose.dev.yml exec -T reproschema-server python -m pytest /app/ tests/
28
31
docker compose -f docker-compose.dev.yml down
29
32
env :
30
33
# Core settings
Original file line number Diff line number Diff line change 1
- version : ' 3.8'
2
1
services :
3
2
reproschema-server :
4
3
container_name : ${CONTAINER_NAME:-reproschema-server}
@@ -19,7 +18,7 @@ services:
19
18
- ${DATA_PATH:-./data}:/data:rw
20
19
# Development volumes
21
20
- ./docker/backend:/app # For live backend changes
22
- - ./tests:/app/tests:ro # Mount from project root, read-only
21
+ - ./docker/backend/ tests:/app/tests:ro # Mount from backend directory
23
22
environment :
24
23
# Core settings
25
24
- NODE_ENV=${NODE_ENV:-development} # Default to development
Original file line number Diff line number Diff line change
1
+ # API Testing Guide
2
+
3
+ ## Overview
4
+ This guide explains how to test the ReproSchema backend API endpoints manually.
5
+
6
+ ## Prerequisites
7
+ - ` curl ` command-line tool
8
+ - Running ReproSchema server (via ` docker compose up ` )
9
+ - Initial token (found in backend logs)
10
+
11
+ ## Getting Started
12
+
13
+ 1 . First, check the backend logs to get the initial token:
14
+
15
+
16
+ 2 . Get an auth token using the initial token:
17
+
18
+
19
+
20
+ 3 . Use the auth token to submit data:
21
+
22
+
23
+ ## API Endpoints
24
+
25
+ ### Health Check
26
+
27
+
28
+ ### Get Auth Token
29
+
30
+ Parameters:
31
+ - ` token ` : Initial token from backend logs
32
+ - ` project ` : Project name (default: "study")
33
+ - ` expiry_minutes ` : Token expiry in minutes (default: 90)
34
+
35
+ ### Submit Data
36
+
37
+ Headers:
38
+ - ` Authorization ` : Auth token from ` /api/token ` endpoint
39
+ - ` Content-Type ` : Must be ` application/json `
40
+
41
+ ### Get Schema
42
+
43
+
44
+ ## Data Storage
45
+ Submitted responses are stored in:
46
+
47
+
48
+ ## Common Issues
49
+ 1 . "Invalid token" error:
50
+ - Make sure you're using the correct initial token from logs
51
+ - Initial tokens are regenerated on container restart
52
+
53
+ 2 . "Invalid auth token" error:
54
+ - Auth tokens expire after 90 minutes
55
+ - Get a new auth token using the initial token
56
+ - Don't include "Bearer " prefix in Authorization header
57
+
58
+ ## Development Testing
59
+ For development mode features:
You can’t perform that action at this time.
0 commit comments