From: Daz DeBoer [mailto:darrell.deb...@gradleware.com] Sent: Friday, July 18, 2014 10:41 AM To: dev@gradle.codehaus.org Subject: Re: [gradle-dev] Confused by part of userguide build process
On Fri, Jul 18, 2014 at 10:28 AM, KARR, DAVID <dk0...@att.com<mailto:dk0...@att.com>> wrote: I’m seeing a new failure symptom this morning. This is what I’m running: gradle :integTest:integTest --tests org.gradle.integtests.samples.UserGuideSamplesIntegrationTest –info This is failing with: org.gradle.integtests.samples.UserGuideSamplesIntegrationTest > initializationError FAILED java.lang.AssertionError: Couldn't find any samples. Most likely, samples.xml was not generated. Please run 'gradle docs:userguideDocbook' first. Expression: assertion. Values: assertion = false I’ve tried running both “gradle docs:userguide” and “gradle docs:userguideDocbook” before this, but it makes no difference. I even tried the latter with “—rerun-tasks”. I also looked for a “samples.xml” and found this: % ls -lt ./subprojects/docs/build/src/samples.xml -rwxr-xr-x+ 1 dk068x Domain Users 68 Jul 18 07:32 ./subprojects/docs/build/src/samples.xml* However, this file is essentially empty: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <samples/> At this point, I did a “gradle clean” and then verified that the “samples.xml” file was gone. I then reran “docs:userguide” and then inspected the resulting “samples.xml” file. It was over 60k bytes, but I didn’t inspect the file. I then reran my integTest run. It failed in the same way. I then reinspected the “samples.xml” file, and it appears that the integTest run actually changed that file back to the almost empty version. I seem to recall hitting something similar at one stage, but I didn't investigate further. IIRC there was a bug in our build logic that meant the order that tasks were run in was important. Following your lead, I can confirm this is an issue. To reproduce run: ./gradlew clean ./gradlew :docs:userguide ./gradlew :integTest:integTest --tests org.gradle.integtests.samples.UserGuideSamplesIntegrationTest It seems like something is clearing the samples.xml file early in the integTest run, but the :docs:userguideDocbook task is considered UP-TO-DATE so it doesn't regenerate it.If you wanted to dig deeper to see exactly which tasks are causing this problem, it would be most appreciated. Even to just know the minimal set of tasks that trigger this condition would help. I tried to set “org.gradle.userguide.samples.filter” to a pattern that won’t (likely) match anything, so I could check what happens when it doesn’t execute any sample tests. Unfortunately, that didn’t work. It seemed to ignore that property. I then simply tried refreshing the view of the “samples.xml” file, watching when it hit the bad state, and just refreshing my output file, so I get a rough idea of what point is just past when it did something wrong. This is an excerpt from the log that shows what the last line was in the log right after refreshing when I saw the bad file state (I then refreshed again to get more of the file): Skipping task ':core:processTestFixturesResources' as it has no source files. :core:processTestFixturesResources UP-TO-DATE :core:processTestFixturesResources (Thread[Daemon Thread 13,5,main]) completed. Took 0.002 secs. :core:testFixturesClasses (Thread[Daemon Thread 13,5,main]) started. :core:testFixturesClasses Skipping task ':core:testFixturesClasses' as it has no actions. :core:testFixturesClasses (Thread[Daemon Thread 13,5,main]) completed. Took 0.0 secs. :docs:samplesDocbook (Thread[Daemon Thread 13,5,main]) started. :docs:samplesDocbook Skipping task ':docs:samplesDocbook' as it is up-to-date (took 0.371 secs). :docs:samplesDocbook UP-TO-DATE :docs:samplesDocbook (Thread[Daemon Thread 13,5,main]) completed. Took 0.38 secs. :docs:userguideDocbook (Thread[Daemon Thread 13,5,main]) started. :docs:userguideDocbook // This was the last line. Skipping task ':docs:userguideDocbook' as it is up-to-date (took 0.484 secs). :docs:userguideDocbook UP-TO-DATE How could I modify the test so that I can put code that shows the size of the “samples.xml” file after every sample is processed?