From 8fe8cfa1a9d0d2522db775aabd04337ffeb665a6 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 16 Jan 2020 13:55:42 -0500 Subject: [PATCH 1/3] [ci] Check APK sizes on Azure Pipelines This target was overlooked in the initial split up and porting efforts for our APK tests. This target calculates the sizes of or test APKs and compares them against a baseline. This change ensures that we will report a failure in our Azure Pipelines build if any project's APK size drifts too far from the baseline. --- build-tools/automation/yaml-templates/apk-instrumentation.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/automation/yaml-templates/apk-instrumentation.yaml b/build-tools/automation/yaml-templates/apk-instrumentation.yaml index b45b649601f..024540d829e 100644 --- a/build-tools/automation/yaml-templates/apk-instrumentation.yaml +++ b/build-tools/automation/yaml-templates/apk-instrumentation.yaml @@ -17,7 +17,7 @@ steps: solution: ${{ parameters.project }} configuration: ${{ parameters.configuration }} msbuildArguments: > - /t:AcquireAndroidTarget,SignAndroidPackage,DeployTest${{ parameters.packageType }}s,RunTestApks,UndeployTestApks,RenameApkTestCases,ReportComponentFailures + /t:AcquireAndroidTarget,SignAndroidPackage,DeployTest${{ parameters.packageType }}s,RecordApkSizes,RunTestApks,UndeployTestApks,RenameApkTestCases,ReportComponentFailures /bl:$(System.DefaultWorkingDirectory)/bin/Test${{ parameters.configuration }}/run${{ parameters.testName }}.binlog ${{ parameters.extraBuildArgs }} condition: ${{ parameters.condition }} From 15600137694c976203a652a54e8ebda78ac8790a Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Thu, 16 Jan 2020 17:51:22 -0500 Subject: [PATCH 2/3] [tests] Ensure results have an `-Aot` suffix When comparing APK sizes, we need to make sure the correct `TestsFlavor` metadata is set. In order for `-Aot` to be included in the test name, the `AotAssemblies` property must be explicitly set. Fixes: error MSB4018: The "ProcessApkSizes" task failed unexpectedly. [/Users/runner/runners/2.164.3/work/1/s/tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj] error MSB4018: System.Collections.Generic.KeyNotFoundException: The given key 'apk-Release-Profiled' was not present in the dictionary. [/Users/runner/runners/2.164.3/work/1/s/tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj] --- build-tools/automation/azure-pipelines.yaml | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index dd3e0f8215c..8150849f511 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -487,12 +487,12 @@ stages: - template: yaml-templates/apk-instrumentation.yaml parameters: configuration: $(ApkTestConfiguration) - testName: Mono.Android_Tests-Profiled + testName: Mono.Android_Tests-Profiled-Aot project: src/Mono.Android/Test/Mono.Android-Tests.csproj - testResultsFiles: TestResult-Mono.Android_Tests-$(ApkTestConfiguration)-Profiled.xml - extraBuildArgs: /p:AndroidEnableProfiledAot=true + testResultsFiles: TestResult-Mono.Android_Tests-$(ApkTestConfiguration)-Profiled-Aot.xml + extraBuildArgs: /p:AotAssemblies=True /p:AndroidEnableProfiledAot=true artifactName: Mono.Android_Tests-Signed.apk - artifactFolder: Profiled + artifactFolder: Profiled-Aot - template: yaml-templates/apk-instrumentation.yaml parameters: @@ -565,12 +565,12 @@ stages: - template: yaml-templates/apk-instrumentation.yaml parameters: configuration: $(ApkTestConfiguration) - testName: Xamarin.Android.Locale_Tests-Profiled + testName: Xamarin.Android.Locale_Tests-Profiled-Aot project: tests/locales/Xamarin.Android.Locale-Tests/Xamarin.Android.Locale-Tests.csproj - testResultsFiles: TestResult-Xamarin.Android.Locale_Tests-$(ApkTestConfiguration)-Profiled.xml - extraBuildArgs: /p:AndroidEnableProfiledAot=true + testResultsFiles: TestResult-Xamarin.Android.Locale_Tests-$(ApkTestConfiguration)-Profiled-Aot.xml + extraBuildArgs: /p:AotAssemblies=True /p:AndroidEnableProfiledAot=true artifactName: Xamarin.Android.Locale_Tests-Signed.apk - artifactFolder: Profiled + artifactFolder: Profiled-Aot - template: yaml-templates/apk-instrumentation.yaml parameters: @@ -579,7 +579,7 @@ stages: project: tests/EmbeddedDSOs/EmbeddedDSO/EmbeddedDSO.csproj testResultsFiles: TestResult-Xamarin.Android.EmbeddedDSO_Test.nunit-$(ApkTestConfiguration).xml artifactName: Xamarin.Android.EmbeddedDSO_Test-Signed.apk - artifactFolder: Profiled + artifactFolder: Default - template: yaml-templates/apk-instrumentation.yaml parameters: @@ -601,11 +601,11 @@ stages: - template: yaml-templates/apk-instrumentation.yaml parameters: configuration: $(ApkTestConfiguration) - testName: Xamarin.Forms-Performance-Integration-Profiled + testName: Xamarin.Forms-Performance-Integration-Profiled-Aot project: tests/Xamarin.Forms-Performance-Integration/Droid/Xamarin.Forms.Performance.Integration.Droid.csproj - extraBuildArgs: /p:AndroidEnableProfiledAot=true + extraBuildArgs: /p:AotAssemblies=True /p:AndroidEnableProfiledAot=true artifactName: Xamarin.Forms_Performance_Integration-Signed.apk - artifactFolder: Profiled + artifactFolder: Profiled-Aot - template: yaml-templates/apk-instrumentation.yaml parameters: From 20bef5441a53616fddf02f27d4bc72f05e09eaef Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Wed, 22 Jan 2020 15:55:30 -0500 Subject: [PATCH 3/3] Bump XF aot apk size reference --- .../TestResult-Xamarin.Forms_Tests-values-Release.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/apk-sizes-reference/TestResult-Xamarin.Forms_Tests-values-Release.csv b/tests/apk-sizes-reference/TestResult-Xamarin.Forms_Tests-values-Release.csv index 09d448dafca..22ab0b2862c 100644 --- a/tests/apk-sizes-reference/TestResult-Xamarin.Forms_Tests-values-Release.csv +++ b/tests/apk-sizes-reference/TestResult-Xamarin.Forms_Tests-values-Release.csv @@ -1,2 +1,2 @@ apk-Release,Java.Interop.dll-Release,Mono.Android.dll-Release,mscorlib.dll-Release,monosgen-armeabi-v7a-Release,apk-Release-Aot,Java.Interop.dll-Release-Aot,Mono.Android.dll-Release-Aot,mscorlib.dll-Release-Aot,monosgen-armeabi-v7a-Release-Aot,Java.Interop.dll.so-Release-Aot,mscorlib.dll.so-Release-Aot,Mono.Android.dll.so-Release-Aot,apk-Release-Profiled-Aot,Java.Interop.dll-Release-Profiled-Aot,Mono.Android.dll-Release-Profiled-Aot,mscorlib.dll-Release-Profiled-Aot,monosgen-armeabi-v7a-Release-Profiled-Aot,Mono.Android.dll.so-Release-Profiled-Aot,Java.Interop.dll.so-Release-Profiled-Aot,mscorlib.dll.so-Release-Profiled-Aot,apk-Release-Bundle,monosgen-armeabi-v7a-Release-Bundle -21069561,162816,2226688,2113024,3843248,46788671,162816,2226688,2113024,3843248,831180,8460084,9131876,25268287,162816,2226688,2113024,3843248,759148,285668,2053044,15935912,3843248 +21069561,162816,2226688,2113024,3843248,47058467,164352,2228224,2103808,3844692,872920,8410108,9426332,25268287,162816,2226688,2113024,3843248,759148,285668,2053044,15935912,3843248