Gerard van Engelen
07/14/2022, 4:22 AMstring version = Environment.GetEnvironmentVariable("VERSION");
string branch = Environment.GetEnvironmentVariable("BRANCH");
string buildUri = Environment.GetEnvironmentVariable("BUILD_URL");
verifier.ServiceProvider("My Provider", _fixture.ServerUri)
.WithPactBrokerSource(new Uri("<https://broker.example.org>"), options =>
{
options.ConsumerVersionSelectors(new ConsumerVersionSelector { MainBranch = true, Latest = true })
.PublishResults(version, results =>
{
results.ProviderBranch(branch)
.BuildUri(new Uri(buildUri));
});
.PublishResults(version, results => { results.ProviderBranch(branch);});
})
.Verify();
This was my latest error:
Failures:
1) Failed to load pact - Could not load pacts from the pact broker '<https://broker.pact.engineering.crxt.io/>' - ContentError("Request to pact broker URL '<https://broker.pact.engineering.crxt.io/pacts/provider/Vehicle%20Financing/for-verification>' failed - HTTP status server error (500 Internal Server Error) for url (<https://broker.pact.engineering.crxt.io/pacts/provider/Vehicle%20Financing/for-verification>)")
There were 1 pact failures
[91m[<http://xUnit.net|xUnit.net> 00:00:02.82] Financing.Api.ContractTests.FinanceOptionsContractTests.EnsureSomethingApiHonoursPactWithConsumer [FAIL][0m[91m
[0m Failed Financing.Api.ContractTests.FinanceOptionsContractTests.EnsureSomethingApiHonoursPactWithConsumer [1 s]
Error Message:
PactNet.Exceptions.PactFailureException : Pact verification failed
Stack Trace:
at PactNet.Verifier.InteropVerifierProvider.Execute()
at PactNet.Verifier.PactVerifierSource.Verify()
at Financing.Api.ContractTests.FinanceOptionsContractTests.EnsureSomethingApiHonoursPactWithConsumer() in /src/test/Financing.Api.ContractTests/FinanceContractTests.cs:line 43
Standard Output Messages:
Starting verification...
Pact verification failed
Timothy Jones
07/14/2022, 5:24 AMTimothy Jones
07/14/2022, 5:26 AMGerard van Engelen
07/14/2022, 6:36 AMimage:
pactImageRepository: pactfoundation/pact-broker
pactImageTag: 2.102.1.0
Gerard van Engelen
07/14/2022, 7:44 AMGanesh
07/14/2022, 9:35 AMoptions =>
{
options.ConsumerVersionSelectors(new ConsumerVersionSelector { MainBranch = true, Latest = true }
.EnablePending()
.ToeknAuthentication("<your pact broker authentication token>")
Gerard van Engelen
07/14/2022, 9:44 AMverifier.ServiceProvider("VehicleFinancingService", _fixture.ServerUri)
.WithPactBrokerSource(new Uri("<https://broker.pact.business.crxt.io>"), options =>
{
options.ConsumerVersionSelectors(new ConsumerVersionSelector { MainBranch = true, Latest = true })
.EnablePending()
.PublishResults(version, results =>
{
results.ProviderBranch(branch);
});
})
.Verify();
Ganesh
07/14/2022, 10:54 AMGerard van Engelen
07/14/2022, 11:00 AM, options =>...
part completely it works and verifies the contract but it doesn't publish the results.Ganesh
07/14/2022, 11:11 AMoptions =>...
part to tell to publish the results.
this is the code I have, and it works for me. I also have PactNet V 4.0.0
pactVerifier
.ServiceProvider("ProductService", new Uri(_pactServiceUri))
.WithPactBrokerSource(new Uri("<https://domain.pactflow.io>"), options =>
{
options.EnablePending()
.ConsumerVersionSelectors(new ConsumerVersionSelector { Latest=true })
.PublishResults("1.0.0", publish => publish.ProviderBranch("main"))
.TokenAuthentication("<<authtoken>>");
})
.WithProviderStateUrl(new Uri($"{_pactServiceUri}/provider-states"))
.WithRequestTimeout(TimeSpan.FromMinutes(5))
.WithSslVerificationDisabled()
.Verify()
Gerard van Engelen
07/14/2022, 11:27 AMTimothy Jones
07/14/2022, 12:52 PMGerard van Engelen
07/14/2022, 12:57 PMCandy Goodison
07/14/2022, 3:03 PMTimothy Jones
07/14/2022, 3:04 PMTimothy Jones
07/14/2022, 3:04 PMCandy Goodison
07/14/2022, 3:05 PMGerard van Engelen
07/14/2022, 5:07 PM