Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add an Avro example #291

Merged
merged 3 commits into from Jul 18, 2023
Merged

feat: add an Avro example #291

merged 3 commits into from Jul 18, 2023

Conversation

mefellows
Copy link
Member

Build will fail until austek/pact-avro-plugin#19 is addressed.

@mefellows mefellows force-pushed the example/avro branch 2 times, most recently from 4d2cdeb to 35ef039 Compare June 1, 2023 07:06
@YOU54F
Copy link
Member

YOU54F commented Jul 11, 2023

PR is merged and released now so we should be able to retest this

@mefellows mefellows changed the base branch from 2.x.x to master July 11, 2023 22:29
@mefellows
Copy link
Member Author

Plugin seems to be crashing:

2023-07-11T23:49:10.3233015Z 2023-07-11T23:49:10.250451Z DEBUG   ffi-setup_contents Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x5: END_HEADERS | END_STREAM) }
2023-07-11T23:49:10.3233983Z 2023-07-11T23:49:10.250558Z ERROR ThreadId(01) pact_plugin_driver::content: Call to plugin failed - status: Unknown, message: "", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} }
2023-07-11T23:49:10.3235480Z 2023-07-11T23:49:10.250811Z ERROR ThreadId(01) pact_ffi::plugins: Failed to call out to plugin - Call to plugin failed - status: Unknown, message: "", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc"} }
2023-07-11T23:49:10.3236293Z 2023-07-11T23:49:10.251025Z DEBUG ThreadId(01) pact_mock_server::mock_server: Started mock server on 127.0.0.1:45241
2023-07-11T23:49:10.3237838Z 2023-07-11T23:49:10.253915Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || Exception in thread "grpc-default-executor-0" java.lang.UnsupportedClassVersionError: au/com/dius/pact/core/model/matchingrules/expressions/MatchingRuleDefinition has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
2023-07-11T23:49:10.3239302Z 2023-07-11T23:49:10.253929Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
2023-07-11T23:49:10.3240316Z 2023-07-11T23:49:10.253931Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
2023-07-11T23:49:10.3241393Z 2023-07-11T23:49:10.253933Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
2023-07-11T23:49:10.3242550Z 2023-07-11T23:49:10.253936Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
2023-07-11T23:49:10.3243819Z 2023-07-11T23:49:10.253938Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
2023-07-11T23:49:10.3245084Z 2023-07-11T23:49:10.253940Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
2023-07-11T23:49:10.3246267Z 2023-07-11T23:49:10.253941Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
2023-07-11T23:49:10.3247528Z 2023-07-11T23:49:10.253943Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
2023-07-11T23:49:10.3248565Z 2023-07-11T23:49:10.253945Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
2023-07-11T23:49:10.3249571Z 2023-07-11T23:49:10.253947Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.RuleParser$.parseRules(RuleParser.scala:20)
2023-07-11T23:49:10.3250576Z 2023-07-11T23:49:10.253949Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.RuleParser$.parseRules(RuleParser.scala:15)
2023-07-11T23:49:10.3251604Z 2023-07-11T23:49:10.253950Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.Avro$AvroValue$.apply(AvroRecord.scala:77)
2023-07-11T23:49:10.3252650Z 2023-07-11T23:49:10.253952Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.Avro$AvroRecord$.selectField(AvroRecord.scala:433)
2023-07-11T23:49:10.3253704Z 2023-07-11T23:49:10.253954Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.Avro$AvroRecord$.$anonfun$apply$18(AvroRecord.scala:407)
2023-07-11T23:49:10.3254696Z 2023-07-11T23:49:10.253956Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at scala.collection.immutable.List.map(List.scala:246)
2023-07-11T23:49:10.3396693Z 2023-07-11T23:49:10.253958Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at scala.collection.immutable.List.map(List.scala:79)
2023-07-11T23:49:10.3397764Z 2023-07-11T23:49:10.253960Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.Avro$AvroRecord$.apply(AvroRecord.scala:403)
2023-07-11T23:49:10.3398814Z 2023-07-11T23:49:10.253961Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.Avro$AvroRecord$.apply(AvroRecord.scala:399)
2023-07-11T23:49:10.3400247Z 2023-07-11T23:49:10.253963Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.interaction.InteractionBuilder$.buildResponse(InteractionBuilder.scala:48)
2023-07-11T23:49:10.3401546Z 2023-07-11T23:49:10.253967Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.interaction.InteractionBuilder$.build(InteractionBuilder.scala:34)
2023-07-11T23:49:10.3402885Z 2023-07-11T23:49:10.253969Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.interaction.InteractionResponseBuilder$.build(InteractionResponseBuilder.scala:17)
2023-07-11T23:49:10.3404241Z 2023-07-11T23:49:10.253971Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.PactAvroPluginService.$anonfun$configureInteraction$3(PactAvroPluginService.scala:56)
2023-07-11T23:49:10.3405321Z 2023-07-11T23:49:10.253973Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at scala.util.Either.flatMap(Either.scala:352)
2023-07-11T23:49:10.3406467Z 2023-07-11T23:49:10.253974Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.PactAvroPluginService.$anonfun$configureInteraction$2(PactAvroPluginService.scala:55)
2023-07-11T23:49:10.3407692Z 2023-07-11T23:49:10.253976Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at scala.util.Either.flatMap(Either.scala:352)
2023-07-11T23:49:10.3408835Z 2023-07-11T23:49:10.253978Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.PactAvroPluginService.$anonfun$configureInteraction$1(PactAvroPluginService.scala:54)
2023-07-11T23:49:10.3409898Z 2023-07-11T23:49:10.253980Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at scala.util.Either.flatMap(Either.scala:352)
2023-07-11T23:49:10.3411066Z 2023-07-11T23:49:10.253981Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at com.github.austek.plugin.avro.PactAvroPluginService.configureInteraction(PactAvroPluginService.scala:53)
2023-07-11T23:49:10.3412346Z 2023-07-11T23:49:10.253983Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.pact.plugin.pact_plugin.PactPluginGrpc$PactPlugin$.$anonfun$bindService$7(PactPluginGrpc.scala:188)
2023-07-11T23:49:10.3413518Z 2023-07-11T23:49:10.253985Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
2023-07-11T23:49:10.3414700Z 2023-07-11T23:49:10.253987Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:352)
2023-07-11T23:49:10.3415953Z 2023-07-11T23:49:10.253989Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:866)
2023-07-11T23:49:10.3417084Z 2023-07-11T23:49:10.253991Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
2023-07-11T23:49:10.3418123Z 2023-07-11T23:49:10.253992Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
2023-07-11T23:49:10.3419494Z 2023-07-11T23:49:10.253994Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2023-07-11T23:49:10.3420762Z 2023-07-11T23:49:10.253996Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2023-07-11T23:49:10.3421750Z 2023-07-11T23:49:10.253998Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || 	at java.base/java.lang.Thread.run(Thread.java:829)

