Ran Abitbul
11/07/2023, 7:40 AM1.0.0
.
The provider has made some application changes and performed a record-deployment
with version 1.0.1
.
The consumer has also made some changes, pushed-pacts, and triggered a provider verification pipeline.
The provider verification pipeline has finished successfully, but no indication of verification results are present in the broker, unless I hard-code the previous provider version (1.0.0
- not latest) in the verification pipeline, that was used to verify the previous consumer version and retrigger the verification process - then the pact broker does receive the results.
When I set the log level to DEBUG, I am can see the pact broker client's logs only if I use version 1.0.0
! When I use 1.0.1
I don't see any pact broker client logs🤯
I am using pact-broker version 2.105.0
.
Other then record-deployment
, is there any other action I should be taking in order to update a provider's contract version?
ThanksCharlan Bettiol
11/07/2023, 1:00 PMCannot change the content of the pact for subscription version 1.0 and provider subscription, as race conditions will cause unreliable results for can-i-deploy. Each pact must be published with a unique consumer version number. Some Pact libraries generate random data when a concrete value for a type matcher is not specified, and this can cause the contract to mutate - ensure you have given example values for all type matchers. For more information see <https://docs.pact.io/go/versioning>
Swetha Namireddy
11/07/2023, 7:25 PMMunitheja Dasipalli
11/08/2023, 1:56 PMMunitheja Dasipalli
11/08/2023, 1:59 PM<plugin>
<groupId>au.com.dius.pact.provider</groupId>
<artifactId>maven</artifactId>
<version>4.5.2</version>
<configuration>
<serviceProviders>
<serviceProvider>
<name>Testprovider</name> <pactBrokerUrl><https://pactbroker.platform.dev.com/></pactBrokerUrl>
<protocol>https</protocol>
<port>443</port>
<host><http://services-dev.com|services-dev.com></host>
<consumers>
<consumer>
<name>Testconsumer</name> <pactUrl><https://pactbroker.platform.dev.com/pacts/provider/Testprovider/consumer/Testconsumer/latest></pactUrl>
</consumer>
</consumers>
</serviceProvider>
</serviceProviders>
<systemPropertyVariables>
<pact.verifier.publishResults>true</pact.verifier.publishResults>
<pact_do_not_track>true</pact_do_not_track> <pact.filter.consumers>Testconsumer</pact.filter.consumers>
</systemPropertyVariables>
</configuration>
Ruth
11/09/2023, 10:14 AM1) Verifying a pact between Consumer-Working and provider - consumer-test has a matching body
1.1) body: $.lastResponse Expected [2021,5,10,16,40,55] to match a datetime of 'yyyy-MM-dd'T'HH:mm:ss': Unable to parse the date: [2021,5,10,16,40,55]
I did try to reproduce a local closed source project, so maybe I forgot to copy something over? At least the LocalDateTime String method here looks very odd ([2021,5,10,16,40,55]
)
In my other error message with our service it shows up as 2021-05-10T16:40:55
Anybody an idea what I am missing? 🙂Vasile Vetisan
11/10/2023, 4:54 PMPavithra Krishnasamy
11/15/2023, 11:36 AMoswald.quek
11/16/2023, 12:32 PMConnectorQueueMessageContractTest
. When I run it I get
Verifying a pact between connector and adminusers
a service archived event
Verification Failed - No annotated methods were found for interaction 'a service archived event'. You need to provide a method annotated with @PactVerifyProvider("a service archived event") that returns the message contents.
But the @PactVerifyProvider
is clearly there! 😞 I know I'm not on the latest pact-jvm version but hopefully someone here will know what's happening.
I've followed the guide at https://github.com/pact-foundation/pact-jvm/tree/master/provider/junit#example-of-message-testOleksandr Yanov
11/20/2023, 9:02 AMhong lu
11/20/2023, 11:33 PMhong lu
11/20/2023, 11:38 PMhong lu
11/20/2023, 11:38 PMhong lu
11/20/2023, 11:40 PMhong lu
11/20/2023, 11:46 PMhong lu
11/20/2023, 11:47 PM2023-11-20 23:45:24,526 [HTTP-Dispatcher] ERROR BaseJdkMockServer$Companion - Failed to generate response
javax.mail.MessagingException: Missing start boundary
at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:1579) ~[mail-1.4.2.gr19.jar:1.4.2.gr19]
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:532) ~[mail-1.4.2.gr19.jar:1.4.2.gr19]
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:259) ~[mail-1.4.2.gr19.jar:1.4.2.gr19]
at au.com.dius.pact.core.matchers.MultipartMessageContentMatcher.compareParts(MultipartMessageContentMatcher.kt:50) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.core.matchers.MultipartMessageContentMatcher.matchBody(MultipartMessageContentMatcher.kt:35) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.core.matchers.Matching.matchBody(Matching.kt:243) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.core.matchers.RequestMatching$Companion.requestMismatches(RequestMatching.kt:137) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.core.matchers.RequestMatching$Companion.compareRequest(RequestMatching.kt:112) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.core.matchers.RequestMatching.matchInteraction(RequestMatching.kt:74) ~[matchers-4.6.3.jar:4.6.3]
at au.com.dius.pact.consumer.BaseMockServer.generatePactResponse(MockHttpServer.kt:200) ~[consumer-4.6.3.jar:4.6.3]
at au.com.dius.pact.consumer.BaseJdkMockServer.handle(MockHttpServer.kt:258) [consumer-4.6.3.jar:4.6.3]
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:95) [jdk.httpserver:?]
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82) [jdk.httpserver:?]
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98) [jdk.httpserver:?]
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:851) [jdk.httpserver:?]
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:95) [jdk.httpserver:?]
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:818) [jdk.httpserver:?]
at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:201) [jdk.httpserver:?]
at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:561) [jdk.httpserver:?]
at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:527) [jdk.httpserver:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
hong lu
11/21/2023, 6:57 AMSomya Khandelwal
11/21/2023, 8:42 AM1) createPactTopologyUplinkPort
1.1) Failed to invoke provider method 'verifyMessageForTopologyUplinkPort'
Srinivas Raghupatruni
11/21/2023, 8:43 AMSrinivas Raghupatruni
11/21/2023, 8:43 AMSrinivas Raghupatruni
11/21/2023, 8:44 AMJulie Røsok
11/24/2023, 11:29 AMMartin Gallauner
11/27/2023, 2:20 PMAllen Ayala
11/27/2023, 3:47 PMRan Abitbul
11/28/2023, 5:18 PMLukasz
11/29/2023, 6:54 AMMohammed Ezzedine
11/30/2023, 3:39 PMplugins {
java
id("org.springframework.boot") version "2.7.14"
id("io.spring.dependency-management") version "1.0.15.RELEASE"
id("au.com.dius.pact") version "4.6.3"
}
buildscript {
repositories {
maven {
url = uri("<https://plugins.gradle.org/m2/>")
}
}
dependencies {
classpath("au.com.dius.pact.provider:gradle:4.6.3")
}
}
pact {
serviceProviders {
myProvider {
fromPactBroker {
withSelectors {
branch("test")
}
}
}
}
}
However, it is failing to recognize the tokens myProvider
, fromPactBroker
, withSelectors
, and branch
, eventhough it is the exact example from the docs. Can you please help pointing out the issue?Ulises Cervino
11/30/2023, 5:22 PMmetadata
key in the map representing the request but that didn’t have any effect. If I don’t specify any headers, then the headers sent by the client don’t get recorded in the pact, and then this one can’t be verified. These are mostly for auth purposes, and I understand we should leave auth out of it, but I’m also curious: with grpc tests, is it possible to set/record headers in the pacts?Martin Gallauner
12/01/2023, 8:32 AM@Pacts
and @Test
for the client class but that appears a bit untidy by now.
Any second thoughts about having a class for each pact?Aniket Rane
12/01/2023, 8:03 PM<http://localhost:56992>
Exception in thread "Thread-2" java.lang.NoSuchMethodError: kotlin.io.ByteStreamsKt.readBytes(Ljava/io/InputStream;)[B
at au.com.dius.pact.consumer.BaseJdkMockServer.toPactRequest(MockHttpServer.kt:247)
at au.com.dius.pact.consumer.BaseJdkMockServer.handle(MockHttpServer.kt:214)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:822)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:794)
at sun.net.httpserver.ServerImpl$DefaultExecutor.execute(ServerImpl.java:199)
at sun.net.httpserver.ServerImpl$Dispatcher.handle(ServerImpl.java:544)
at sun.net.httpserver.ServerImpl$Dispatcher.run(ServerImpl.java:509)
at java.lang.Thread.run(Thread.java:750)
Disconnected from the target VM, address: '127.0.0.1:56982', transport: 'socket'
Upon googling I found this solution: https://github.com/pact-foundation/pact-jvm/issues/1102
Where @uglyog you suggested that we may need to include the correct version of Kotlin in the build classpath.
buildscript { //repositories & dependencies for the build script
ext {
springBootVersion = '2.1.1.RELEASE'
sparkplugVersion = "${springBootVersion}.1"
jacocoExcludedFiles = [
"**/model*",
"**/config*",
"**/exception*",
"com/{redacted}/Application*"
]
}
repositories {
maven { url "<http://artifacts>.{redacted}.com/artifactory/plugins-release" }
maven { url "<https://artifacts>.{redacted}.com/artifactory/remote-repos" }
maven { url "<http://artifacts>.{redacted}.com/artifactory/plugins-release-local" }
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "com.{redacted}:gradle-sparkplug-plugin:0.+"
classpath "com.{redacted}:gradle-servicetests-plugin:1.0.0"
classpath "com.{redacted}:gradle-codequality-plugin:1.1.+"
classpath 'au.com.dius:pact-jvm-consumer:4.0.10'
classpath 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.72'
classpath 'com.google.code.gson:gson:2.8.6'
}
....
plugins {
id "java"
id "groovy"
id "eclipse"
id "idea"
id "application"
id "jacoco"
id 'au.com.dius.pact' version '4.1.7'
}
....
dependencies {
....
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation 'com.github.tomakehurst:wiremock:2.27.2'
testImplementation 'au.com.dius.pact.consumer:java8:4.1.7'
testImplementation 'au.com.dius.pact.consumer:junit5:4.1.7'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
implementation 'org.apache.httpcomponents.client5:httpclient5-fluent:5.1.3'
}
I still get the above error. Am I doing it wrong?