galexandre / sonar-cobertura

Cobertura plugin for SonarQube
GNU General Public License v3.0
30 stars 26 forks source link

Compatibility with SQ 6.4 #17

Closed gliptak closed 6 years ago

gliptak commented 6 years ago

The integration tests fail (possibly unrelated to the version bump)

With SQ 6.4 https://travis-ci.org/galexandre/sonar-cobertura/jobs/330878281

2018.01.19 15:58:03 ERROR web[][o.s.s.p.Platform] Web server startup failed: Plugin SonarJava [java] requires at least SonarQube 6.7

With SQ 6.7 https://travis-ci.org/galexandre/sonar-cobertura/jobs/330880862

2018.01.19 16:06:36 INFO  app[][o.s.a.SchedulerImpl] SonarQube is up
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 324.363 sec <<< FAILURE! - in com.sonar.cobertura.it.CoberturaTest
com.sonar.cobertura.it.CoberturaTest  Time elapsed: 324.362 sec  <<< ERROR!
java.lang.IllegalStateException: Can't start sonar in timely fashion
    at com.sonar.orchestrator.container.ServerWatcher.waitForStartup(ServerWatcher.java:104)
    at com.sonar.orchestrator.container.ServerWatcher.execute(ServerWatcher.java:80)
    at com.sonar.orchestrator.container.ServerWrapper.start(ServerWrapper.java:93)
    at com.sonar.orchestrator.Orchestrator.start(Orchestrator.java:117)
    at com.sonar.orchestrator.Orchestrator.beforeAll(Orchestrator.java:77)
    at com.sonar.orchestrator.junit.SingleStartExternalResource.before(SingleStartExternalResource.java:47)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
2018.01.19 16:11:11 INFO  app[][o.s.a.SchedulerImpl] Stopping SonarQube
gliptak commented 6 years ago

@galexandre Please review. Thanks

galexandre commented 6 years ago

@gliptak: I'm going to review it. Thanks for the contribution.

galexandre commented 6 years ago

Related to the it test. Can you try to update the sonar-orchestrator in this pom: https://github.com/galexandre/sonar-cobertura/blob/master/its/plugin/pom.xml to the version 3.15.2.1322 please?

gliptak commented 6 years ago

its still fails with https://travis-ci.org/galexandre/sonar-cobertura/jobs/332082725

> 2018.01.23 00:41:11 ERROR web[][o.s.s.p.Platform] Web server startup failed: Plugin SonarJava [java] requires at least SonarQube 6.7

Is there a way to point to an earlier version of sonar-java as a dependency?

galexandre commented 6 years ago

The only way, I guess, is to change in the main pom.xml. All the version of the plugins are available here: https://mvnrepository.com/artifact/org.sonarsource.java/sonar-java-plugin

gliptak commented 6 years ago

@galexandre https://travis-ci.org/galexandre/sonar-cobertura/jobs/332438237

Sonar came up but its doesn't see it?

2018.01.23 18:50:11 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.01.23 18:50:11 INFO  app[][o.s.a.SchedulerImpl] SonarQube is up
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 323.632 sec <<< FAILURE! - in com.sonar.cobertura.it.CoberturaTest
com.sonar.cobertura.it.CoberturaTest  Time elapsed: 323.631 sec  <<< ERROR!
java.lang.IllegalStateException: Can't start sonar in timely fashion
    at com.sonar.orchestrator.container.ServerWatcher.waitForStartup(ServerWatcher.java:104)
    at com.sonar.orchestrator.container.ServerWatcher.execute(ServerWatcher.java:80)
    at com.sonar.orchestrator.container.ServerWrapper.start(ServerWrapper.java:93)
    at com.sonar.orchestrator.Orchestrator.start(Orchestrator.java:117)
    at com.sonar.orchestrator.Orchestrator.beforeAll(Orchestrator.java:77)
    at com.sonar.orchestrator.junit.SingleStartExternalResource.before(SingleStartExternalResource.java:47)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Results :
Tests in error: 
  CoberturaTest.com.sonar.cobertura.it.CoberturaTest » IllegalState Can't start ...

https://docs.sonarqube.org/display/PLUG/SonarJava

gliptak commented 6 years ago

Now I see a test fail at https://travis-ci.org/galexandre/sonar-cobertura/jobs/332448384#L1329

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 125.67 sec <<< FAILURE! - in com.sonar.cobertura.it.CoberturaTest
shouldReuseCoberturaAndSurefireReports(com.sonar.cobertura.it.CoberturaTest)  Time elapsed: 55.322 sec  <<< ERROR!
java.lang.NullPointerException: null
    at com.sonar.cobertura.it.CoberturaTest.shouldReuseCoberturaAndSurefireReports(CoberturaTest.java:63)
Results :
Tests in error: 
  CoberturaTest.shouldReuseCoberturaAndSurefireReports:63 NullPointer
galexandre commented 6 years ago

Okay, at least now we know what is failing.

galexandre commented 6 years ago

This is the line failing:assertThat(project.getMeasureIntValue("tests")).isEqualTo(2);. it looks like this object: Resource project = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics("com.sonarsource.it.samples:cobertura-example", "test_success_density", "test_failures", "test_errors", "tests", "skipped_tests", "test_execution_time", "coverage")); is null. So there is a problem with the orchestrator.

gliptak commented 6 years ago

I walked sonar-orchestrator to 3.13 and all failed with NullPointerException. What do you see as the next step here? Thanks

galexandre commented 6 years ago

According to the fact the it test is failing, I see this possible scenario:

What do you think?

gliptak commented 6 years ago

We are already running this in our 6.4. The only changes are was making to this PR were trying to fix Travis.

Are you planning to release a 6.7 compatible version?

Thanks

galexandre commented 6 years ago

Yes I will try. However, I don't have much time to do that.

gliptak commented 6 years ago

@galexandre Are you open to commit this PR and release a 6.4 compatible version or do you need to see the IT build succeeding first (wait for a new sonar-orchestrator?)?

galexandre commented 6 years ago

I would prefer to have IT test green before to merge it. I will let the PR open and start working on a version compatible with 6.7