Skip to content

Draft: Support remote analyze (Sonarcloud/SonarQube) #80

Draft: Support remote analyze (Sonarcloud/SonarQube)

Draft: Support remote analyze (Sonarcloud/SonarQube) #80

GitHub Actions / JUnit Tests failed Dec 21, 2023 in 0s

JUnit Tests ❌

Tests failed

Report Passed Failed Skipped Time
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.NodeBundlePathResolverTest.xml 1✅ 2ms
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.remote.SonarLintRemoteEngineTest.xml 1✅ 63s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintAnalyserIssueComparatorTest.xml 4✅ 34ms
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavaPluginTest.xml 4✅ 4s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest.xml 4✅ 1❌ 42s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplPhpPluginTest.xml 1✅ 441ms
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplTest.xml 5✅ 1s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplWebPluginTest.xml 1✅ 2s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplXmlPluginTest.xml 1✅ 240ms
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest.xml 10s
target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest$ProjectBased.xml 19✅ 1⚪ 10s

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.NodeBundlePathResolverTest.xml

1 tests were completed in 2ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.NodeBundlePathResolverTest 1✅ 2ms

✅ com.github.philippefichet.sonarlint4netbeans.NodeBundlePathResolverTest

✅ resolve

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.remote.SonarLintRemoteEngineTest.xml

1 tests were completed in 63s with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.remote.SonarLintRemoteEngineTest 1✅ 63s

✅ com.github.philippefichet.sonarlint4netbeans.remote.SonarLintRemoteEngineTest

✅ remote

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintAnalyserIssueComparatorTest.xml

4 tests were completed in 34ms with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintAnalyserIssueComparatorTest 4✅ 34ms

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintAnalyserIssueComparatorTest

✅ sort(Issue, Issue, CompareOrder)[1] Sorting issue DefaultIssueTestImpl{severity=null, type=null, ruleKey=null, startLine=20, endLine=null, startLineOffset=30, endLineOffset=null, clientInputFile=FSClientInputFile{path=./src/test/resources/NewClass.java, relativePath=null, isTest=true, encoding=null}} and FIRST with order {3}
✅ sort(Issue, Issue, CompareOrder)[2] Sorting issue DefaultIssueTestImpl{severity=null, type=null, ruleKey=null, startLine=19, endLine=null, startLineOffset=15, endLineOffset=null, clientInputFile=FSClientInputFile{path=./src/test/resources/NewClass.java, relativePath=null, isTest=true, encoding=null}} and SECOND with order {3}
✅ compare(Issue, Issue, CompareOrder)[1] Compare issue DefaultIssueTestImpl{severity=null, type=null, ruleKey=null, startLine=20, endLine=null, startLineOffset=30, endLineOffset=null, clientInputFile=FSClientInputFile{path=./src/test/resources/NewClass.java, relativePath=null, isTest=true, encoding=null}} and FIRST with order {3}
✅ compare(Issue, Issue, CompareOrder)[2] Compare issue DefaultIssueTestImpl{severity=null, type=null, ruleKey=null, startLine=19, endLine=null, startLineOffset=15, endLineOffset=null, clientInputFile=FSClientInputFile{path=./src/test/resources/NewClass.java, relativePath=null, isTest=true, encoding=null}} and SECOND with order {3}

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavaPluginTest.xml

4 tests were completed in 4s with 4 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavaPluginTest 4✅ 4s

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavaPluginTest

✅ analyze(SonarLintEngineTestConfiguration, List)[1}] analyze(SonarLintFileDemo.java with rule java:S115 but without java:S122 and java:S1118 to check CODE_SMELL CRITICAL)
✅ analyze(SonarLintEngineTestConfiguration, List)[2}] analyze(NewClass.java with rule java:S1133 but without java:S1186, java:S1598, java:S100, java:S1134, java:S2168 and java:S115  to check CODE_SMELL INFO)
✅ analyze(SonarLintEngineTestConfiguration, List)[3}] analyze(SonarLintFileDemo.java with rule java:S115 but without java:S1220 and S1118 rule with default parameters)
✅ analyze(SonarLintEngineTestConfiguration, List)[4}] analyze(SonarLintFileDemo.java with rule java:S115 but without java:S1220 and S1118 rule with custom parameters)