@YOU54F
Copy link
Member

YOU54F commented Jul 12, 2023

au/com/dius/pact/core/model/matchingrules/expressions/MatchingRuleDefinition has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

hmm, do we need a later version of java installed on the runner?

@mefellows
Copy link
Member Author

2023-07-11T23:49:10.3237838Z 2023-07-11T23:49:10.253915Z DEBUG tokio-runtime-worker pact_plugin_driver::child_process: Plugin(avro, 12167, STDERR) || Exception in thread "grpc-default-executor-0" java.lang.UnsupportedClassVersionError: au/com/dius/pact/core/model/matchingrules/expressions/MatchingRuleDefinition has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Looks to be the issue here

@mefellows
Copy link
Member Author

I think it's an issue with the plugin, as the plugin itself packages up a JVM or lightweight bootstrapper.

@YOU54F
Copy link
Member

YOU54F commented Jul 12, 2023

oh nice, ty for raising 🙌🏾

@coveralls
Copy link

coveralls commented Jul 18, 2023

Coverage Status

coverage: 37.338%. remained the same when pulling cc8e0d9 on example/avro into b54ab72 on master.

@mefellows mefellows merged commit 6de0413 into master Jul 18, 2023
9 of 13 checks passed
@mefellows mefellows deleted the example/avro branch July 18, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants