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

[tests] Report errors last in RunApkTests #1596

Merged
merged 1 commit into from
Apr 24, 2018

Conversation

jonpryor
Copy link
Member

Context: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2963/testReport/

A build for PR #1489 ran 1110 tests; it should have run over 35,000.
Where are the missing tests?

What's missing are the .apk on-device tests; BCL tests make up
most of our expected test count.

Analysis of the build log shows that the on-device tests are
running, with test results being downloaded:

…/android-toolchain/sdk/platform-tools/adb -s emulator-5570  pull "/data/data/Xamarin.Android.Bcl_Tests/files/.__override__/TestResults.xUnit.xml" "…/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Bcl_Tests.xunit.xml"
...
/data/data/Xamarin.Android.Bcl_Tests/files/.__override__/TestResults.xUnit.xml: 1 file pulled. 53.5 MB/s (3273412 bytes in 0.058s)

but those results don't appear on the testReport URL.

The problem is that the RenameApkTestCases target is never being
executed, and the RenameApkTestCases is responsible for copying the
TestResult* files where Jenkins looks for them:

Done building target "ReleaseAndroidTarget" in project "RunApkTests.targets" -- FAILED.:

The RenameApkTestCases target executes after
ReleaseAndroidTarget, but because ReleaseAndroidTarget failed, the
RenameApkTestCases target isn't executed.

Meanwhile, ReleaseAndroidTarget reports an error to ensure that
errors aren't overlooked; see commit 3b893cd.

Allow the RenameApkTestCases target to execute by adding a new
ReportComponentFailures target. The ReleaseAndroidTarget will no
longer report errors, allowing the RenameApkTestCases target to
execute, while if any tests do fail, the ReportComponentFailures
target will generate an appropriate error.

Context: https://jenkins.mono-project.com/job/xamarin-android-pr-builder/2963/testReport/

A build for PR dotnet#1489 ran 1110 tests; it *should* have run over 35,000.
Where are the missing tests?

What's missing are the `.apk` on-device tests; BCL tests make up
*most* of our expected test count.

Analysis of the build log shows that the on-device tests *are*
running, with test results being downloaded:

	…/android-toolchain/sdk/platform-tools/adb -s emulator-5570  pull "/data/data/Xamarin.Android.Bcl_Tests/files/.__override__/TestResults.xUnit.xml" "…/xamarin-android/tests/../bin/TestDebug/TestResult-Xamarin.Android.Bcl_Tests.xunit.xml"
	...
	/data/data/Xamarin.Android.Bcl_Tests/files/.__override__/TestResults.xUnit.xml: 1 file pulled. 53.5 MB/s (3273412 bytes in 0.058s)

but those results don't appear on the `testReport` URL.

The problem is that the `RenameApkTestCases` target is never being
executed, and the `RenameApkTestCases` is responsible for copying the
`TestResult*` files where Jenkins looks for them:

	Done building target "ReleaseAndroidTarget" in project "RunApkTests.targets" -- FAILED.:

The `RenameApkTestCases` target executes *after*
`ReleaseAndroidTarget`, but because `ReleaseAndroidTarget` failed, the
`RenameApkTestCases` target isn't executed.

Meanwhile, `ReleaseAndroidTarget` reports an error to ensure that
errors aren't overlooked; see commit 3b893cd.

Allow the `RenameApkTestCases` target to execute by adding a new
`ReportComponentFailures` target. The `ReleaseAndroidTarget` will no
longer report errors, allowing the `RenameApkTestCases` target to
execute, while if any tests *do* fail, the `ReportComponentFailures`
target will generate an appropriate error.

Furthermore, update all the `<MSBuild/>` invocations within
`RunTests.targets` and add `ContinueOnError="ErrorAndContinue"` to all
of them, to help ensure that we run all the tests we have, even if
previous tests fail.
@jonpryor jonpryor force-pushed the jonp-apk-errors-last branch from 0ce653a to b1256fe Compare April 24, 2018 15:44
@jonathanpeppers jonathanpeppers self-requested a review April 24, 2018 15:46
@grendello grendello merged commit 4a85391 into dotnet:master Apr 24, 2018
jonpryor added a commit that referenced this pull request Apr 25, 2018
jonpryor added a commit that referenced this pull request Apr 25, 2018
Reverts commit 4a85391

Commit 4a85391 [broke the build][0]:

[0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/967/

	xamarin-android/build-tools/scripts/TestApks.targets(223,5): error : Root element is missing
	...
	ERROR: Step ‘Publish xUnit test result report’ aborted due to exception: 
	org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Premature end of file.
	        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
	        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
	        at org.jenkinsci.lib.dtkit.util.converter.ConversionService.convert(ConversionService.java:316)
	Caused: org.jenkinsci.lib.dtkit.util.converter.ConversionException: Error to convert - A file not found
	        at org.jenkinsci.lib.dtkit.util.converter.ConversionService.convert(ConversionService.java:358)
	...
	Finished: FAILURE

Revert until we can better test things.
@jonpryor jonpryor deleted the jonp-apk-errors-last branch April 27, 2018 19:36
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants