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

Bug Report: Payara Embedded All fail to test with JUnit5, Maven Failsafe Plugin and Arquillian. #5224

Closed
charleech opened this issue May 7, 2021 · 14 comments
Labels
Type: Bug Label issue as a bug defect

Comments

@charleech
Copy link

charleech commented May 7, 2021

Description


I've tried to migrate my test to JUnit 5 and found that during performing the integration test via Payara Embedded All, Maven Failsafe Plugin and Arquillian, all tests are failed.

Anyhow and surprisingly when testing against the Payara Micro all tests are passed !

Expected Outcome

All tests should be passed.

Current Outcome

All tests are failed.

The only suspected is the log message during starting up the Payara Embedded All as the following: -

INFO: Network Listener JMS_PROXY_default_JMS_host started in: 2ms - bound to [/0.0.0.0:7676]
May 07, 2021 11:22:09 AM org.glassfish.hk2.classmodel.reflect.Parser awaitTermination
INFO: visiting unvisited references
May 07, 2021 11:22:09 AM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Illegal char <<> at index 43: org\jboss\shrinkwrap\descriptor\api\Mutable<org\jboss\shrinkwrap\descriptor\api\Immutable<org\jboss\shrinkwrap\descriptor\api\Immutable>>.class

Steps to reproduce

I've created the reproducer at https://github.com/charleech/arquillian-junit5-payara

There are two maven module as arquillian-junit5-payara/my-cdi-junit4 and arquillian-junit5-payara/my-cdi-junit5 which are the simple CDI testing (hello world style) by using JUnit4 and JUnit5 respectively.

The arquillian-junit5-payara/my-cdi-junit5 is the failure one.

  • To execute against the Payara Embedded All
    • mvn clean install -Dpayara-embedded=true
  • To execute against the Payara Micro
    • mvn clean install -Dpayara-micro=true

Environment

  • Distribution: Micro and Embedded, Community version 5.2021.3
  • JDK Version: AdoptOpenJDK-11.0.11+9 64 bits
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)
  • Operating System: Windows 10 Home Edition 64 bits
  • Build Tool: Apache Maven version 3.8.1
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\Java.Application\Apache\apache-maven\bin\..
Java version: 11.0.11, vendor: AdoptOpenJDK, runtime: C:\Java.Application\Sun\Java\jdk-11.0.11
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
  • Project Dependencies
    • org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M5
    • fish.payara.extras:payara-embedded-all:5.2021.3
    • fish.payara.extras:payara-micro:5.2021.3
    • fish.payara.arquillian:arquillian-payara-server-embedded:2.4.1
    • fish.payara.arquillian:arquillian-payara-micro-managed:2.4.1
    • junit:junit:4.13.2
    • org.junit.jupiter:junit-jupiter-api:5.8.0-M1
    • org.junit.jupiter:junit-jupiter-engine:5.8.0-M1
    • org.junit.jupiter:junit-vintage-engine:5.8.0-M1
    • org.junit.platform:junit-platform-runner:1.8.0-M1
    • org.jboss.arquillian.junit5:arquillian-junit5-container:1.7.0.Alpha9
    • org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:3.1.4
    • org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-impl-javaee:2.0.0
    • org.eu.ingwar.tools:arquillian-suite-extension:1.2.2
@charleech charleech added the Type: Bug Label issue as a bug defect label May 7, 2021
@shub8968 shub8968 added the Status: Open Issue has been triaged by the front-line engineers and is being worked on verification label May 16, 2021
@shub8968
Copy link
Contributor

shub8968 commented May 17, 2021

You are adding a failsafe plugin to the <pluginManagement> tag. Kindly remove the <pluginManagement> tags and try executing them.

@shub8968 shub8968 removed the Status: Open Issue has been triaged by the front-line engineers and is being worked on verification label May 17, 2021
@charleech
Copy link
Author

charleech commented May 17, 2021

@shub8968

Please correct me If I'm wrong and bear with me. I'm understanding as the following: -

  1. During the maven test phase, the maven-surefire-plugin will handle it. On the other hand during the maven integration-test and verify, the maven-failsafe-plugin will handle it as well.
  1. If we remove the maven-failsafe-plugin as your recommended, the maven integration test will not be performed.
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (unit-test) @ my-cdi-junit5 ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[ERROR] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[ERROR] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[INFO] Running test.app.github.charleech.my.cdi.MyCdiJunit5TestSuite
[INFO] Running test.app.github.charleech.my.cdi.MyCdiJunit5Tester
2021-05-17 21:13:45.231 [main] [] INFO  app.github.charleech.my.cdi.Greeter           - 31 greet The parameter=JUnit5_1
2021-05-17 21:13:45.314 [main] [] INFO  app.github.charleech.my.cdi.Greeter           - 31 greet The parameter=JUnit5_2
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.295 s - in test.app.github.charleech.my.cdi.MyCdiJunit5Tester
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.338 s - in test.app.github.charleech.my.cdi.MyCdiJunit5TestSuite
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (test-jar-create) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ my-cdi-junit5 ---
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT.jar to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT.jar
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\pom.xml to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT.pom
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.901 s
[INFO] Finished at: 2021-05-17T21:13:46+07:00
[INFO] ------------------------------------------------------------------------
  1. My issue as its subject is about "Payara Embedded All fail to test with JUnit5, Maven Failsafe Plugin and Arquillian.".

As of now I do not understand why I've to remove maven-failsafe-plugin and make my maven not to execute the integration-test and verify phase, especially why it is treated as a solution for this issue.

Could you please help to explain?

@shub8968
Copy link
Contributor

shub8968 commented May 17, 2021

Hi @charleech

Kindly remove nested <pluginManagement> tag inside all <build> tag as below. It should work.

`

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${my.maven.surefire.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.junit.jupiter</groupId>
                                <artifactId>junit-jupiter-engine</artifactId>
                                <version>${my.junit5.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>unit-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <encoding>${project.build.sourceEncoding}</encoding>
                                    <skipTests>${my.skipUTs}</skipTests>
                                    <includes>
                                        <include>
                                            **/*TestSuite*.java
                                        </include>
                                    </includes>
                                    <excludes>
                                        <exclude>
                                            **/*IntgrtnTestSuite*.java
                                        </exclude>
                                    </excludes>
                                    <excludedGroups>
                                        ${my.integration.test.category}
                                    </excludedGroups>
                                    <additionalClasspathElements>
                                        <additionalClasspathElement>
                                            ${basedir}/src/test/java
                                        </additionalClasspathElement>
                                    </additionalClasspathElements>
                                    <argLine>${my.maven.surefire.jvm.memory} ${my.maven.surefire.java.endorsed.dir}</argLine>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${my.maven.failsafe.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.junit.jupiter</groupId>
                                <artifactId>junit-jupiter-engine</artifactId>
                                <version>${my.junit5.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <skipTests>${my.skipTests}</skipTests>
                            <skipITs>${my.skipITs}</skipITs>
                            <includes>
                                <include>
                                    **/*IntgrtnTestSuite*.java
                                </include>
                            </includes>
                            <groups>
                                ${my.integration.test.category}
                            </groups>
                            <additionalClasspathElements>
                                <additionalClasspathElement>
                                    ${basedir}/src/test/java
                                </additionalClasspathElement>
                            </additionalClasspathElements>
                            <argLine>${my.maven.surefire.jvm.memory} ${my.maven.surefire.java.endorsed.dir}</argLine>
                        </configuration>
                    </plugin>



                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                </plugin></plugins>
        </build>`

@charleech
Copy link
Author

The example output if the maven-failsafe-plugin is executed at integration-test and verify phase

[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ my-cdi-junit5 ---
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (unit-test) @ my-cdi-junit5 ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[ERROR] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[ERROR] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[INFO] Running test.app.github.charleech.my.cdi.MyCdiJunit5TestSuite
[INFO] Running test.app.github.charleech.my.cdi.MyCdiJunit5Tester
2021-05-17 21:45:00.367 [main] [] INFO  app.github.charleech.my.cdi.Greeter           - 31 greet The parameter=JUnit5_1
2021-05-17 21:45:00.466 [main] [] INFO  app.github.charleech.my.cdi.Greeter           - 31 greet The parameter=JUnit5_2
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.318 s - in test.app.github.charleech.my.cdi.MyCdiJunit5Tester
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.363 s - in test.app.github.charleech.my.cdi.MyCdiJunit5TestSuite
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (test-jar-create) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT.jar
[INFO] 

# ----------------------------------------------------------------------------------------
# Here is an expected maven-failsafe-plugin execution for `integration-test` phase
# ----------------------------------------------------------------------------------------

[INFO] --- maven-failsafe-plugin:3.0.0-M5:integration-test (integration-test) @ my-cdi-junit5 ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[ERROR] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
[ERROR] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[INFO] Running it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTestSuite
[INFO] Running it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTester
[ERROR] WARNING: An illegal reflective access operation has occurred
[ERROR] WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/D:/M2/Repository/fish/payara/extras/payara-embedded-all/5.2021.3/payara-embedded-all-5.2021.3.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
[ERROR] WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
[ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ERROR] WARNING: All illegal access operations will be denied in a future release
2021-05-17 21:45:05.031 [main] [] INFO  org.reflections.Reflections                   - 232 scan Reflections took 76 ms to scan 1 urls, producing 7 keys and 12 values 
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 19.734 s <<< FAILURE! - in it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTester
[ERROR] it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTester.whenGreet1  Time elapsed: 0.058 s  <<< ERROR!
java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

[ERROR] it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTester.whenGreet2  Time elapsed: 0.005 s  <<< ERROR!
java.lang.IllegalArgumentException: ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.

JdbcRuntimeExtension,  getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.179 s - in it.test.app.github.charleech.my.cdi.MyCdiJunit5IntgrtnTestSuite
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   MyCdiJunit5IntgrtnTester.whenGreet1 » IllegalArgument ArquillianServletRunner ...
[ERROR]   MyCdiJunit5IntgrtnTester.whenGreet2 » IllegalArgument ArquillianServletRunner ...
[INFO] 
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0
[INFO] 
[INFO] 

# ----------------------------------------------------------------------------------------
# Here is an expected maven-failsafe-plugin execution for `verify` phase
# ----------------------------------------------------------------------------------------

[INFO] --- maven-failsafe-plugin:3.0.0-M5:verify (integration-test) @ my-cdi-junit5 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  35.372 s

@lprimak
Copy link
Contributor

lprimak commented May 17, 2021

Is there a particular reason you want to run with embedded? Why don't you run with remote or managed?

@lprimak
Copy link
Contributor

lprimak commented May 17, 2021

I've been doing QA for Payara for about 6 months now and I've never run embedded :)

@charleech
Copy link
Author

Hi @shub8968,

I understand that your recommended is to remove that <pluginManagement> configuration, but if we remove it, it will not execute.

Do you mean that I have to not execute?

@charleech
Copy link
Author

Hi @lprimak,

I would like to use the embedded since there is no need to install any addition to the development machine, just point the dependency in the pom file to that embedded. Especially I do not want to take care any configuration, e.g. domain.xml, logging.proerties and so on. Le'ts tweak the bindHttpPort and bindHttpsPort via the arquillian.xml is enough for the development point-of-view.

@lprimak
Copy link
Contributor

lprimak commented May 17, 2021

See https://github.com/payara/MicroProfile-TCK-Runners/blob/0317081714c0ed6f2df91c72b790f885f406204a/pom.xml#L135 for an example of how to use managed profile.

We don't regularly test embedded (at least for now) so unless you want to debug this yourself I would suggest using managed / remote profiles

@charleech
Copy link
Author

Hi @shub8968,

