test(T-05): add server health BDD test with TestClient fixture#62
test(T-05): add server health BDD test with TestClient fixture#62raschmitt wants to merge 3 commits into
Conversation
Add server_health.feature with a root-route-responds scenario and its pytest-bdd step definitions. Remove static-file exclusion from SonarCloud config so coverage now includes app/static/. Co-authored-by: big-pickle <big-pickle@users.noreply.github.com>
|
🤖 This PR was automatically generated by the auto-implement workflow using OpenCode CLI with the big-pickle model. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
💡 AI Code ReviewHere are some automated review suggestions for this pull request. Reviewed commit: ℹ️ About this reviewThis review was generated automatically by the AI Code Review workflow using OpenCode CLI with the Minimax M2.5 Free model. Reviews are triggered on every pull request push. |
| def app_is_running(client: TestClient): | ||
| return client.get("/") | ||
|
|
||
|
|
There was a problem hiding this comment.
@given("the application is running") and @when('a GET request is made to "/"') both execute client.get("/"). This means the scenario performs the GET request twice. For a health check scenario, the intent is typically to make a single request and then verify it. One of these steps is either dead code or indicates the scenario design needs clarification.
| scenarios("../features/server_health.feature") | ||
|
|
||
|
|
||
| @given("the application is running", target_fixture="response") |
There was a problem hiding this comment.
Redundant fixture step (already flagged in prior review — P2)
Both @given("the application is running") and @when('a GET request is made to "/"') call client.get("/") and return the same response. Since TestClient has no state changes between steps and both target the same fixture response, the second step definition is redundant. One option is to have the @given store the client on a session-scoped fixture and have @when reuse that same response fixture rather than making a second identical request.
|



Task/Issue
T-05 · Test suite setup
What?
Why?