pooja sharma
06/12/2022, 3:00 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
pooja sharma
06/12/2022, 5:44 PMC:\Users\<myUserName>\source\repos\PACT\pacts> docker run --rm pactfoundation/pact-cli:latest broker publish "ApiClient-EmployeeList.json" -b="https://<org_name>.<http://pactflow.io|pactflow.io>" -k="<tokenValue>" -a="1.0.0"
Specified pact file 'ApiClient-EmployeeList.json' does not exist. This sometimes indicates one of the arguments has been specified with the wrong name and has been incorrectly identified as a file path.
pooja sharma
06/12/2022, 5:45 PMpooja sharma
06/12/2022, 5:45 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
pooja sharma
06/12/2022, 10:35 PM> docker run --rm -v c:/Users/<MyUser>/source/repos/PACT/pacts:/var/lib/pacts pactfoundation/pact-cli:latest publish "/var/lib/pacts/ApiClient-EmployeeList.json" -b="https://<MyOrgName>.<http://pactflow.io|pactflow.io>" -k="<tokenValue>" -a="1.0.0"
pooja sharma
06/12/2022, 10:39 PMvar config = new PactVerifierConfig
{
LogLevel = PactLogLevel.Information,
Outputters = new List<IOutput>
{
new XUnitOutput(_output)
}
};
IPactVerifier verifier = new PactVerifier(config);
verifier.ServiceProvider("EmployeeList", new Uri("<http://localhost:5008>"))
.WithPactBrokerSource(new Uri("https://<MyOrg>.<http://pactflow.io|pactflow.io>"), options =>
{
options
.TokenAuthentication("<TokenValue>")
.ConsumerVersionSelectors(new ConsumerVersionSelector { MainBranch = true, Latest = true })
.PublishResults("1.0.0", results =>
{
results
.ProviderBranch("master")
.BuildUri(new Uri("https://<MyOrg>.<http://pactflow.io/pacts/provider/EmployeeList/consumer/ApiClient/latest%22|pactflow.io/pacts/provider/EmployeeList/consumer/ApiClient/latest">));
});
})
.WithProviderStateUrl(new Uri("<http://localhost:5008>"+ "/employees"))
.Verify();
pooja sharma
06/12/2022, 10:42 PMpooja sharma
06/12/2022, 10:49 PMPactNet.Exceptions.PactFailureException: Pact verification failed
PactNet.Exceptions.PactFailureException
Pact verification failed
at PactNet.Verifier.InteropVerifierProvider.Execute()
at PactNet.Verifier.PactVerifierSource.Verify()
at ContractTestV2.Tests.ProviderPactTests.VerifyLatestPacts() in C:\Users\<>\source\repos\ContractTest\ContractTestV2\Tests\ProviderPactTests.cs:line 34
Starting verification...
Pact verification failed
Verifier Output
---------------
Failures:
1) Failed to load pact - Could not load pacts from the pact broker 'https://<>.<http://pactflow.io/|pactflow.io/>' - ContentError("Request to pact broker URL 'https://<>.<http://pactflow.io/pacts/provider/EmployeeList/for-verification|pactflow.io/pacts/provider/EmployeeList/for-verification>' failed - HTTP status client error (400 Bad Request) for url (https://<>.<http://pactflow.io/pacts/provider/EmployeeList/for-verification|pactflow.io/pacts/provider/EmployeeList/for-verification>)")
There were 1 pact failures
Verifier Logs
-------------
[INFO][pact_verifier::pact_broker] Fetching path '/' from pact broker
[WARN][rustls::check] Received a ServerHelloDone handshake message while expecting [CertificateRequest]
[INFO][pact_verifier::pact_broker] Fetching path '/pacts/provider/EmployeeList/for-verification' from pact broker
[ERROR][pact_verifier] Failed to load pact - \x1b[31mCould not load pacts from the pact broker 'https://<>.<http://pactflow.io/|pactflow.io/>' - ContentError("Request to pact broker URL 'https://<>.<http://pactflow.io/pacts/provider/EmployeeList/for-verification|pactflow.io/pacts/provider/EmployeeList/for-verification>' failed - HTTP status client error (400 Bad Request) for url (https://<>.<http://pactflow.io/pacts/provider/EmployeeList/for-verification|pactflow.io/pacts/provider/EmployeeList/for-verification>)")\x1b[0m
[WARN][pact_matching::metrics]
Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.
pooja sharma
06/13/2022, 8:37 AMMatt (pactflow.io / pact-js / pact-go)
pooja sharma
06/13/2022, 10:37 AMMatt (pactflow.io / pact-js / pact-go)
pooja sharma
06/13/2022, 10:38 AMvar config = new PactVerifierConfig
{
LogLevel = PactLogLevel.Debug,
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
BuildUri
is meant to point to the URL of your build (e.g. Github or jenkins build) not the pact fileMatt (pactflow.io / pact-js / pact-go)
.ConsumerVersionSelectors(new ConsumerVersionSelector { MainBranch = true, Latest = true })
I could be wrong, but it doesn’t look like there are any pacts marked as the main branch, so perhaps it’s not finding any pacts (using your screenshot)pooja sharma
06/13/2022, 10:41 AMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
latest
is about the only option available to youMatt (pactflow.io / pact-js / pact-go)
Slackbot
06/13/2022, 10:43 AMpooja sharma
06/13/2022, 12:21 PMYousaf Nabi (pactflow.io)
pooja sharma
06/13/2022, 12:29 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
pooja sharma
06/13/2022, 12:34 PMYousaf Nabi (pactflow.io)
broker can-i-deploy
or pact-broker can-i-deploy
(to align the docker version with the ruby and standalone CLI)pooja sharma
06/13/2022, 12:36 PM