Comments (14)
@surpher it's definitely an error on my end 😅 . I will spend more time today trying to resolve it. The problem is my Xcode will not remove the package 😩. Searched around and this seems to be a problem others have had as well. Hoping to resolve this by eod. Thanks again for all your help. Will let you know.
from pactswift.
I can merge it into main
and not make a release. It's not a big or breaking change.
from pactswift.
Dug deeper into this and it looks like the interface PactSwiftMockServer
uses for this is deprecated and does not support this argument.
I'll have to refactor how PactSwiftMockServer
interfaces with pactffi written in rust first. It should be using handle based methods. It might take some more time to do though.
Update:
I've had a chat with pactffi maintainers that handle the core implementation written in rust and they'll try to get this argument in without needing me to refactor heaps of PactSwiftMockServer
. This should help you pass your headers into your verification and buy me some time to do the refactoring moving off deprecated interfaces.
Unfortunately I'm only working on PactSwift in my spare time.
from pactswift.
@kelliepersson, have a go at this by setting the branch as your source for PactSwift
dependency:
.package(
url: "https://github.com/surpher/PactSwift.git",
branch: "feature/provider_verification_headers_option"
)
If it works as expected I'll merge the PR (#96) and create a new release.
from pactswift.
@surpher Thanks so much for jumping on this so quickly!!! I am testing now. Will let you know asap.
from pactswift.
@surpher I am not able to get the branch to resolve the dependency,
pactswift is required using two different revision-based requirements (feature/provider_verification_headers_option and main), which is not supported
Xcode [Version 13.4.1 (13F100)
] will not drop PactSwift
on main
branch.
from pactswift.
I'm not exactly clear how and what exactly you've updated in your project setup to be presented with that error. Sounds like a setup issue.
Editing the repository for PactSwift
package and setting a branch in Xcode should work:
Perhaps remove the package first before adding it with the reference to the branch?
from pactswift.
@surpher Package resolution is still failing for me. Seems PackMockServer
has a dependency on main branch as well.
from pactswift.
What sort of a project are you working on? Does it by any chance have Package.swift files but Xcode is trying to set a new separate one and there is a conflict?
All transient Pact dependencies remained set to version number.
from pactswift.
Thank you @surpher. I was originally trying to test this against a work project. We have Package.swift files. So instead, I just created a simple project and pointed to your branch. I was able to pass in the new customHeaders dictionary.
Finally able to get my test to run 😄, but ended up failing w/
failed - Provider Verification Error: Invalid arguments were provided to the verification process.
from pactswift.
@surpher this is awesome! I am glad that this surfaced this issue. I appreciate your work on this and am looking forward to the changes. For someone working in their spare time, you are on it & responsive!!! Thank you so much!
from pactswift.
@surpher wanted to check back in. Has there been any progress from pactffi maintainers, PactSwiftMockServer
refactoring? Thanks so much.
from pactswift.
There's some progress refactoring Verifier
using a handle instead of one off trigger on branch feature/provider-verification-upgrade
. It has not been tested yet! Literally only created the interface but stopped at creating a test project trying to use it.
Saying that I would very much welcome any feedback on this WIP. Feel free to use what is there.
You should be able to set up provider verification by chaining the commands found on ProviderVerifier
object.
Something like the following pseudo code:
func testPactVerification() {
let verifierHandle = ProviderVerifier(name: "provider", version: "1.0.0")!
let verificationResult = verifierHandle
.setCustomHeaders(["Authorization": "Bearer somethingSomething"])
.setVerificationOptions(disableSSL: true, timeout: 2)
.setProviderInfo(name: "provider", url: URL(string: "http://localhost:8080")!)
.verifyPactsAt(source: .file("/tmp/pacts/consumerName-providerName.json"))
.verify()
XCTAssertEqual(verificationResult, .success(true))
}
I'm working with the maintainers of the core Pact FFI and we've identified a few things that will need to be resolved as well, particularly when setting provider state setProviderState(url:teardown:body:)
which doesn't make much sense in pact_ffi
either.
from pactswift.
@kelliepersson pact_ffi and PactSwiftMockServer
has finally been updated to support custom headers for non-handle implementation. Can you give it another whirl using the branch feature/provider_verification_headers_option
?
from pactswift.
Related Issues (20)
- Support Cocoapods along side Carthage and SPM HOT 1
- Question: Is it possible to use generators in requests? HOT 4
- Question: Rest vs GraphQL services HOT 3
- Reporting a vulnerability
- Question: What about Pact Specification v4? HOT 2
- Question: arrayContaining Matcher and the dynamic JSON keys. HOT 7
- Surface interaction mismatches to the test running the validation
- Support matchers and example generators in requests
- Task: Clean up tests and Linux specific code HOT 1
- Task: Unit tests for swift concurrency refactor HOT 4
- Task: Proof of concept using Pact plugins
- Task: Find a way to reduce PactSwiftMockServer repo size HOT 1
- Create new release with concurrency support HOT 3
- Allow to merge with existing pact file HOT 2
- Question: Create PACT for JSON body that contains only a string HOT 4
- Unable to run real device -- Pactconsumer HOT 1
- Unable to run real device — Pactswift HOT 2
- PactSwift how to build on CI HOT 3
- Rules defined on the mock services aren't all written to the generated pact contract. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pactswift.