-
Notifications
You must be signed in to change notification settings - Fork 564
[tests] migrate test targets to MSBuild #949
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
Conversation
|
@jonathanpeppers, |
603929a to
ef09e70
Compare
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `SetEnvironmentVariable` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows.
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `SetEnvironmentVariable` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Also minor updates to `.gitignore` file.
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `SetEnvironmentVariable` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Also minor updates to `.gitignore` file.
| # $(call RUN_NUNIT_TEST,filename,log-lref?) | ||
| define RUN_NUNIT_TEST | ||
| MONO_TRACE_LISTENER=Console.Out \ | ||
| $(RUNTIME) --runtime=v4.0.0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this removal will need updating as per PR #965.
build-tools/scripts/RunTests.targets
Outdated
| <UsingTask AssemblyFile="$(MSBuildThisFileDirectory)..\..\bin\Build$(Configuration)\xa-prep-tasks.dll" TaskName="Xamarin.Android.BuildTools.PrepTasks.SetEnvironmentVariable" /> | ||
| <PropertyGroup> | ||
| <XAIntegratedTests Condition=" '$(HostOS)' == 'Windows' ">False</XAIntegratedTests> | ||
| <_Runtime Condition=" '$(RUNTIME)' != '' ">$(RUNTIME)</_Runtime> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use $(ManagedRuntime), defined in Configuration.props.
build-tools/scripts/RunTests.targets
Outdated
| <_Runtime Condition=" '$(RUNTIME)' == '' And '$(HostOS)' != 'Windows' ">mono</_Runtime> | ||
| <_NUnit>$(_Runtime) packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe</_NUnit> | ||
| <_Test Condition=" '$(TEST)' != '' ">--test="$(TEST)"</_Test> | ||
| <_XABuild Condition=" '$(HostOS)' == 'Windows' ">$(_TopDir)\bin\$(Configuration)\bin\xabuild.exe</_XABuild> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't/shouldn't we always just invoke $(_TopDir)\bin\$(Configuration)\bin\xabuild, and let the xabuild script sort it out?
build-tools/scripts/RunTests.targets
Outdated
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\Xamarin.Android.Build.Tests.dll" Condition=" '$(TestAssembly)' == '' " /> | ||
| <_TestAssembly Include="$(TestAssembly)" Condition=" '$(TestAssembly)' != '' " /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What sets $(TestAssembly), and why do we need to care about it?
| <MSBuild | ||
| Projects="$(MSBuildThisFileDirectory)TestApks.targets" | ||
| Targets="RenameTestCases" | ||
| Properties="Configuration=$(Configuration);RenameTestCasesGlob=$(_RenamedTestCases)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work? Properties is a ;-delimited list of properties, and $(_RenamedTestCases) may in turn contain ;s. If that works....wow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does seem to work, even under xbuild. I will need to read the results of the Jenkins build carefully to make sure it looks the same as older builds.
|
If possible, can we split the Java.Interop bump into a separate PR? It'll make it easier to reason about things if this PR is smaller. |
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `SetEnvironmentVariable` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Mono 5.8 also seems to have introduced a slowness in the PerformanceTests, included a fix to allow more digits in the time elapsed. This prevents a test failure on Mono 5.8. Also minor updates to `.gitignore` file.
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `<SetEnvironmentVariable/>` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Running `PerformanceTests` also is occasionally, *randomly*, slower than expected. (The exact reason why is currently unknown.) When it's "too" slow, an `ArgumentOutOfRangeException` was being thrown from `FormatFraction()` because the overall width for the time was longer than what was permitted. Increase the width to allow more digits. Minor updates to `.gitignore` file.
Changes as needed by dotnet#949
This ensures the following values are set on Windows: - MONO_TRACE_LISTENER - JAVA_INTEROP_GREF_LOG - JAVA_INTEROP_LREF_LOG This also cleans up what needs to be done downstream in xamarin-android: dotnet/android#949 This required a new `Java.Interop.BootstrapTasks` project that adds a `<SetEnvironmentVariable/>` MSBuild task. This will be useful down the road, for setting "prepare" steps in this repo for Windows. Running `PerformanceTests` also is occasionally, *randomly*, slower than expected. (The exact reason why is currently unknown.) When it's "too" slow, an `ArgumentOutOfRangeException` was being thrown from `FormatFraction()` because the overall width for the time was longer than what was permitted. Increase the width to allow more digits. Minor updates to `.gitignore` file.
Changes as needed by dotnet#949
e5bb3a9 to
8ac0a77
Compare
Use `bin/$(CONFIGURATION)/bin/xabuild` instead of `tools/xabuild` This will help figure out what is going on in dotnet#949
7906ed0 to
ecd9956
Compare
|
I think this PR is haunted 👻 |
|
The PR is haunted because mono crashed Rebase on b3e9820? |
adb1f1c to
ed4c7cc
Compare
The end goal here is to enable Windows users to easily run the various types of tests. Commands have been migrated to MSBuild, keeping `make` commands the same for macOS and linux. ~~ Usage ~~ Windows: ``` msbuild Xamarin.Android.sln /t:RunAllTests msbuild Xamarin.Android.sln /t:RunNUnitTests msbuild Xamarin.Android.sln /t:RunJavaInteropTests msbuild Xamarin.Android.sln /t:RunApkTests ``` macOS/linux should remain unchanged: ``` make run-all-tests make run-nunit-tests make run-ji-tests make run-apk-tests ``` ~~ Changes ~~ - Added a new build-tools/scripts/RunTests.targets - Before.Xamarin.Android.sln.targets includes these test targets - A new `SetEnvironmentVariable` task is needed, added to xa-prep-tasks - Ported any environment variables set in Makefile to MSBuild - Mono.Android-Tests.csproj needs to remove the `<ProjectReference />` xa-prep-tasks - Otherwise xa-prep-tasks.dll can become locked on Windows - A nested xabuild.exe call will attempt to ovewrite it - Update .gitignore for *.rawproto and the generated Xamarin.Android.Common.props
ed4c7cc to
0b00cd3
Compare
Fixes: dotnet/java-interop#945 Changes: dotnet/java-interop@32635fd...7dc270d * dotnet/java-interop@7dc270db: [build] set $(ProduceReferenceAssemblyInOutDir)=True (#949) * dotnet/java-interop@f91b0770: [Xamarin.Android.Tools.Bytecode] Improve Kotlin metadata matching (#946)
The end goal here is to enable Windows users to easily run the various
types of tests. Commands have been migrated to MSBuild, keeping
makecommands the same for macOS and linux.
Usage
Windows:
macOS/linux should remain unchanged:
Changes
SetEnvironmentVariabletask is needed, added to xa-prep-tasks<ProjectReference />android-toolchainNOTE
Don't merge quite yet, still working on this (hope the build passes). It might be possible to cleanup further with another PR to Java.Interop.