dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
865 stars 467 forks source link

mvnw test isn't picking Quarkus Tests #29933

Closed fabrizzio-dotCMS closed 1 month ago

fabrizzio-dotCMS commented 2 months ago

Parent Issue

No response

Problem Statement

I was adding a brand new Quarkus module when I noticed that the build did not pick up my tests. I was getting a Test report with 0 results. Then I went to the trunk branch and checked that the problem wasn't exclusive to my branch. It turns out it also happens to dotcms-cli

Steps to Reproduce

pull the latest from trunk then cd into our core/tools/dotcms-clifolder now do ./mvnw test Then the tests report looks like this:

-------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]

And finishes pretty quickly I even introduced a test meant to fail and still got the same report

It looks like the same is happening in our GHA pipeline

Screenshot 2024-09-09 at 11 08 35 AM

Acceptance Criteria

As maven users, we should rely on how tests get spun universally

dotCMS Version

current trunk

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

spbolton commented 2 months ago

I think it is due to the global fix to use junit 4 provider but quarkus uses junit5 so we need to override

Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider

in parent/pom.xml we have

<dependencies>
                        <dependency>
                            <groupId>org.apache.maven.surefire</groupId>
                            <artifactId>surefire-junit47</artifactId>
                            <version>${version.failsafe.plugin}</version>
                        </dependency>
                    </dependencies>

This overrides the auto detection.

We probably want to move this override into dotcms-build-parent which will only impact core and related modules like postman, integration tests and not quarkus modules.

valentinogiardino commented 1 month ago

IQA PASSED

Tested on master SHA: ab2d465979

image image