[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell Yeah, I have released 2.20.1 and I had to postpone this issue for 2.21.1. OOM was fixed in 2.20.1 and users could not wait longer. This included Java9 support. Java 9 is out and I want to release Surefire 2.21.0.Jigsaw in next few days which has higher priority. And then Surefire 2.21.1 is planed for your and other pull request fixed as well. Then 2.21.2 will fix a blocker issue, and then we will concentrate on 3.0.0.M1 and JUnit5. So this is my plan. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 - any updates? --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 I see what you're going for, that makes sense. I've update my PR to just include IT contents now, with an improved IT that emulates a scenario where working copy changes are made (i.e. install a multi-module project, modify the contents to add more tests, test the modified contents). If your solution gets my IT PR to pass, I think the solution will cover my bona fide scenarios. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell My tests passed on this code. I have to continue to develop and refactor more. List testDepends = project.getTestArtifacts(); removeReactorDependencies( session.getSortedProjects(), testDepends.iterator() ); List dependenciesToScan = filter( testDepends, asList( getDependenciesToScan() ) ); TestListResolver testFilter = getIncludedAndExcludedTests(); DefaultScanResult scanResult = new DependencyScanner( dependenciesToScan, testFilter ).scan(); for ( MavenProject project : session.getSortedProjects() ) { if ( !"pom".equals( project.getPackaging() ) && !containsProjectArtifact( testDepends, project ) ) { // zapracuj getDependenciesToScan() File reactorChildProjectOutputDir = new File( project.getBuild().getOutputDirectory() ); if ( reactorChildProjectOutputDir.isDirectory() ) { DirectoryScanner scanner = new DirectoryScanner( reactorChildProjectOutputDir, testFilter ); scanResult = scanResult.append( scanner.scan() ); } } } --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell I will try by myself. I will let you know with new branch and we can discuss it. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 I don't think that logic would work for my scenario. For example: 1. Create multi-module project with a test runner JAR (a la `org.apache.maven.surefire:surefire-1383:1.0-SNAPSHOT`) 2. Recursively run the `install` goal over the multi-module project 3. Modify the test runner module (`org.apache.maven.surefire:surefire-1383-runner:1.0-SNAPSHOT`) 4. Run the `test` goal over the multi-module project According to your logic, Surefire would prefer the already-installed artifact, effectively ignoring those changes made in step 3. That would put us right back where we started. Using my logic, Surefire would prefer the working copy changes and execute accordingly. Since the existing `DependencyScanner` doesn't support classifiers as written, I don't think my approach is introducing any new limitations there. `DependencyScanner.java:114` ``` String[] groupArtifact = groups.split( ":" ); if ( groupArtifact.length != 2 ) { throw new IllegalArgumentException(...); } ``` --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell It would be easier for you not to rever 569 in this PR but create a new PR from master. I pushed a new fix to master today. The master will be idle for you. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell I found the root cause. The dependency to scan is examined with outputDirectory, but IT 569 has shources to share in `src/test/java` so the artifact would match but that's the reason why `target/surefire-reports` is not found because your code scans `Surefire569RunTestFromDependencyJarsIT_shouldScanAndRunTestsInDependencyJars\testjar\target\classes`. I think you have to check it classifier `tests` exists which results to file name `testjar-0.0.1-SNAPSHOT-tests.jar`. Additionally you should exclude packaging `pom` from the scan. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 - IT569 does not **fail** when introducing my changes. But since the test was written as a single lifecycle, it inadvertently uses the code I've introduced in this PR ([see comment above](#issuecomment-312972256)). The only changes to IT569 were to split the single lifecycle in to multiple lifecycles. While there, I tried to clean up the test resources to match current standards/conventions. But those changes to IT569 were to preserve its named intent: run tests from a dependency jar. Looks like two options to me: 1. Leave PR as is with minimally modified IT569 2. Revert IT569 to original state, add a new version of IT569 which executes in multiple lifecycles and delete IT1383 (as it would be entirely redundant of IT569). --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell I built the project. It was ok but then I realized you modified IT 569 which I do not like because this was a feature and I want to guarantee that old tests pass without modification and additionally I have to find out if our contributors mask some of their hidden errors. I or we have to find the root cause why 569 fails with your changes. We should debug your code and then fix it. The changes on 569 you have done are interesting but I prefer to add a new one very similar like "surefire-569-RunTestFromInstalledJar". --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @JoelNGeorge @owenfarrell Pls let me run the build and next steps. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user JoelNGeorge commented on the issue: https://github.com/apache/maven-surefire/pull/157 I have the exact same issue. This fix is very much appreciated. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 - thoughts? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 @owenfarrell I have not had yet. I am reviewing other in parallel. I will have a look in few days. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 - Have you had a chance to review this PR? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 And I got busy with other work as well. I think I found a solution that doesn't completely violate the pattern used by integration tests. Long story short, the IT for SUREFIRE-569 has been updated to be completely independent modules. The first module leverages the flatten plugin to avoid any parent references, which then allows the second module to complete successfully. The IT for SUREFIRE-1383 executes within a single process and verifies the updates that I've proposed. Sorry for all the noise on the ticket - I hosed my fork while making the last round of updates. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 I have been busy with other ticket. Where did we finish. Do you need a help? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 Copying the `it-parent` POM over to the output directory as part of [MavenLauncher.simpleExtractResources](https://github.com/apache/maven-surefire/blob/master/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/fixture/MavenLauncher.java#L448) doesn't support resolving `it-parent` as part of a dependency. Would it make sense to open a separate issue/enhancement for installing the `it-parent` artifact in the IT repo? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 I don't follow. When I run an install from any level, the `org.apache.maven.surefire:it-parent:1.0:pom` artifact (surefire-integration-tests/src/test/resources/pom.xml) does not get installed in to the IT repo (surefire-setup-integration-tests/target/it-repo). Am I missing something? In order to execute an IT across multiple lifecycles, that POM needs to be installed it in to the local repository specified by failsafe. It looks to me like every IT that references `it-parent` does so via a relative path (explicitly or by default). They never have to rely on the artifact resolver. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 No, no. No worries. You should build entire project `mvn install` and not the individual IT. The ITs cannot run separately, you can trigger it from building entire project from root in git. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 One workaround for this would be to install the missing `it-parent` POM as part of my first lifecycle (i.e. mid-test). But this seems kind of hacky. ``` surefire-569-testjar ... org.apache.maven.plugins maven-install-plugin install-file install ${project.basedir}/../pom.xml ${project.basedir}/../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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 Looking at it a bit deeper, looks like the root cause is that the `it-parent` POM is not installed in the IT repo. The issue isn't the dependency itself. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 I've put together an integration test that can validate the execution of [SUREFIRE-1383](https://issues.apache.org/jira/browse/SUREFIRE-1383). And all is good on that front. While I was poking around the other ITs, I tripped on the IT for [SUREFIRE-569](https://issues.apache.org/jira/browse/SUREFIRE-569). As written, the IT passes just fine. But the changes that I'm proposing make that test case moot - it uses the same packaging structure of 2 projects built within a single session. I updated that test case to better reflect the original ask of scanning **_JAR_** dependencies, but that means splitting the test case execution in to 2 separate lifecycles. When I split the single lifecycle in to 2, I'm running in to a dependency resolution issue. For whatever reason, the second execution is unable to locate artifacts installed in the IT repo as part of the first lifecycle. In looking around at the other ITs, it looks like this is the only test case that runs an install goal and **_is then dependent on the result of that install_**. Thoughts? ``` mvn -Dit.test=**/Surefire569RunTestFromDependencyJarsIT.java,**/Surefire1383ScanSessionDependenciesIT.java clean integration-test` ... [DEBUG] Using local repository at //maven-surefire/surefire-integration-tests/../surefire-setup-integration-tests/target/it-repo ... [ERROR] Failed to execute goal on project surefire-569-module1: Could not resolve dependencies for project org.apache.maven.surefire:surefire-569-module1:jar:1.0: Failed to collect dependencies at org.apache.maven.surefire:surefire-569-testjar:jar:tests:1.0: Failed to read artifact descriptor for org.apache.maven.surefire:surefire-569-testjar:jar:tests:1.0: Failure to find org.apache.maven.surefire:it-parent:pom:1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project surefire-569-module1: Could not resolve dependencies for project org.apache.maven.surefire:surefire-569-module1:jar:1.0: Failed to collect dependencies at org.apache.maven.surefire:surefire-569-testjar:jar:tests:1.0 ``` --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 Would you add integration test? See the module `surefire-integration-tests` and `src/test/java/org/apache/maven/surefire/its/jiras`. It's easy. Pickup some existing test, e.g. `Surefire34SecurityManagerIT`, and just inherit `SurefireJUnit4IntegrationTestCase`and see the folder `surefire-34-securityManager` in `test/resources`. Your IT will have the same principle. The point is to start `surefire-34-securityManager/pom.xml` as embedded or forked maven process from `Surefire34SecurityManagerIT`. I guess you want to test that multi-module Maven project will have own classes propagated from child modules one one dedicated module where Surefire has tests. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user owenfarrell commented on the issue: https://github.com/apache/maven-surefire/pull/157 @Tibor17 - 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[GitHub] maven-surefire issue #157: SUREFIRE-1383 dependenciesToScan Does Not Leverag...
Github user Tibor17 commented on the issue: https://github.com/apache/maven-surefire/pull/157 Pls squash both commits to one. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org