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

Groovy DSL test hard to make work on Quarkus Platform #4894

Open
ppalaga opened this issue May 12, 2023 · 2 comments
Open

Groovy DSL test hard to make work on Quarkus Platform #4894

ppalaga opened this issue May 12, 2023 · 2 comments

Comments

@ppalaga
Copy link
Contributor

ppalaga commented May 12, 2023

The test can currently be characterized as follows:

  1. The execution is moved to integration test phase
  2. It relies on the existence of the runner artifact under target directory
  3. The path to the runner is passed from pom.xml to the test via property

All of these are quite against how the tests in Quarkus Platform are set up:

  1. Native tests are not executed and thus their CI is only reaching Maven test phase. This was discussed several times and the general agreement was that this should change, but it has not changed yet. Hence point 1. may get solved at some point by the Platform team.
  2. Running mvn package in the generated test module directory generated-platform-project/quarkus-camel/integration-tests/camel-quarkus-integration-test-groovy-dsl does not produce any jars under target. Maybe quarkus-maven-plugin is not set up. It needs to be investigated.
  3. Setting the quarkus.runner property (and moving surefire to integration-test) can be done by this piece of XSL added to src/main/resources/xslt/camel/test-pom.xsl in the Platform source tree:
    <!-- camel-quarkus-integration-test-groovy-dsl requires to move surefire:test to integration-test phase -->
    <!-- to be able to run java -jar target/*runner.jar from a test -->
    <xsl:template match="/pom:project/pom:build/pom:plugins/pom:plugin[(pom:artifactId/text() = 'maven-surefire-plugin') and (/pom:project/pom:artifactId/text() = 'camel-quarkus-integration-test-groovy-dsl')]">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()" />
            <executions>
                <execution>
                    <id>default-test</id>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <phase>integration-test</phase>
                    <configuration>
                        <systemProperties>
                            <quarkus.runner>&#36;{project.build.directory}/quarkus-app/quarkus-run.jar</quarkus.runner>
                        </systemProperties>
                    </configuration>
                </execution>
            </executions>
        </xsl:copy>
    </xsl:template>

Instead on pushing on any of the above, I'll remove camel-quarkus-integration-test-groovy-dsl from the test list we publish for the platform for now.

@essobedo I wonder whether the classloading issue because of which we have this special setup cannot be fixed in Quarkus or elsewhere? If it can be fixed, we would not need to bother with any special measures to make the test work in the Platform.

@essobedo
Copy link
Contributor

I can check that asap, but could you please also share the link to the failing build or anything that could help to get the full picture?

@ppalaga
Copy link
Contributor Author

ppalaga commented May 12, 2023

could you please also share the link to the failing build

I am doing it locally so far. IIRC, there is no CQ release with the new Groovy DSL tests, so I cannot prepare a PR for the Plaform where it would be visible.

This would be the steps to do it locally:

cd camel-quarkus
mvnd clean install -DskipTests -Dquarkus.build.skip # -Dquickly is not enough to build test-jars

cd .. 
git clone [email protected]:quarkusio/quarkus-platform.git
cd quarkus-platform

# in the top pom.xml change <camel-quarkus.version> to your local snapshot
# then regenerate the boms and test modules
./mvnw install -DskipTests # this dowloads the internet

# review the generated groovy DSL module 
cd generated-platform-project/quarkus-camel/integration-tests/camel-quarkus-integration-test-groovy-dsl
mvn verify # will fail for the reasons sketched above

ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue May 12, 2023
ppalaga added a commit to ppalaga/camel-quarkus that referenced this issue May 25, 2023
zbendhiba pushed a commit to zbendhiba/camel-quarkus that referenced this issue Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants