[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
GitHub user jon-bell opened a pull request:

    https://github.com/apache/maven-surefire/pull/161

    SUREFIRE-1396: Provider class path is incorrect for custom provider in Failsafe

    Hi,
    When using a custom Surefire provider with Surefire (not Failsafe), the "provider classpath" contains only the provider and surefire-api. However, when using a custom provider with Failsafe, the provider class path ends up including a lot more... it seems like perhaps all plugins that are loaded? This has caused some mayhem for me when using a custom provider in projects that use a specific version of SLF4J... because then failsafe forces 1.5.6 to be loaded (from this process of incorrectly finding the custom provider), causing a crash.
   
    This PR contains an integration test case showing the bug and a patch to solve it.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jon-bell/maven-surefire SUREFIRE-1396

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-surefire/pull/161.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #161
   
----
commit 04f66cdd828d131a028eb400d1ed26fe104fe3f2
Author: Jonathan Bell <[hidden email]>
Date:   2017-07-25T03:43:36Z

    SUREFIRE-1396: Test case demonstrating broken handling of classpath for custom runners in failsafe, plus a fix

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/161#discussion_r130444914
 
    --- Diff: surefire-integration-tests/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/pom.xml ---
    @@ -0,0 +1,61 @@
    +<!--
    +  ~ Licensed to the Apache Software Foundation (ASF) under one
    +  ~ or more contributor license agreements.  See the NOTICE file
    +  ~ distributed with this work for additional information
    +  ~ regarding copyright ownership.  The ASF licenses this file
    +  ~ to you under the Apache License, Version 2.0 (the
    +  ~ "License"); you may not use this file except in compliance
    +  ~ with the License.  You may obtain a copy of the License at
    +  ~
    +  ~     http://www.apache.org/licenses/LICENSE-2.0
    +  ~
    +  ~ Unless required by applicable law or agreed to in writing,
    +  ~ software distributed under the License is distributed on an
    +  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +  ~ KIND, either express or implied.  See the License for the
    +  ~ specific language governing permissions and limitations
    +  ~ under the License.
    +  -->
    +
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +  <modelVersion>4.0.0</modelVersion>
    +
    +  <groupId>org.apache.maven.plugins.surefire</groupId>
    +  <artifactId>surefire-test-classpath-provider</artifactId>
    +  <version>1.0-SNAPSHOT</version>
    +  <name>Test provider</name>
    +
    +  <properties>
    +    <surefire.version>2.21-SNAPSHOT</surefire.version>
    --- End diff --
   
    Pls do not use this property. It comes from [parent pom](https://github.com/apache/maven-surefire/blob/master/surefire-integration-tests/src/test/resources/pom.xml).
    Did you run the build like this `mvn install -P run-its`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
In reply to this post by Tibor17-2
Github user jon-bell commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/161#discussion_r130446456
 
    --- Diff: surefire-integration-tests/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/pom.xml ---
    @@ -0,0 +1,61 @@
    +<!--
    +  ~ Licensed to the Apache Software Foundation (ASF) under one
    +  ~ or more contributor license agreements.  See the NOTICE file
    +  ~ distributed with this work for additional information
    +  ~ regarding copyright ownership.  The ASF licenses this file
    +  ~ to you under the Apache License, Version 2.0 (the
    +  ~ "License"); you may not use this file except in compliance
    +  ~ with the License.  You may obtain a copy of the License at
    +  ~
    +  ~     http://www.apache.org/licenses/LICENSE-2.0
    +  ~
    +  ~ Unless required by applicable law or agreed to in writing,
    +  ~ software distributed under the License is distributed on an
    +  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +  ~ KIND, either express or implied.  See the License for the
    +  ~ specific language governing permissions and limitations
    +  ~ under the License.
    +  -->
    +
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +  <modelVersion>4.0.0</modelVersion>
    +
    +  <groupId>org.apache.maven.plugins.surefire</groupId>
    +  <artifactId>surefire-test-classpath-provider</artifactId>
    +  <version>1.0-SNAPSHOT</version>
    +  <name>Test provider</name>
    +
    +  <properties>
    +    <surefire.version>2.21-SNAPSHOT</surefire.version>
    +  </properties>
    +  <dependencies>
    +    <dependency>
    +      <groupId>org.apache.maven.surefire</groupId>
    +      <artifactId>surefire-api</artifactId>
    +      <version>${surefire.version}</version>
    +    </dependency>
    +  </dependencies>
    +
    +  <build>
    +    <resources>
    +      <resource>
    +        <directory>src/main/resources/META-INF</directory>
    +        <targetPath>META-INF</targetPath>
    +      </resource>
    +    </resources>
    +    <plugins>
    +      <plugin>
    +        <groupId>org.apache.maven.plugins</groupId>
    +        <artifactId>maven-compiler-plugin</artifactId>
    --- End diff --
   
    Thanks. I will clean this up. FYI, the entire pom.xml is copied from the [SUREFIRE-141  IT pom.xml](https://github.com/apache/maven-surefire/blob/cba4adb1b93002c5b4bb2d2f22f461cc53bd8738/surefire-integration-tests/src/test/resources/surefire-141-pluggableproviders-provider/pom.xml).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
In reply to this post by Tibor17-2
Github user Tibor17 commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/161#discussion_r130488490
 
    --- Diff: surefire-integration-tests/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/pom.xml ---
    @@ -0,0 +1,61 @@
    +<!--
    +  ~ Licensed to the Apache Software Foundation (ASF) under one
    +  ~ or more contributor license agreements.  See the NOTICE file
    +  ~ distributed with this work for additional information
    +  ~ regarding copyright ownership.  The ASF licenses this file
    +  ~ to you under the Apache License, Version 2.0 (the
    +  ~ "License"); you may not use this file except in compliance
    +  ~ with the License.  You may obtain a copy of the License at
    +  ~
    +  ~     http://www.apache.org/licenses/LICENSE-2.0
    +  ~
    +  ~ Unless required by applicable law or agreed to in writing,
    +  ~ software distributed under the License is distributed on an
    +  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +  ~ KIND, either express or implied.  See the License for the
    +  ~ specific language governing permissions and limitations
    +  ~ under the License.
    +  -->
    +
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +  <modelVersion>4.0.0</modelVersion>
    +
    +  <groupId>org.apache.maven.plugins.surefire</groupId>
    +  <artifactId>surefire-test-classpath-provider</artifactId>
    +  <version>1.0-SNAPSHOT</version>
    +  <name>Test provider</name>
    +
    +  <properties>
    +    <surefire.version>2.21-SNAPSHOT</surefire.version>
    --- End diff --
   
    You should specify parent pom
    ```
    <parent>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>it-parent</artifactId>
        <version>1.0</version>
        <relativePath>../pom.xml</relativePath>
      </parent>
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
In reply to this post by Tibor17-2
Github user jon-bell commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/161#discussion_r130497860
 
    --- Diff: surefire-integration-tests/src/test/resources/surefire-1396-pluggableproviders-classpath-provider/pom.xml ---
    @@ -0,0 +1,61 @@
    +<!--
    +  ~ Licensed to the Apache Software Foundation (ASF) under one
    +  ~ or more contributor license agreements.  See the NOTICE file
    +  ~ distributed with this work for additional information
    +  ~ regarding copyright ownership.  The ASF licenses this file
    +  ~ to you under the Apache License, Version 2.0 (the
    +  ~ "License"); you may not use this file except in compliance
    +  ~ with the License.  You may obtain a copy of the License at
    +  ~
    +  ~     http://www.apache.org/licenses/LICENSE-2.0
    +  ~
    +  ~ Unless required by applicable law or agreed to in writing,
    +  ~ software distributed under the License is distributed on an
    +  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +  ~ KIND, either express or implied.  See the License for the
    +  ~ specific language governing permissions and limitations
    +  ~ under the License.
    +  -->
    +
    +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    +  <modelVersion>4.0.0</modelVersion>
    +
    +  <groupId>org.apache.maven.plugins.surefire</groupId>
    +  <artifactId>surefire-test-classpath-provider</artifactId>
    +  <version>1.0-SNAPSHOT</version>
    +  <name>Test provider</name>
    +
    +  <properties>
    +    <surefire.version>2.21-SNAPSHOT</surefire.version>
    --- End diff --
   
    Sorry about that - hadn't noticed that it wasn't specified. Added it to both the provider and the test project.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire issue #161: SUREFIRE-1396: Provider class path is incorrect f...

Tibor17-2
In reply to this post by Tibor17-2
Github user jon-bell commented on the issue:

    https://github.com/apache/maven-surefire/pull/161
 
    Done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire issue #161: SUREFIRE-1396: Provider class path is incorrect f...

Tibor17-2
In reply to this post by Tibor17-2
Github user jon-bell commented on the issue:

    https://github.com/apache/maven-surefire/pull/161
 
    @Tibor17 It seems like it had worked for me because I had previously executed a `mvn install` - I see on a clean maven repo the problem.
   
    It looks like the `SurefireLauncher` does not unpack/install the parent pom into the `it-repo`, and hence, the forked maven process can't find the parent pom (once it's installed). I am hesitant to poke at this further, because I suspect a fix might involve some changes to `SurefireLauncher` to coerce it to install the parent pom into the `it-repo` as well. This seems to not be a problem for any test packages, but is for a provider (which gets the forked Maven classloader instead of the test classloader). Given that the only other provider in the repo for integration tests *does not* reference the parent pom, I assume that this is a problem that someone came upon before and sidestepped.
   
    I've removed the parent reference that you had suggested above. But, we are properly picking up `surefire.version` from the maven system property. On a clean maven repo the `mvn clean install -P run-its` completed with this version (now again squashed). I agree that referencing the parent pom is a cleaner solution, but I'm not sure if you/we want to go down the road of patching the integration test harness to support that (for what amounted to a ~3 line patch).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire issue #161: SUREFIRE-1396: Provider class path is incorrect f...

Tibor17-2
In reply to this post by Tibor17-2
Github user jon-bell commented on the issue:

    https://github.com/apache/maven-surefire/pull/161
 
    @Tibor17 Let me know if there is anything else I can do on this.
   
    Thanks
    Jonathan


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire issue #161: SUREFIRE-1396: Provider class path is incorrect f...

Tibor17-2
In reply to this post by Tibor17-2
Github user Tibor17 commented on the issue:

    https://github.com/apache/maven-surefire/pull/161
 
    @jon-bell
    Ok, now your IT passed. I will run whole test set now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] maven-surefire pull request #161: SUREFIRE-1396: Provider class path is inco...

Tibor17-2
In reply to this post by Tibor17-2
Github user asfgit closed the pull request at:

    https://github.com/apache/maven-surefire/pull/161


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [hidden email] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]