Skip to content

HIVE-29043: Ban the Jupiter dependency from hive-unit to prevent unit tests from being skipped #5894

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abstractdog
Copy link
Contributor

What changes were proposed in this pull request?

Ban jupiter dependency.

Why are the changes needed?

To prevent skipping hive-unit unit tests silently again.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Tested with adding the problematic dependency, and instead of silently skipping unit test, it failed.

mvn install -Pitests -Dtest=TestHttpServices -pl ./itests/hive-unit -nsu

...

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message:
Found Banned Dependency: org.junit.jupiter:junit-jupiter:jar:5.11.2
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.237 s
[INFO] Finished at: 2025-06-24T14:56:04+02:00
[INFO] ------------------------------------------------------------------------
[INFO] 5 goals, 5 executed
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (ban-jupiter) on project hive-it-unit: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]

Copy link
Member

@zabetak zabetak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea but based on the test failures it seems that we already have jupiter dependencies in the project so we have to revisit those.

Other than that left some minor suggestions for potential improvements.

pom.xml Outdated
Comment on lines 1750 to 1751
<!-- Only remove this rule if you confirmed that adding jupiter dependency -->
<!-- to the project won't make unit tests silently skipped -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment would be more helpful if it was part of the failure. How about putting it in <message>...</message>

</configuration>
</execution>
<!-- Only remove this rule if you confirmed that adding jupiter dependency -->
<!-- to the project won't make unit tests silently skipped -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment regarding the message.

</excludes>
</bannedDependencies>
</rules>
<fail>true</fail>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default is true so possible we could skip this.

<!-- Only remove this rule if you confirmed that adding jupiter dependency -->
<!-- to the project won't make unit tests silently skipped -->
<execution>
<id>ban-jupiter</id>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to put the rule in a separate execution? We could merge enforce-banned-dependencies and ban-jupiter and it would lead to less boilerplate code.

@abstractdog
Copy link
Contributor Author

I like the idea but based on the test failures it seems that we already have jupiter dependencies in the project so we have to revisit those.

Other than that left some minor suggestions for potential improvements.

thanks for the comments, finally, even if I wanted to ban the dependency globally so bad, I had to face that we do use the jupiter api extensively in some modules, so I ended banning it from itests/hive-unit, where it caused the problem all the time

there how I ended up with: 8e57d3b

Copy link

@abstractdog abstractdog changed the title HIVE-29043: Ban the Jupiter dependency to prevent unit tests from being skipped HIVE-29043: Ban the Jupiter dependency from hive-unit to prevent unit tests from being skipped Jun 26, 2025
@abstractdog abstractdog requested a review from zabetak June 26, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants