Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arquillian - Failed to locate project pom.xml #2701

Closed
xstefank opened this issue Jun 4, 2019 · 17 comments
Closed

Arquillian - Failed to locate project pom.xml #2701

xstefank opened this issue Jun 4, 2019 · 17 comments
Assignees
Labels
area/testing kind/bug Something isn't working triage/wontfix This will not be worked on

Comments

@xstefank
Copy link
Member

xstefank commented Jun 4, 2019

Describe the bug
Arquillian adapter doesn't generate pom.xml in created temp directory. The test cannot be run.

Expected behavior
Arquillian tests should be able to run.

Actual behavior
Integration test with arquillian fails with

Caused by: io.quarkus.bootstrap.BootstrapException: Failed to locate project pom.xml for /tmp/quarkus-arquillian-test2375295500545820582

To Reproduce
Reproducer: https://github.com/xstefank/learning-tests/tree/master/quarkus/arquillian

Environment (please complete the following information):

  • Output of uname -a or ver: Linux Set-FI 5.0.17-300.fc30.x86_64 Switch to the Maven distributed copy of the SubstrateVM annotations #1 SMP Mon May 20 15:36:26 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Output of java -version: openjdk version "1.8.0_212"
    OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_212-b03)
    OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b03, mixed mode)
  • GraalVM version (if different from Java): openjdk version "1.8.0_202"
    OpenJDK Runtime Environment (build 1.8.0_202-20190206132807.buildslave.jdk8u-src-tar--b08)
    OpenJDK GraalVM CE 1.0.0-rc15 (build 25.202-b08-jvmci-0.58, mixed mode)
  • Quarkus version or git rev: 0.16.0
@xstefank xstefank added the kind/bug Something isn't working label Jun 4, 2019
@xstefank
Copy link
Member Author

xstefank commented Jun 4, 2019

I was able to fix this by adding Files.copy(Paths.get("pom.xml"), tmpLocation.resolve("pom.xml")); to QuarkusDeployableContainer. However, I am not sure this is the right approach.

@gsmet
Copy link
Member

gsmet commented Jun 4, 2019

@mkouba can you take a look at this one?

@mkouba mkouba self-assigned this Jun 4, 2019
@mkouba
Copy link
Contributor

mkouba commented Jun 13, 2019

Hm, I wasn't able to reproduce this locally:

[INFO] Running io.xstefank.PingResourceTest
2019-06-13 10:05:32,816 INFO  [io.qua.dep.QuarkusAugmentor] (main) Beginning quarkus augmentation
2019-06-13 10:05:33,787 INFO  [io.qua.dep.QuarkusAugmentor] (main) Quarkus augmentation completed in 971ms
2019-06-13 10:05:34,186 INFO  [io.quarkus] (main) Quarkus 0.16.0 started in 0.398s. Listening on: http://[::]:8081
2019-06-13 10:05:34,187 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.769 s - in io.xstefank.PingResourceTest
2019-06-13 10:05:35,305 INFO  [io.quarkus] (main) Quarkus stopped in 0.004s

I'm using Maven 3.5.4.

@mkouba
Copy link
Contributor

mkouba commented Jun 13, 2019

Also a full stack trace would be useful ;-)

@rmpestano
Copy link

rmpestano commented Jun 13, 2019

Hi @mkouba,

you're running PingResourceTest, to reproduce the issue you need to run ArquillianIT, here is the stacktrace:

org.jboss.arquillian.container.spi.client.container.DeploymentException: Unable to start the runtime runner
	at io.quarkus.arquillian.QuarkusDeployableContainer.deploy(QuarkusDeployableContainer.java:196)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:151)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:118)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:239)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:118)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:71)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:47)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:92)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:77)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:232)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:212)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:77)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	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.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:171)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:376)
	at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54)
	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:185)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:140)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
	at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.IllegalStateException: Failed to create the boostrap class loader
	at io.quarkus.arquillian.QuarkusDeployableContainer.deploy(QuarkusDeployableContainer.java:174)
	... 105 more
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to locate project pom.xml for /tmp/quarkus-arquillian-test4563000337446837392
	at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.locateCurrentProjectDir(LocalProject.java:124)
	at io.quarkus.bootstrap.resolver.maven.workspace.LocalProject.loadWorkspace(LocalProject.java:55)
	at io.quarkus.bootstrap.BootstrapClassLoaderFactory.newDeploymentClassLoader(BootstrapClassLoaderFactory.java:226)
	at io.quarkus.arquillian.QuarkusDeployableContainer.deploy(QuarkusDeployableContainer.java:171)
	... 105 more


