question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maven plugin test-update goal is not working

See original GitHub issue

Testing running a non-compatible schema with “test-update” does not fail the maven build.

It seems nothing special is done when the result map is populated with failed entries: https://github.com/Apicurio/apicurio-registry/blob/master/utils/maven-plugin/src/main/java/io/apicurio/registry/maven/TestUpdateRegistryMojo.java#L65

Tested schemas was uploading this: https://github.com/confluentinc/examples/blob/6.1.0-post/clients/avro/src/main/resources/avro/io/confluent/examples/clients/basicavro/Payment2a.avsc

Where this was the existing schema: https://github.com/confluentinc/examples/blob/6.1.0-post/clients/avro/src/main/resources/avro/io/confluent/examples/clients/basicavro/Payment.avsc

Only on non “bad requests” (errors) does it fail the build: https://github.com/Apicurio/apicurio-registry/blob/master/utils/maven-plugin/src/main/java/io/apicurio/registry/maven/TestUpdateRegistryMojo.java#L83

Probably there needs to be some check for the invalid entries:

List<Map.Entry<String, Boolean>> invalidArtifacts =
        results.entrySet().stream().filter(e -> Boolean.FALSE.equals(e.getValue()))
            .collect(Collectors.toList());

if(!invalidArtifacts.isEmpty()) { throw ...}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
blofrothcommented, Feb 27, 2021

I can probably take a stab at it.

I tried to replicate locally with latest master, but couldn’t. So somethings going on, hopefully it was not a silly mistake on my part with my first test. I will try to replicate that scenario again and post more details.

I also experienced another issue with Confluent Json Schema serializers. Hopefully I can contribute a replicating test case for that and file another ticket.

0reactions
EricWittmanncommented, Mar 29, 2021

Marking this as fixed in 2.0 (we think it is). If this is still a problem, please re-open this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute goal org.apache.maven.plugins:maven ...
I tried the following but did not help: mvn dependency::tree; mvn clean install -U or Right-click on "project" Go to "Maven" >> "Update"....
Read more >
Managing Apicurio Registry content using the Maven plug-in
Specify test-update as the execution goal to test the schema artifact. Specify the Apicurio Registry URL with the ../apis/registry/v2 endpoint. If ...
Read more >
Guide to Configuring Plug-ins - Apache Maven
Most Maven plugins have a help goal that prints a description of the plugin and its parameters and types. For instance, to see...
Read more >
Maven Getting Started Guide
This guide is intended as a reference for those working with Maven for the first ... For example org.apache.maven.plugins is the designated groupId...
Read more >
Apache Maven Dependency Plugin – Unpacking specific ...
<goal>unpack</goal>; </goals>; <configuration>; <artifactItems> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found