At the moment my pom.xml is as the following: -

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${my.maven.surefire.version}</version>
            <dependencies>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-engine</artifactId>
                    <version>${my.junit5.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>unit-test</id>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <skipTests>${my.skipUTs}</skipTests>
                        <includes>
                            <include>
                                **/*TestSuite*.java
                            </include>
                        </includes>
                        <excludes>
                            <exclude>
                                **/*IntgrtnTestSuite*.java
                            </exclude>
                        </excludes>
                        <excludedGroups>
                            ${my.integration.test.category}
                        </excludedGroups>
                        <additionalClasspathElements>
                            <additionalClasspathElement>
                                ${basedir}/src/test/java
                            </additionalClasspathElement>
                        </additionalClasspathElements>
                        <argLine>${my.maven.surefire.jvm.memory}
                            ${my.maven.surefire.java.endorsed.dir}</argLine>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${my.maven.failsafe.version}</version>
            <dependencies>
                <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-engine</artifactId>
                    <version>${my.junit5.version}</version>
                </dependency>
            </dependencies>
            <executions>
                <execution>
                    <id>integration-test</id>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <encoding>${project.build.sourceEncoding}</encoding>
                <skipTests>${my.skipTests}</skipTests>
                <skipITs>${my.skipITs}</skipITs>
                <includes>
                    <include>
                        **/*IntgrtnTestSuite*.java
                    </include>
                </includes>
                <groups>
                    ${my.integration.test.category}
                </groups>
                <additionalClasspathElements>
                    <additionalClasspathElement>
                        ${basedir}/src/test/java
                    </additionalClasspathElement>
                </additionalClasspathElements>
                <argLine>${my.maven.surefire.jvm.memory}
                    ${my.maven.surefire.java.endorsed.dir}</argLine>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
        </plugin>
    </plugins>
</build>

After executing the mvn clean install -Dpayara-embedded=true the result is

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ my-cdi-junit5 ---
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:test-jar (test-jar-create) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) @ my-cdi-junit5 ---
[INFO] Building jar: D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ my-cdi-junit5 ---
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT.jar to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT.jar
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\pom.xml to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT.pom
[INFO] Installing D:\JavaPrj.Github\arquillian-junit5-payara\my-cdi-junit5\target\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar to D:\M2\Repository\app\github\charleech\my-cdi-junit5\1.0.0-SNAPSHOT\my-cdi-junit5-1.0.0-SNAPSHOT-tests.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  7.439 s
[INFO] Finished at: 2021-05-17T22:14:27+07:00
[INFO] ------------------------------------------------------------------------
  1. At the maven-surefire-plugin level, there is no any unit test running.
  2. There is no maven-failsafe-plugin execution. This means there is no any integration test running.

Could you please help to confirm that this is a solution for this issue?

@charleech
Copy link
Author

See https://github.com/payara/MicroProfile-TCK-Runners/blob/0317081714c0ed6f2df91c72b790f885f406204a/pom.xml#L135 for an example of how to use managed profile.

We don't regularly test embedded (at least for now) so unless you want to debug this yourself I would suggest using managed / remote profiles

Thank you very much for the useful resource. I will try to learn about the managed and remote from it.

@shub8968 shub8968 reopened this May 17, 2021
@OndroMih
Copy link
Contributor

Hi @charleech , @lprimak is right, you can easily configure the managed connector together with the dependency plugin to install a specific version of Payara Server, run it and then clean it up after tests are executed. So everything can be automated in pom.xml, no need to install anything manually.

Payara Embedded has some weird issues when you use it in a maven build because of classpath conflicts. I think that some libraries used by Maven or its plugins collide with libraries in Payara Embedded. You at least need to run the failsafe tests in a separate JVM with fork=true but even then I'm not sure that all works with Payara Embedded.

@charleech
Copy link
Author

charleech commented May 18, 2021

Hi @OndroMih and @lprimak,

I also have a chance to follow @lprimak guidance and apply to my reproducer as charleech/arquillian-junit5-payara#17 It works like a charm. (As @OndroMih mentions that if it is executed in the different JVM there should not be any classpath issue.)

Please bear with me. I am stuck with the embedded since the GlassFish back in the early of 2012 (The first launch of the Arquillian). It is not a simple task to switch, especially due to my limited knowledge to mix and match among the JaCoCo, EclEmma, Eclipse, Windows OS and the Arquillian supported container (e.g. other than embedded) which give me a 0% code coverage result. Anyhow I also understand that these messy things are not related to here.

On the other hand , I totally agree with both of you that I should switch to managed, remote or even micro rather than the embedded. Especially I also would prefer rather you and engineering team to put the effort on our best server side than to waste the time to debug the embedded.

Firstly I open this issue because I hope that the engineering team may have some spare time and may be interested, but at the moment it may be my fault and this issue also may be invalid. Please accept my sincere apologies.

I thank you from the bottom of my heart that you spend the time and effort on this issue, especially to guide me to the proper direction.

@lprimak
Copy link
Contributor

lprimak commented May 18, 2021

@charleech that's not a problem at all. I will close this issue as we definitely do not have time to debug this

@lprimak lprimak closed this as completed May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

4 participants