-
Notifications
You must be signed in to change notification settings - Fork 564
[tests/ci] Add MSBuild test jobs to Azure Pipelines #3347
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
|
I'm not yet entirely sold on us needing to be able to build the msbuild test assemblies ( |
d30d0b2 to
1de52ae
Compare
|
@pjcollins given my recent experience with azure pipelines, I think uploading the unit test binaries and downloading them for the test phase would make sense. If we have already built them.. might as well use them :) |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/Builder.cs
Show resolved
Hide resolved
fc9d2b5 to
efae816
Compare
|
@jonathanpeppers @dellis1972 do we need to build the |
|
I don't think the There is a using System;
using System.IO;
namespace Xamarin.Android.Build
{
public static class Paths
{
public const string Configuration = "Debug";
public const string TopDirectory = @"C:\src\xamarin-android";
public static readonly string PrefixDirectory = Path.Combine (TopDirectory, "bin", Configuration);
public static readonly string BinDirectory = Path.Combine (PrefixDirectory, "bin");
public static readonly string XABuildScript = Path.Combine (BinDirectory, "xabuild");
public static readonly string XABuildExe = Path.Combine (BinDirectory, "xabuild.exe");
public static readonly string TestOutputDirectory = Path.Combine (TopDirectory, "bin", "TestDebug");
}
}I think |
efae816 to
89ec082
Compare
89ec082 to
1cbc771
Compare
|
I've reworked this to upload and use previously built MSBuild test assemblies. This should now be ready for review and merge once the new stages are green. |
1cbc771 to
278adc3
Compare
278adc3 to
187d2af
Compare
fa804e8 to
36de836
Compare
5a80c29 to
89fe0f3
Compare
This will hopefully address what appear to be temp file related NuGet
restore failures occurring in certain msbuild tests when running on the
Azure Pipeline macOS hosted pools:
NuGet.targets(114,5): error : Could not find file "/Users/vsts/.nuget/packages/xamarin.forms/3.4.0.1008975/sdac2g7w.wcv"
Allows us to filter execution of tests which will be skipped or behave differently when a device or emulator is attached.
We're hitting NuGet restore related issues on macOS when running tests
with multiple test case sources in parallel. I believe that this is not
occurring on Jenkins because all NuGet depdencies for tests there have
been cached for quite some time. On Azure Pipelines, we're more often
dealing with clean machines, and parallel attempts to restore/install
into global cache paths are occasionally failing:
NuGet.targets(121,5): error : Could not find file "/Users/vsts/.local/share/NuGet/v3-cache/1ca707a4d90792ce8e42453d4e350886a0fdaa4d$ps:_api.nuget.org_v3_index.json/nupkg_sqlitepclraw.core.1.1.8.dat"
NuGet.targets(121,5): error : The file '/Users/vsts/.nuget/packages/xamarin.android.support.compat/28.0.0.1/.nupkg.metadata' already exists.
NuGet.targets(121,5): error : Could not find file "/Users/vsts/.nuget/packages/xamarin.forms/3.4.0.1008975/2omeck77.h7w"
The fix is to update the `ParallelScope` attribute associated with these
affected tests to ensure that dynamically generated instances don't run
in parallel with eachother. This still allows for parallel execution
against other tests or fixtures.
We're seeing intermittent failures on Jenkins and Azure Pipelines in the
following tests, ensuring that they don't run in parallel will hopefully
resolve this:
Xamarin.Android.Build.Tests.IncrementalBuildTest.InvalidAndroidResource
Xamarin.Android.Build.Tests.BuildTest.BuildBasicApplicationAppCompa
Xamarin.Android.Build.Tests.BuildTest.BuildWithResolveAssembliesFailure
a859dfc to
efba667
Compare
c78cccf to
91f5c48
Compare
|
@pjcollins this seems to be working :) Device tests are running and passing 🏆 :D nice job |
|
The Jenkins MacOS failures seem to be the same as all the other PR's |
|
@dellis1972 I've noticed we still seem to have a few brittle tests, the following have been failing on Jenkins:
I saw similar failures on Azure Pipelines but this change to stop running them in parallel seemed to reduce or eliminate the failure rate for those tests on Azure. Unfortunately that change did not fix the Jenkins failures though. I think we should be good to merge this as is, it doesn't introduce any new failures to Jenkins. We may still have some individual test clean up to do but given the size of this thing I would rather get it in sooner than later and look to clean up any tests which are still misbehaving separately. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/TestEnvironment.cs
Show resolved
Hide resolved
Adds new `mac_msbuild_tests`, `mac_msbuilddevice_tests`, and
`mac_timezonedevice_tests` jobs to azure-pipelines.yaml to run the
msbuild tests against our installers.
Other changes and fixes:
* Removes the dependency on the generated XABuildPaths.cs file so that
test assemblies can be built and executed on different environments.
* Standardizes Android SDK and NDK path and OS information lookup to
reduce some code duplication and better allow for toolchain path
overriding.
* Updates Mono to 6.0.0.313 and .NET Core to 2.1.701 for our macOS
building and test stages.
* Introduces a new `UsesDevice` test category to allow us to filter
execution of tests which will be skipped or behave differently when
a device or emulator is attached.
* Updates clean tests to ignore the `FileListAbsolute.txt` file which is
no longer deleted by the clean target on macOS.
* Updates the ParallelScope attribute for some multi source tests to
avoid NuGet restore and intermittent failures occurring on macOS.
* Attaches relevant build log file paths to the test result xml rather
than dumping the full log to the test output. It's a bit painful to
scroll through diagnostic build output to see which tests failed.
Build logs can now be viewed directly in the 'attachments' tab of
each test failure in Azure Pipelines:
Adds new
mac_msbuild_tests,mac_msbuilddevice_tests, andmac_timezonedevice_testsjobs to azure-pipelines.yaml to run themsbuild tests against our installers.
Other changes and fixes:
Removes the dependency on the generated XABuildPaths.cs file so that
test assemblies can be built and executed on different environments.
Standardizes Android SDK and NDK path and OS information lookup to
reduce some code duplication and better allow for toolchain path
overriding.
Updates Mono to 6.0.0.313 and .NET Core to 2.1.701 for our macOS
building and test stages.
Introduces a new
UsesDevicetest category to allow us to filterexecution of tests which will be skipped or behave differently when
a device or emulator is attached.
Updates clean tests to ignore the
FileListAbsolute.txtfile now usedby the clean target on macOS.
Updates the ParallelScope attribute for some multi source tests to
avoid NuGet restore related issues occurring on macOS. This should
ensure that dynamically generated test case instances don't run in
parallel with eachother, but still allows for parallel execution
against other tests or fixtures. I believe that this is not occurring
on Jenkins because our test NuGet dependencies have been cached for
quite some time. On Azure Pipelines, we're more often dealing with
clean machines, and parallel attempts to restore/install into global
cache paths were occasionally failing as shown below:
Attaches relevant build log file paths to the test result xml rather
than dumping the full log to the test output. It's a bit painful to
scroll through diagnostic build output to see which tests failed.
Build logs can now be viewed directly in the 'attachments' tab of
each test failure in Azure Pipelines: