AlshammariA / FlakeFlagger

BSD 3-Clause "New" or "Revised" License
9 stars 12 forks source link

Cannot build `test-feature-collector` #5

Closed Ti-tanium closed 2 years ago

Ti-tanium commented 2 years ago

Here is my maven version:

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /opt/homebrew/Cellar/maven/3.8.6/libexec
Java version: 1.8.0_292, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

When I run mvn install under FlakeFlagger/test-feature-collector/, I see the following error:

testResourceOptimismDirectly(edu.gmu.swe.smells.test.ResourceOptimismSmellDetectorTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.IllegalStateException: invalid environment settings
        at org.eclipse.jdt.core.dom.ASTParser.getClasspath(ASTParser.java:261)
        at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:993)
        at edu.gmu.swe.smells.detector.internal.JDTContext.collectAllTypes(JDTContext.java:119)
        at edu.gmu.swe.smells.detector.internal.JDTContext.<init>(JDTContext.java:30)
        at edu.gmu.swe.smells.detector.internal.DetectorEntryPoint.buildTestContextMap(DetectorEntryPoint.java:166)
        at edu.gmu.swe.smells.test.BaseSmellDetectorTest.doTestsHaveSmells(BaseSmellDetectorTest.java:113)
        at edu.gmu.swe.smells.test.ResourceOptimismSmellDetectorTest.testResourceOptimismDirectly(ResourceOptimismSmellDetectorTest.java:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
        at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Results :

Tests in error: 
  testNoRouletteTest(edu.gmu.swe.smells.test.AssertionRouletteDetectorTest): invalid environment settings
  testRouletteTest(edu.gmu.swe.smells.test.AssertionRouletteDetectorTest): invalid environment settings
  testDirectTest(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testIndirectOnlyConsidersTestClassCode(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testIndirectTest2(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testIndirectTest(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testIndirectIndirectTest(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testIndirectDirectTest(edu.gmu.swe.smells.test.IndirectTestingDetectorTest): invalid environment settings
  testStaticFieldTest(edu.gmu.swe.smells.test.RunWarDetectorTest): invalid environment settings
  testStaticFinalFieldTest(edu.gmu.swe.smells.test.RunWarDetectorTest): invalid environment settings
  testNoRunWarTest(edu.gmu.swe.smells.test.RunWarDetectorTest): invalid environment settings
  testSameFileTest(edu.gmu.swe.smells.test.RunWarDetectorTest): invalid environment settings
  testCallsSleepIndirectly(edu.gmu.swe.smells.test.CallsSleepSmellDetectorTest): invalid environment settings
  testCallsSleepDirectly(edu.gmu.swe.smells.test.CallsSleepSmellDetectorTest): invalid environment settings
  testNonStaticNonEagerTest(edu.gmu.swe.smells.test.EagerDetectorTest): invalid environment settings
  testEagerTest(edu.gmu.swe.smells.test.EagerDetectorTest): invalid environment settings
  testNotEagerTest(edu.gmu.swe.smells.test.EagerDetectorTest): invalid environment settings
  testNonStaticEagerTest(edu.gmu.swe.smells.test.EagerDetectorTest): invalid environment settings
  testNoConditionalTest(edu.gmu.swe.smells.test.ConditionalTestDetectorTest): invalid environment settings
  testConditionalTest(edu.gmu.swe.smells.test.ConditionalTestDetectorTest): invalid environment settings
  testFireAndForgetDirectly(edu.gmu.swe.smells.test.FireAndForgetSmellDetectorTest): invalid environment settings
  testFireAndForgetIndirectly(edu.gmu.swe.smells.test.FireAndForgetSmellDetectorTest): invalid environment settings
  testMysteryGuestDirectly(edu.gmu.swe.smells.test.MysteryGuestSmellDetectorTest): invalid environment settings
  testMysteryGuestDatabaseDirectly(edu.gmu.swe.smells.test.MysteryGuestSmellDetectorTest): invalid environment settings
  testMysteryGuestIndirectly(edu.gmu.swe.smells.test.MysteryGuestSmellDetectorTest): invalid environment settings
  testMysteryGuestOnConstructors(edu.gmu.swe.smells.test.MysteryGuestSmellDetectorTest): invalid environment settings
  testMysteryGuestDatabaseIndirectly(edu.gmu.swe.smells.test.MysteryGuestSmellDetectorTest): invalid environment settings
  testResourceOptimismIndirectly(edu.gmu.swe.smells.test.ResourceOptimismSmellDetectorTest): invalid environment settings
  testResourceOptimismDirectly(edu.gmu.swe.smells.test.ResourceOptimismSmellDetectorTest): invalid environment settings

Tests run: 29, Failures: 0, Errors: 29, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for test-smells-parent 1.0-SNAPSHOT:
[INFO] 
[INFO] test-smells-parent ................................. SUCCESS [  2.118 s]
[INFO] test-smells-maven-extension ........................ SUCCESS [  5.602 s]
[INFO] detect-smells-plugin ............................... FAILURE [ 11.772 s]
[INFO] kp-test-listener ................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  20.669 s
[INFO] Finished at: 2022-10-04T22:13:11-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project detect-smells-plugin: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/xiaoxiongli/Documents/UT Austin/Courses/Software Test/FlakeFlagger/test-feature-collector/reporting-plugin/target/surefire-reports for the individual test results.
[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 :detect-smells-plugin

It seems that some of the test cases failed. Is there something wrong with my environment?

Any suggestion would be greatly appreciated.

Thanks!

Ti-tanium commented 2 years ago

It turns out it's because of a blank space in the directory path. I moved the project to another directory where the path has no blank space, and everything worked.