Skip to content

[tests] Run the Java.Interop unit tests #565

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

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

jonpryor
Copy link
Contributor

We'd like to run the Java.Interop unit tests as part of the
xamarin-android make run-all-tests target, for two rasons:

  1. An extra layer of sanity checking, and
  2. Some of the Java.Interop tests require an Android SDK.

In particular, the
ParameterFixupTests.XmlDeclaration_FixedUpFromDocumentation() test
from Xamarin.Android.Tools.Bytecode-Tests.dll attempts to read
Android documentation from $ANDROID_SDK_PATH to test parameter name
fixups.

However, Java.Interop doesn't install -- and thus can't readily
require -- an Android SDK, meaning this test is never executed as part
of the Java.Interop Jenkins process.

That test can be readily executed in xamarin-android, as it does
install an Android SDK, and thus its presence can be assumed.

Add a new make run-ji-tests target which runs the Java.Interop unit
tests, copying their test output into the same directory that the
other TestResult-*.xml files are placed, so that Jenkins can pick
them up for display.

Within the make run-ji-tests target, export the ANDROID_SDK_PATH
environment variable so that all the
Xamarin.Android.Tools.Bytecode-Tests.dll tests can execute.

Which introduces one problem: the
Xamarin.Android.Tools.Bytecode-Tests.dll tests require that
$ANDROID_SDK_PATH contain documentation...which we're not currently
installing.

Result: the ParameterFixupTest tests fail. :-(

Fix this conundrum by instaslling docs-24_r01.zip within
$(AndroidSdkDirectory), allowing the tests to execute as intended.

@jonpryor
Copy link
Contributor Author

Note: this PR will require merging a separate Java.Interop PR:

dotnet/java-interop#142

then updating this PR to include a Java.Interop bump.

@jonpryor jonpryor force-pushed the jonp-docs-24 branch 2 times, most recently from 9db38b0 to 67be8b9 Compare April 21, 2017 02:17
Copy link
Contributor

@atsushieno atsushieno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks clean enough.

@atsushieno
Copy link
Contributor

build

Bump to Java.Interop/master/8d7060d1
Bump to cecil/master/5f93431f

We'd like to run the Java.Interop unit tests as part of the
xamarin-android `make run-all-tests` target, for two rasons:

1. An extra layer of sanity checking, and
2. Some of the Java.Interop tests require an Android SDK.

In particular, the
`ParameterFixupTests.XmlDeclaration_FixedUpFromDocumentation()` test
from `Xamarin.Android.Tools.Bytecode-Tests.dll` attempts to read
Android documentation from `$ANDROID_SDK_PATH` to test parameter name
fixups.

However, Java.Interop doesn't install -- and thus can't readily
require -- an Android SDK, meaning this test is never executed as part
of the Java.Interop Jenkins process.

That test *can* be readily executed in xamarin-android, as it *does*
install an Android SDK, and thus its presence can be assumed.

Add a new `make run-ji-tests` target which runs the Java.Interop unit
tests, copying their test output into the same directory that the
other `TestResult-*.xml` files are placed, so that Jenkins can pick
them up for display.

Within the `make run-ji-tests` target, export the `ANDROID_SDK_PATH`
environment variable so that *all* the
`Xamarin.Android.Tools.Bytecode-Tests.dll` tests can execute.

Which introduces two problems:

 1. The `Xamarin.Android.Tools.Bytecode-Tests.dll` tests require that
    `$ANDROID_SDK_PATH` contain documentation...which we're not
    currently installing.
 2. The Java.Interop tests still fail, due to parameter name changes,
    as those tests were originally using API-18 docs.

Result: the `ParameterFixupTest` tests fail. :-(

Fix this conundrum by instaslling `docs-24_r01.zip` within
`$(AndroidSdkDirectory)`, allowing the tests to execute as intended,
and by updating to Java.Interop/master/8d7060d1, which updates the
expected parameter name output.
@atsushieno atsushieno merged commit 1746a93 into dotnet:master Apr 21, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 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