You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/development/backend/setup.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,4 +34,30 @@ However, running a server is useful if you
34
34
35
35
Running the server is simplified in the dev container by predefined tasks. You can run these tasks from the command palette (Ctrl+Shift+P or Cmd+Shift+P) by selecting "Tasks: Run Task" and then choosing one of the following:
36
36
- "Serve Web API" - starts the Flask development server on port 5555 with debug logging enabled
37
-
- "Start Celery worker" - starts a Celery worker to process background tasks.
37
+
- "Start Celery worker" - starts a Celery worker to process background tasks.
38
+
39
+
40
+
## Debugging
41
+
42
+
Debugging can sometimes be challenging, especially when trying to trace complex behavior or identify subtle issues. To make this easier, you can debug both a running API instance and individual test cases directly within Visual Studio Code.
43
+
44
+
### Debugging the Gramps Web API
45
+
46
+
To debug the running API:
47
+
48
+
1. Open Visual Studio Code and go to the **Run and Debug** view.
49
+
2. Select the **"Web API"** configuration from the dropdown menu.
50
+
3. Start debugging.
51
+
4. When you send requests to the backend (either manually or through the Gramps Web GUI), the execution will pause at any breakpoints you have set in the code.
52
+
This allows you to inspect variables, control flow, and other runtime details.
53
+
54
+
### Debugging Test Cases
55
+
56
+
To debug a specific test case:
57
+
58
+
1. Open the test file you want to debug (for example, `test_people.py`).
59
+
2. In Visual Studio Code, open the **Run and Debug** view.
60
+
3. Choose the **"Current Test File"** configuration.
61
+
4. Start debugging — execution will stop at any breakpoints set within that test file.
62
+
63
+
This setup allows you to step through test logic, examine variable values, and better understand test failures or unexpected results.
0 commit comments