surpher / surpher/PactSwift

Surface interaction mismatches to the test running the validation

Open
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted v2.x.x
Dominant language
Swift
Stars
56
Forks
21
PR merge metrics
No merged PRs in 30d

Description

🗣 Context

When setting up a Pact test and running it, lots of times the expected request does not match the request being triggered. When that happens, an informative message at the failing test should be surfaced up to the failing test.
At the moment it only fails with Server error 500 and debug area shows the expected and actual request which is difficult to filter through.

💬 Narrative

When a request does not match the expectation
I want the context and reason for failing to be surfaced to the
So that it's easier for developer to understand why the test failed

📝 Notes

Branch off of https://github.com/surpher/PactSwift/tree/feat/v2.0.0

As a guide surpher/PactSwift v1.x surfaces the issue like so:

Screenshot 2023-05-11 at 12 31 26 pm

✅ Acceptance Criteria

GIVEN a triggered request does not match the expected request defined in builder
WHEN PactSwift throws an error from libpact_ffi
THEN the line in the test is highlighted with XCTestFail and contains:

  • Reason for failure (eg: "Actual request does not match expected interaction")
  • Expected request (eg: POST /v1/endpointName)
  • Actual request (eg: POST /v1/endpointNmae)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Branch from the referenced PactSwift v2.0.0 branch and trace how request mismatches from libpact_ffi reach the test using builder. Start with the existing error path and the XCTest integration; the change is done when XCTestFail highlights the test and includes the failure reason, expected request, and actual request.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.