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

[SUREFIRE-2006] Don't use Services Transformer in shadefire #462

Merged
merged 1 commit into from Feb 10, 2022

Conversation

slawekjaranowski
Copy link
Member

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace SUREFIRE-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

@Tibor17
Copy link
Contributor

Tibor17 commented Feb 9, 2022

It's good that you have looked at it.
After checking the original content of the JAR, the SPI was there 4 times and the sources too.
Now it is without duplicates of *.class and SPI?

The POJO test should not be modified like this because the users will not use the ShadeFire provider. This provider was developed mainly for our internal purposes. The POJO does not need to have any JUnit dependency and no provider because it assumes that the tests are so simple where the public test methods start with name test.
Anyway, if you like to test the ShadeFire, it's good but we should also keep the original IT and this can be accomplished by adding a new Maven profile for ShadeFire in the IT's POM which is maybe the most simple solution.

@Tibor17
Copy link
Contributor

Tibor17 commented Feb 9, 2022

Maybe it is a bug in the maven-shade-plugin, WDYT?

@slawekjaranowski
Copy link
Member Author

@slawekjaranowski
Copy link
Member Author

slawekjaranowski commented Feb 9, 2022

  • *.class are not duplicated
  • we have one additional service - from original jar - MasterProcessChannelProcessorFactory
shade/META-INF/services/
├── org.apache.maven.shadefire.surefire.spi.MasterProcessChannelProcessorFactory
├── org.apache.maven.surefire.api.provider.SurefireProvider
└── org.apache.maven.surefire.spi.MasterProcessChannelProcessorFactory

I hope it is not issue

@Tibor17
Copy link
Contributor

Tibor17 commented Feb 9, 2022

Anyway, if you like to test the ShadeFire, it's good but we should also keep the original IT and this can be accomplished by adding a new Maven profile for ShadeFire in the IT's POM which is maybe the most simple solution.

@slawekjaranowski
Copy link
Member Author

I will fix duplicate services and prepare separate IT test

@slawekjaranowski
Copy link
Member Author

Fixed:

  • there are no duplicated services
  • new IT test

<name>shadefire usage test</name>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we can open more alternatives for test errors if we build the sources against ${java.specificaation.version}.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is your proposition?
Most of IT tests have the same, even with 1.7

Copy link
Contributor

@Tibor17 Tibor17 Feb 10, 2022

Choose a reason for hiding this comment

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

The old tests with j7 are old tests, that's the history.
Once, Robert Scholte provided an integration test with

<maven.compiler.source>${java.specificaation.version}</maven.compiler.source>
<maven.compiler.target>${java.specificaation.version}</maven.compiler.target>

It was very interesting configuration. We know that the bytecode is not always the same beween versions which is good for us because we can find more bugs in these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants