graphql-java-generator / graphql-maven-plugin-project

graphql-maven-plugin is a Maven Plugin for GraphQL, based on graphql-java. It accelerates the development for both the client and the server, by generating the Java code. It allows a quicker development when in contract-first approach, by avoiding to code the boilerplate code.
https://graphql-maven-plugin-project.graphql-java-generator.com
MIT License
115 stars 47 forks source link

Cannot build project #180

Closed rparaujo closed 1 year ago

rparaujo commented 1 year ago

Env 1:

Env 2:

On both envs I get the same error when building with: mvn clean install

[INFO]   .   ____          _            __ _ _
[INFO]
[INFO]  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
[INFO] ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[INFO]  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
[INFO]   '  |____| .__|_| |_|_| |_\__, | / / / /
[INFO]  =========|_|==============|___/=/_/_/_/
[INFO]  :: Spring Boot ::                (v2.7.6)
[INFO]
[INFO]
[INFO] Started process: Forum GraphQL server
[INFO]
[INFO] --- failsafe:2.22.2:integration-test (default) @ graphql-maven-plugin-samples-Forum-client ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.graphql_java_generator.samples.forum.client.IntrospectionIT
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.725 s - in com.graphql_java_generator.samples.forum.client.IntrospectionIT
[INFO] Running com.graphql_java_generator.samples.forum.client.DirectQueriesWithFieldInputParametersIT
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.193 s - in com.graphql_java_generator.samples.forum.client.DirectQueriesWithFieldInputParametersIT
[INFO] Running com.graphql_java_generator.samples.forum.client.subscription.SubscriptionIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.706 s - in com.graphql_java_generator.samples.forum.client.subscription.SubscriptionIT
[INFO] Running com.graphql_java_generator.samples.forum.client.subscription.SubscriptionNewTestIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.282 s - in com.graphql_java_generator.samples.forum.client.subscription.SubscriptionNewTestIT
[INFO] Running com.graphql_java_generator.samples.forum.client.PreparedQueriesWithFieldInputParametersIT
[INFO] Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.15 s - in com.graphql_java_generator.samples.forum.client.PreparedQueriesWithFieldInputParametersIT
[INFO] Running com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequestsDeprecatedIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.365 s - in com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequestsDeprecatedIT
[INFO] Running com.graphql_java_generator.samples.forum.client.graphql.PartialDirectRequestsIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.308 s - in com.graphql_java_generator.samples.forum.client.graphql.PartialDirectRequestsIT
[INFO] Running com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequestsIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.247 s - in com.graphql_java_generator.samples.forum.client.graphql.PartialPreparedRequestsIT
[INFO] Running com.graphql_java_generator.samples.forum.client.graphql.GraphQLRepositoryPartialRequestsNonSpringIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.25 s - in com.graphql_java_generator.samples.forum.client.graphql.GraphQLRepositoryPartialRequestsNonSpringIT
[INFO] Running com.graphql_java_generator.samples.forum.client.graphql.GraphQLRepositoryPartialRequestsSpringIT
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.257 s - in com.graphql_java_generator.samples.forum.client.graphql.GraphQLRepositoryPartialRequestsSpringIT
[INFO] Running com.graphql_java_generator.samples.forum.client.FullRequestIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.03 s - in com.graphql_java_generator.samples.forum.client.FullRequestIT
[INFO] Running com.graphql_java_generator.samples.forum.client.BatchLoaderIT
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 s - in com.graphql_java_generator.samples.forum.client.BatchLoaderIT
[INFO] Running com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT
[ERROR] Tests run: 4, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 0.392 s <<< FAILURE! - in com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT
[ERROR] test_GlobalFragments_WithOldPosts  Time elapsed: 0.196 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <10> but was: <15>
    at com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT.test_GlobalFragments_WithOldPosts(FullRequestWithFragmentIT.java:83)

[ERROR] test_InlineFragments_NoRecentPost  Time elapsed: 0.038 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <10> but was: <15>
    at com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT.test_InlineFragments_NoRecentPost(FullRequestWithFragmentIT.java:96)

[ERROR] test_InlineFragments_WithOldPosts  Time elapsed: 0.12 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <10> but was: <15>
    at com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT.test_InlineFragments_WithOldPosts(FullRequestWithFragmentIT.java:109)