❌ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest.xml

5 tests were completed in 42s with 4 passed, 1 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest 4✅ 1❌ 42s

❌ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest

✅ analyze(SonarLintEngineTestConfiguration, List)[1}] analyze(sonarlint-example.js with rule javascript:S108 to check javascript plugin that require nodejs)
✅ analyze(SonarLintEngineTestConfiguration, List)[2}] analyze(sonarlint-example-with-global-variables.js with rule javascript:S3827 to check 3 issues from global variable declaring without extra properties "sonar.javascript.globals")
✅ analyze(SonarLintEngineTestConfiguration, List)[3}] analyze(sonarlint-example-with-global-variables.js with rule javascript:S3827 to check one issue from global variable declaring in extra properties "sonar.javascript.globals" for "globalVariables,api")
✅ analyze(SonarLintEngineTestConfiguration, List)[4}] analyze(sonarlint-example-with-global-variables.js with rule javascript:S3827 to check two issues from global variable declaring with extra properties "sonar.javascript.globals" for "AapiI")
❌ analyze(SonarLintEngineTestConfiguration, List)[5}] analyze(sonarlint-example.css with rule css:S1116 to check one issue on line "4")
	org.opentest4j.AssertionFailedError

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplPhpPluginTest.xml

1 tests were completed in 441ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplPhpPluginTest 1✅ 441ms

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplPhpPluginTest

✅ analyze(SonarLintEngineTestConfiguration, List)[1}] analyze(sonarlin-example.php with rule php:S101 but without php:S1105 to check php plugin)

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplTest.xml

5 tests were completed in 1s with 5 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplTest 5✅ 1s

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplTest

✅ getRuleParameter
✅ getMergedExtraProperties(Map, Project, Map, Project, Map)[1] {p1=v1}, Mock for Project, hashCode: 1264191370, {p1=v2}, Mock for Project, hashCode: 1264191370, {p1=v2}
✅ getMergedExtraProperties(Map, Project, Map, Project, Map)[2] {p1=v1}, Mock for Project, hashCode: 1264191370, {p1=v2}, null, {p1=v1}
✅ getMergedExtraProperties(Map, Project, Map, Project, Map)[3] {}, Mock for Project, hashCode: 1264191370, {p1=v2}, null, {}
✅ getMergedExtraProperties(Map, Project, Map, Project, Map)[4] {}, Mock for Project, hashCode: 1264191370, {p1=v2}, Mock for Project, hashCode: 1264191370, {p1=v2}

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplWebPluginTest.xml

1 tests were completed in 2s with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplWebPluginTest 1✅ 2s

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplWebPluginTest

✅ analyze(SonarLintEngineTestConfiguration, List)[1}] analyze(sonarlin-example.php with rule php:S101 but without php:S1105 to check php plugin)

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplXmlPluginTest.xml

1 tests were completed in 240ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplXmlPluginTest 1✅ 240ms

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplXmlPluginTest

✅ analyze(SonarLintEngineTestConfiguration, List)[1}] analyze(sonarlin-example.php with rule php:S101 but without php:S1105 to check php plugin)

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest.xml

No tests found

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest 10s

✅ target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest$ProjectBased.xml

20 tests were completed in 10s with 19 passed, 0 failed and 1 skipped.

Test suite Passed Failed Skipped Time
com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest$ProjectBased 19✅ 1⚪ 10s

✅ com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest$ProjectBased

com.github.philippefichet.sonarlint4netbeans.SonarLintUtilsTest
  ⚪ Check to search default nodeJS installation
  ✅ toTruncateURI(URI, int, String)[1] Given URI file:/source-code/my-project/src/main/java/com/example/Main.java When truncate to 100 characters Then path must be file:/source-code/my-project/src/main/java/com/example/Main.java.
  ✅ toTruncateURI(URI, int, String)[2] Given URI file:/source-code/my-project/src/main/java/com/example/Main.java When truncate to 11 characters Then path must be .../Main.java.
  ✅ toTruncateURI(URI, int, String)[3] Given URI file:/source-code/my-project/src/main/java/com/example/Main.java When truncate to 12 characters Then path must be .../example/Main.java.
  ✅ toTruncateURI(URI, int, String)[4] Given URI file:/source-code/my-project/src/main/java/com/example/Main.java When truncate to 40 characters Then path must be .../my-project/src/main/java/com/example/Main.java.
  ✅ toTruncateURI(URI, int, String)[5] Given URI file:///C:/Users/Main.java When truncate to 12 characters Then path must be .../Users/Main.java.
  ✅ toTruncateURI(URI, int, String)[6] Given URI file:///C:/Users/Main.java When truncate to 100 characters Then path must be file:///C:/Users/Main.java.
  ✅ getMergedExtraPropertiesAndReplaceVariables(Project, Map, Map)[1] null, {sonar.cfamily.compile-commands=${projectDir}/build/compile_commands.json}, {sonar.cfamily.compile-commands=${projectDir}/build/compile_commands.json}
  ✅ getMergedExtraPropertiesAndReplaceVariables(Project, Map, Map)[2] Mock for Project, hashCode: 2145416033, {sonar.cfamily.compile-commands=${projectDir}/build/compile_commands.json}, {sonar.cfamily.compile-commands=/home/runner/work/sonarlint4netbeans/sonarlint4netbeans/build/compile_commands.json}
  ✅ Detect nodejs version
✅ Analyze hierarchical tree used in "Analyze with Sonarlint"
✅ Analyze with custom rule parameter value to check ${projectDir}
✅ Check custom rule parameter value from extractRuleParameters
✅ Check default rule parameter value from extractRuleParameters
✅ Analyze with custom rule parameter value on project with global scope
✅ Analyze with custom rule parameter value on project
✅ Analyze hierarchical tree used in "Analyze with Sonarlint" with a custom rule parameter value
✅ Check custom rule parameter value from extractRuleParameters on project with global scope
✅ Analyze with custom rule parameter value
✅ Analyze with extra properties on project

Annotations

Check failure on line 188 in src/test/java/com/github/philippefichet/sonarlint4netbeans/junit/jupiter/extension/SonarLintLookupMockedExtension.java

See this annotation in the file changed.

@github-actions github-actions / JUnit Tests

com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest ► analyze(SonarLintEngineTestConfiguration, List)[5}] analyze(sonarlint-example.css with rule css:S1116 to check one issue on line "4")

Failed test found in:
  target/surefire-reports/TEST-com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest.xml
Error:
  org.opentest4j.AssertionFailedError
Raw output
org.opentest4j.AssertionFailedError
	at com.github.philippefichet.sonarlint4netbeans.junit.jupiter.extension.SonarLintLookupMockedExtension.lambda$interceptTestTemplateMethod$10(SonarLintLookupMockedExtension.java:188)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at com.github.philippefichet.sonarlint4netbeans.junit.jupiter.extension.SonarLintLookupMockedExtension.executeInMockedLookup(SonarLintLookupMockedExtension.java:195)
	at com.github.philippefichet.sonarlint4netbeans.junit.jupiter.extension.SonarLintLookupMockedExtension.interceptTestTemplateMethod(SonarLintLookupMockedExtension.java:179)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
Caused by: java.lang.AssertionError: 
Actual and expected should have same size but actual size is:
  0
while expected size is:
  1
Actual was:
  []
Expected was:
  [DefaultIssueTestImpl{severity=MINOR, type=CODE_SMELL, ruleKey=css:S1116, startLine=4, endLine=4, startLineOffset=0, endLineOffset=20, clientInputFile=null}]
	at com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplTestUtils.analyzeTesting(SonarLintEngineImplTestUtils.java:116)
	at com.github.philippefichet.sonarlint4netbeans.SonarLintEngineImplJavascriptPluginTest.analyze(SonarLintEngineImplJavascriptPluginTest.java:223)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.github.philippefichet.sonarlint4netbeans.junit.jupiter.extension.SonarLintLookupMockedExtension.lambda$interceptTestTemplateMethod$10(SonarLintLookupMockedExtension.java:181)
	... 47 more