You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Cédric Champeau (Jira)" <ji...@apache.org> on 2020/10/11 09:37:00 UTC

[jira] [Commented] (GROOVY-9774) Rework gradle build to use modern conventions - test remediation

    [ https://issues.apache.org/jira/browse/GROOVY-9774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17211858#comment-17211858 ] 

Cédric Champeau commented on GROOVY-9774:
-----------------------------------------

I indeed faced a number of issues with the `@Grab` tests. Lots of them were already failing my my computer because they all use the same local ivy home cache. They are order dependent. To workaround this issue, I had to make a couple of changes:

 
 * each test needs to run into its own user directory: [https://github.com/melix/groovy/blob/c3922e4938eda826c0a0417b82e0ef6acde392c3/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle#L56]
 * each test uses its own grape directory:[https://github.com/melix/groovy/blob/c3922e4938eda826c0a0417b82e0ef6acde392c3/buildSrc/src/main/groovy/org.apache.groovy-tested.gradle#L54]

This way they are isolated (but each of them will redownload dependencies, which is painful for some reproducers which use Grape internally)

> Rework gradle build to use modern conventions - test remediation
> ----------------------------------------------------------------
>
>                 Key: GROOVY-9774
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9774
>             Project: Groovy
>          Issue Type: Task
>            Reporter: Paul King
>            Assignee: Cédric Champeau
>            Priority: Major
>             Fix For: 4.0.0-alpha-2
>
>         Attachments: screenshot-1.png, screenshot-2.png, screenshot-3.png, screenshot-4.png, screenshot-5.png, screenshot-6.png
>
>
> The various build scripts and associated artifacts have been written by numerous folks targeting numerous versions of Gradle over many years. The styles have drifted apart and some places use very old conventions/style. We should consolidate/update as needed.
> *Cloned* to track some differences in test results. We aren't necessarily attempting to get like for like - perhaps some tests weren't running correctly previously - we should at least understand differences.
> These are sporadic - e.g. aren't happening on the CI server right now. We are changing global config for grapes, e.g.
> https://github.com/apache/groovy/blob/master/src/test/groovy/grape/GrapeIvyTest.groovy#L298
> Perhaps we need to isolate that test better.
> Some Grape tests (package groovy.grape) run differently. Old:
>  !screenshot-1.png! 
> New ({{testAutoDownloadGrapeConfig}} was split in three to better isolate the failure):
>  !screenshot-2.png! 
> Related failure in {{groovy.bugs.Groovy8060Bug}}. Old:
>  !screenshot-3.png! 
> New:
>  !screenshot-4.png! 
> With stacktrace (shown for Windows):
> {noformat}
> BUG! exception in phase 'conversion' in source unit 'TestScript10.groovy' null
> ...
> at groovy.bugs.Groovy8060Bug.testLoggingWithinClosuresThatAreMethodArgsShouldHaveGuards(Groovy8060Bug.groovy:25)
> ...
> Caused by: java.nio.file.NoSuchFileException: D:\projects\groovy\build\tmp\test\grape\grapes\org.slf4j\slf4j-simple\jars\slf4j-simple-1.7.25.jar
> ...
> at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:264)
> {noformat}
> Jar does appear to be there after the build and test passes in isolation.
> The {{groovy.bugs.Groovy6932Bug}} test class also fails sporadically but runs in isolation:
> {noformat}
> General error during conversion: Error grabbing Grapes -- [download failed: org.slf4j#slf4j-simple;1.7.25!slf4j-simple.jar]
> ...
> at groovy.bugs.Groovy6932Bug.testLoggingWithinClosuresShouldHaveGuards(Groovy6932Bug.groovy:25)
> {noformat}
> The {{groovy.grape.GrapeClassLoaderTest}} test class also fails sporadically but runs in isolation:
> {noformat}
> java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: com.jidesoft#jide-oss;[2.2.1,2.3): not found]]
> at groovy.grape.GrapeIvy.getDependencies(GrapeIvy.groovy:455)
> ...
> at groovy.grape.GrapeClassLoaderTest.downloadToCache(GrapeClassLoaderTest.groovy:29)
> {noformat}
> The following is also different:
>  !screenshot-5.png! 
> but was:
>  !screenshot-6.png! 
> This change was intentional. A {{@Ignore}} was added. Just noting it here while we confirm we are happy with the implications.
> The Spec tests are also not being run (~480 tests). Nor can they be run individually, e.g. two examples below:
> {noformat}
> > No tests found for given includes: [CommandChainsTest](--tests filter)
> > No tests found for given includes: [typing.OptionalTypingTest](--tests filter)
> {noformat}
> Yet, {{org.apache.groovy-tested.gradle}} does seem to be invoked for the root and all sub-projects.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)