Note that as arquillian uses junit4 I needed to add junit-vintage-engine dependency to br able to run the test from eclipse:

<dependency>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
    <scope>test</scope>
</dependency>

@rmpestano
Copy link

rmpestano commented Jun 13, 2019

Also, to run via surefire plugin you'll need to add includes:

 <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire-plugin.version}</version>
        <configuration>
          <systemProperties>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
          </systemProperties>
          <includes>
              <include>**/*IT.java</include>
          </includes>
        </configuration>
      </plugin>

However I could not get the full stacktrace via surefire but the error is the same:

[INFO] Running io.xstefank.ArquillianIT
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.483 s <<< FAILURE! - in io.xstefank.ArquillianIT
[ERROR] io.xstefank.ArquillianIT  Time elapsed: 0.483 s  <<< ERROR!
org.jboss.arquillian.container.spi.client.container.DeploymentException: Unable to start the runtime runner
Caused by: java.lang.IllegalStateException: Failed to create the boostrap class loader
Caused by: io.quarkus.bootstrap.BootstrapException: Failed to locate project pom.xml for /tmp/quarkus-arquillian-test1235463897409936717

@rmpestano
Copy link

I'm using Quarkus 0.16.1, don't know if #2736 is related to this issue though

@xstefank
Copy link
Member Author

For me, it's running by default (mvn clean install, it should be picked up by default when suffix is IT I think). However, here is stacktrace https://pastebin.com/YmkGNbH0

@rmpestano
Copy link

Yea, now I see the failsafe plugin but you probably won't be able to run via eclipse without junit-vintage-engine (IntelliJ runs without junit-vintage-engine).

@mkouba
Copy link
Contributor

mkouba commented Jun 13, 2019

Ah, of course! Thanks for noticing. And good point with junit versions. Yes, Arquillian currently does not support junit5 and I'm not really sure that using junit-vintage-engine is 100% compatible. Anyway, I found the issue - quarkus arquillian adapter expects the java.io.tmpdir system property to be set to ${project.build.directory} (as defined in jboss-parent).

So a workaround is to add <java.io.tmpdir>${project.build.directory}</java.io.tmpdir> to the maven-surefire-plugin config. Afterwards you'll get a different error coming from JAX-RS...

Anyway, note that arquillian adapter is not supposed to be consumed by users! It's merely an internal tool to run the MP TCK runners.

@rmpestano
Copy link

Got it, I also hit another issue after setting the tempDir property.

I was trying arquillian maily because of drone and graphene, do you have any plans to integrate or make those frameworks compatible with quarkus? cc @MatousJobanek

@mkouba
Copy link
Contributor

mkouba commented Jun 14, 2019

We don't have any plans regarding further Arqullian support ;-).

@xstefank
Copy link
Member Author

@mkouba so IIUC we should rewrite Arquillian tests to @QuarkusTest? Should this issue be closed then?

@mkouba
Copy link
Contributor

mkouba commented Jun 14, 2019

Yes, you should avoid using Arqullian for regular tests, at least for now.

@patoessy
Copy link

Running tests using gradle fails with the same error, do we need a pom.xml for gradle really?

@kenfinnigan
Copy link
Member

Is this issue still an issue or for Arquillian use, it's ok now?

Wondering if we can close

@mkouba
Copy link
Contributor

mkouba commented Oct 30, 2019

It seems that a workaround exists - see my comment #2701 (comment).

Closing the isse.

@mkouba mkouba closed this as completed Oct 30, 2019
@gsmet gsmet added the triage/wontfix This will not be worked on label Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working triage/wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants