Skip to content

Commit

Permalink
[ci] Try static macOS pool for test jobs
Browse files Browse the repository at this point in the history
Moves macOS test jobs to a static machine pool containing both arm64
and x64 mac minis to compare test job performance / reliabilty.
  • Loading branch information
pjcollins committed Jul 17, 2023
1 parent fc944ee commit 7acb190
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 22 deletions.
5 changes: 4 additions & 1 deletion build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ stages:
- job: mac_apk_tests_net
displayName: macOS > Tests > APKs .NET
pool:
vmImage: $(HostedMacImage)
name: VSEng-VSMac-Xamarin-Shared
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals arm64
timeoutInMinutes: 180
workspace:
clean: all
Expand Down
5 changes: 4 additions & 1 deletion build-tools/automation/yaml-templates/run-msbuild-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
pool: $(1ESWindowsPool)
${{ if eq(parameters.testOS, 'macOS') }}:
pool:
vmImage: $(HostedMacImage)
name: VSEng-VSMac-Xamarin-Shared
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
timeoutInMinutes: 180
cancelTimeoutInMinutes: 5
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
stageName: msbuilddevice_tests
job_name: 'mac_dotnetdevice_tests'
dependsOn: mac_build
agent_count: 8
agent_count: 6
stageCondition: succeeded()
stagePrefix: ''
xaSourcePath: $(System.DefaultWorkingDirectory)
Expand All @@ -25,7 +25,10 @@ stages:
parallel: ${{ parameters.agent_count }}
displayName: "macOS > Tests > MSBuild+Emulator"
pool:
vmImage: $(HostedMacImage)
name: VSEng-VSMac-Xamarin-Shared
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals arm64
timeoutInMinutes: 90
cancelTimeoutInMinutes: 5
workspace:
Expand Down Expand Up @@ -87,7 +90,10 @@ stages:
deviceName: wear_square
androidSdkPlatforms: 33
pool:
vmImage: $(HostedMacImage)
name: VSEng-VSMac-Xamarin-Shared
demands:
- macOS.Name -equals Ventura
- macOS.Architecture -equals x64
workspace:
clean: all
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stages:
testOS: macOS
jobName: mac_msbuild_tests
jobDisplayName: macOS > Tests > MSBuild
agentCount: 10
agentCount: 6
testFilter: cat != Dummy # This is because $(ExcludedNUnitCategories) gets appended which starts with '&'
xaSourcePath: ${{ parameters.xaSourcePath }}
repositoryAlias: ${{ parameters.repositoryAlias }}
Expand Down
2 changes: 1 addition & 1 deletion tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void BuildBasicApplicationAndAotProfileIt ()
IsRelease = true,
AotAssemblies = false,
};
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");

if (Builder.UseDotNet) {
// TODO: only needed in .NET 6+
Expand Down
8 changes: 4 additions & 4 deletions tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void ApplicationRunsWithoutDebugger ([Values (false, true)] bool isReleas
IsRelease = isRelease,
};
if (isRelease || !CommercialBuildAvailable) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
}
proj.SetDefaultTargetDevice ();
if (Builder.UseDotNet && isRelease) {
Expand Down Expand Up @@ -91,7 +91,7 @@ public void ClassLibraryMainLauncherRuns ([Values (true, false)] bool preloadAss
ProjectName = "MyApp",
};
if (!CommercialBuildAvailable) {
app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
app.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
}
app.SetDefaultTargetDevice ();
app.SetProperty ("AndroidEnablePreloadAssemblies", preloadAssemblies.ToString ());
Expand Down Expand Up @@ -192,7 +192,7 @@ public void CustomApplicationRunsWithDebuggerAndBreaks (bool embedAssemblies, st
IsRelease = false,
AndroidFastDeploymentType = fastDevType,
};
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
proj.SetProperty ("EmbedAssembliesIntoApk", embedAssemblies.ToString ());
proj.SetProperty ("AndroidPackageFormat", packageFormat);
proj.SetDefaultTargetDevice ();
Expand Down Expand Up @@ -434,7 +434,7 @@ public Foo ()
app.SetProperty ("AndroidPackageFormat", packageFormat);
app.MainPage = app.MainPage.Replace ("InitializeComponent ();", "InitializeComponent (); new Foo ();");
app.AddReference (lib);
app.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
app.SetAndroidSupportedAbis ("arm64-v8a", "x86", "x86_64");
app.SetProperty (KnownProperties._AndroidAllowDeltaInstall, allowDeltaInstall.ToString ());
app.SetDefaultTargetDevice ();
using (var libBuilder = CreateDllBuilder (Path.Combine (path, lib.ProjectName)))
Expand Down
18 changes: 9 additions & 9 deletions tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void ReInstallIfUserUninstalled ([Values (false, true)] bool isRelease)
IsRelease = isRelease,
};
if (isRelease) {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
}
using (var builder = CreateApkBuilder ()) {
Assert.IsTrue (builder.Build (proj));
Expand Down Expand Up @@ -67,7 +67,7 @@ public void InstallAndUnInstall ([Values (false, true)] bool isRelease)
if (isRelease) {
// Set debuggable=true to allow run-as command usage with a release build
proj.AndroidManifest = proj.AndroidManifest.Replace ("<application ", "<application android:debuggable=\"true\" ");
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
}
using (var builder = CreateApkBuilder ()) {
Assert.IsTrue (builder.Build (proj));
Expand Down Expand Up @@ -97,7 +97,7 @@ public void ChangeKeystoreRedeploy ()
var proj = new XamarinAndroidApplicationProject () {
PackageName = "com.xamarin.keytest"
};
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
using (var builder = CreateApkBuilder ()) {
// Use the default debug.keystore XA generates
Assert.IsTrue (builder.Install (proj), "first install should succeed.");
Expand Down Expand Up @@ -128,7 +128,7 @@ public void SwitchConfigurationsShouldRedeploy ()
};
// Set debuggable=true to allow run-as command usage with a release build
proj.AndroidManifest = proj.AndroidManifest.Replace ("<application ", "<application android:debuggable=\"true\" ");
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
proj.SetProperty ("AndroidPackageFormat", "apk");
using (var builder = CreateApkBuilder ()) {
Assert.IsTrue (builder.Build (proj));
Expand Down Expand Up @@ -180,7 +180,7 @@ public void InstallWithoutSharedRuntime ()
} else {
proj.RemoveProperty (proj.ReleaseProperties, "EmbedAssembliesIntoApk");
}
var abis = new [] { "armeabi-v7a", "x86", "x86_64" };
var abis = new [] { "arm64-v8a", "x86_64" };
proj.SetAndroidSupportedAbis (abis);
using (var builder = CreateApkBuilder ()) {
if (RunAdbCommand ("shell pm list packages Mono.Android.DebugRuntime").Trim ().Length != 0)
Expand Down Expand Up @@ -270,7 +270,7 @@ public void ToggleFastDev ()

//Now toggle FastDev to OFF
proj.EmbedAssembliesIntoApk = true;
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");

Assert.IsTrue (builder.Install (proj), "Second install should have succeeded.");

Expand Down Expand Up @@ -302,7 +302,7 @@ public void ToggleDebugReleaseWithSigning ([Values ("aab", "apk")] string packag
proj.SetProperty (proj.ReleaseProperties, "AndroidKeyStore", "True");
proj.SetProperty (proj.ReleaseProperties, "AndroidSigningKeyStore", "test.keystore");
proj.SetProperty (proj.ReleaseProperties, "AndroidSigningKeyAlias", "mykey");
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
proj.SetProperty (proj.ReleaseProperties, "AndroidPackageFormat", packageFormat);
proj.SetProperty ("AndroidUseApkSigner", "true");
proj.OtherBuildItems.Add (new BuildItem (BuildActions.None, "test.keystore") {
Expand Down Expand Up @@ -338,7 +338,7 @@ public void LoggingPropsShouldCreateOverrideDirForRelease ()
};
// Set debuggable=true to allow run-as command usage with a release build
proj.AndroidManifest = proj.AndroidManifest.Replace ("<application ", "<application android:debuggable=\"true\" ");
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");

string wantedFile;
if (Builder.UseDotNet) {
Expand Down Expand Up @@ -438,7 +438,7 @@ public void TestAndroidStoreKey (bool useApkSigner, bool isRelease, string packa
proj.SetProperty ("AndroidSigningStorePass", password);
proj.SetProperty ("AndroidSigningKeyPass", password);
}
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
proj.SetProperty ("AndroidKeyStore", androidKeyStore);
proj.SetProperty ("AndroidSigningKeyStore", "test.keystore");
proj.SetProperty ("AndroidSigningKeyAlias", "mykey");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected override void OnCreate (Bundle bundle)
}
}
}";
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");
proj.SetProperty ("EmbedAssembliesIntoApk", embedAssemblies.ToString ());
proj.SetDefaultTargetDevice ();
using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void SystemApplicationCanInstall ()
WebContent = "https://github.com/aosp-mirror/platform_build/raw/master/target/product/security/platform.x509.pem"
});
proj.AndroidManifest = proj.AndroidManifest.Replace ("<manifest ", "<manifest android:sharedUserId=\"android.uid.system\" ");
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64");
proj.SetAndroidSupportedAbis ("arm64-v8a", "x86_64");


proj.SetDefaultTargetDevice ();
Expand Down

0 comments on commit 7acb190

Please sign in to comment.