[ERROR] test_GlobalFragments_NoRecentPost  Time elapsed: 0.037 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <10> but was: <15>
    at com.graphql_java_generator.samples.forum.client.FullRequestWithFragmentIT.test_GlobalFragments_NoRecentPost(FullRequestWithFragmentIT.java:70)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   FullRequestWithFragmentIT.test_GlobalFragments_NoRecentPost:70 expected: <10> but was: <15>
[ERROR]   FullRequestWithFragmentIT.test_GlobalFragments_WithOldPosts:83 expected: <10> but was: <15>
[ERROR]   FullRequestWithFragmentIT.test_InlineFragments_NoRecentPost:96 expected: <10> but was: <15>
[ERROR]   FullRequestWithFragmentIT.test_InlineFragments_WithOldPosts:109 expected: <10> but was: <15>
[INFO]
[ERROR] Tests run: 63, Failures: 4, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- process-exec:0.9:stop-all (stop-all) @ graphql-maven-plugin-samples-Forum-client ---
[INFO] Stopping all processes ...
[INFO] Stopping process: Forum GraphQL server
[INFO] Stopped process: Forum GraphQL server
[INFO]
[INFO] --- failsafe:2.22.2:verify (default) @ graphql-maven-plugin-samples-Forum-client ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for com.graphql-java-generator:graphql-maven-plugin-project local-SNAPSHOT:
[INFO]
[INFO] com.graphql-java-generator:graphql-maven-plugin-project SUCCESS [  0.257 s]
[INFO] graphql-java-client-dependencies ................... SUCCESS [  0.008 s]
[INFO] graphql-java-spring-mvc ............................ SUCCESS [  3.202 s]
[INFO] graphql-java-server-dependencies ................... SUCCESS [  0.013 s]
[INFO] graphql-java-common-runtime ........................ SUCCESS [  0.855 s]
[INFO] graphql-java-client-runtime ........................ SUCCESS [  8.301 s]
[INFO] graphql-java-server-runtime ........................ SUCCESS [  0.281 s]
[INFO] graphql-maven-plugin-logic ......................... SUCCESS [ 58.989 s]
[INFO] graphql-maven-plugin ............................... SUCCESS [  4.650 s]
[INFO] graphql-maven-plugin-samples ....................... SUCCESS [  0.006 s]
[INFO] graphql-maven-plugin-samples-allGraphQLCases-server  SUCCESS [  4.745 s]
[INFO] graphql-maven-plugin-samples-OAuth-authorization-server SUCCESS [  0.507 s]
[INFO] graphql-maven-plugin-samples-Forum-server .......... SUCCESS [  1.179 s]
[INFO] graphql-maven-plugin-samples-allGraphQLCases-client  SUCCESS [ 44.838 s]
[INFO] graphql-maven-plugin-samples-Forum-client .......... FAILURE [ 18.078 s]
[INFO] graphql-maven-plugin-samples-allGraphQLCases-pojo-client-jackson SKIPPED
[INFO] graphql-maven-plugin-samples-allGraphQLCases-pojo-server SKIPPED
[INFO] graphql-maven-plugin-samples-allGraphQLCases-pojo-client SKIPPED
[INFO] graphql-maven-plugin-samples-StarWars-server ....... SKIPPED
[INFO] graphql-maven-plugin-samples-StarWars-client ....... SKIPPED
[INFO] graphql-maven-plugin-samples-CustomTemplates-resttemplate SKIPPED
[INFO] graphql-maven-plugin-samples-CustomTemplates-client  SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:26 min
[INFO] Finished at: 2023-03-03T12:00:10Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.22.2:verify (default) on project graphql-maven-plugin-samples-Forum-client: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/raraujo/git/graphql-maven-plugin-project/graphql-maven-plugin-samples/graphql-maven-plugin-samples-Forum-client/target/failsafe-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :graphql-maven-plugin-samples-Forum-client

Do you have any idea why?

etienne-sf commented 1 year ago

The build is ok (again) on my side. There an issue for the tests (of the forum client) that failed here: there result depend on the execution order of the tests. They count the number of posts in the server base, where other test creates posts.

But the JUnit promise is that the tests are always executed in the same order.

I see two possible errors here : 1) This promise is not respected in your case. But you first configuration is quite the same as mine, I think this is not the case. 2) You have a forum server (from the same project), that is already started "somewhere else" on your computer. In this case, after each execution of the IT tests, the number of posts rises.

Etienne

etienne-sf commented 1 year ago

I'll check that, and make the test be more robust on the execution order.

etienne-sf commented 1 year ago

It should be ok now