[WPB-22549] Add curl to integration test failure reports.#5048
[WPB-22549] Add curl to integration test failure reports.#5048
Conversation
62b06f2 to
870c8ee
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds curl command traces to integration test failure reports, making it easier to reproduce failing test scenarios. When a test fails, the full HTTP traffic is now shown in curl "pseudo-syntax" so developers can reproduce the exact API calls. This feature is opt-in via the WIRE_INTEGRATION_TEST_VERBOSITY=1 environment variable.
Changes:
- Adds a
curlTraceIORef [String]field toEnv, initialized fresh per-test inmkEnv - Records each HTTP request (and its response summary) in
curlTraceinsidesubmitinTestlib/HTTP.hs - Displays the curl trace in all three failure handlers (
AssertionFailure,AppFailure, genericSomeException) whenWIRE_INTEGRATION_TEST_VERBOSITY=1is set
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
integration/test/Testlib/Types.hs |
Adds curlTrace field to Env; adds/modifies requestToCurl and dataBinary helpers; adds DeriveGeneric pragma and imports |
integration/test/Testlib/HTTP.hs |
Modifies submit to record each request + response into curlTrace |
integration/test/Testlib/Env.hs |
Initializes curlTrace IORef in mkEnv |
integration/test/Testlib/Assertions.hs |
Adds renderCurlTrace and calls it in all failure detail printers; adds GHC.IORef and System.Posix.Env imports |
integration/test/Testlib/Run.hs |
Passes env to failure handler functions |
postgres-schema.sql |
Schema changes to meetings and conversation tables (appears unrelated to PR) |
cassandra-schema.cql |
Adds history_depth column (appears unrelated to PR) |
changelog.d/5-internal/WPB-22549-add-curl-to-integration-test-failure-reports |
Changelog entry for the new feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
battermann
left a comment
There was a problem hiding this comment.
Just one comment. Also there seem to be some valid comments from copilot.
integration/test/Testlib/HTTP.hs
Outdated
| status = HTTP.statusCode (HTTP.responseStatus response) | ||
| headers = HTTP.responseHeaders response | ||
| curl <- asks (.curlTrace) | ||
| _ <- liftIO $ modifyIORef' curl (<> [requestToCurl request, "# ==> " <> show (status, body, headers), ""]) |
There was a problem hiding this comment.
should we maybe guard for the WIRE_INTEGRATION_TEST_VERBOSITY flag here already before modifying the curlTrace. to safe some resource?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I get this now when I add some failing request with body |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
postgres-schema.sql:20
- The changes to
postgres-schema.sql(newrecurrence_frequencyENUM type,meetingstable schema updates with NOT NULL constraints and CHECK constraints, reordering of constraints,history_depth bigintcolumn added toconversation) andcassandra-schema.cql(history_depth bigintadded toconversation) do not appear to relate to the PR description "Add curl to integration test failure reports." These schema changes include updates that look like they were bundled together from a different branch or feature. It's worth verifying whether these schema changes are intentional and belong here.
-- Dumped from database version 17.7
-- Dumped by pg_dump version 17.7
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
example
upside: every test failure report comes with a script how to reproduce in curl.
downside: test failure reports make even more noise now.
TODO:
Checklist
changelog.d