Skip to content

Commit e55c38f

Browse files
authored
[ci] Run Debug Test first and Clean between runs (#9380)
Context: https://discord.com/channels/732297728826277939/732297837953679412/1291713866409181280 Context: #9006 There are some odd build issue were Release artifacts were present in the Debug configuration build of `tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj`. > [when testing with #9006] > for the `Release` builds with runtime linking enabled, `libxamarin-app.so` > shouldn't be produced at all, the one you see in the pack is the "stub" one > we build with `native` code but never ship > it's built only so that `libmonodroid.so` we build can link against it > and then `libxamarin-app.so` built together with the app conforms to the same > ABI and has the same name, so at runtime `libmonodroid.so` can resolve it > but none of that takes place with `libmonodroid-unified.so` - this one has > everyhing built into it, including the bits that make up `libxamarin-app.so` > in a regular build. > > `Debug` build should include it, as runtime linking is not enabled - but > `libmonodroid.so` should be the one we build with XA, not the dynamically > linked one This only happens in this test project. I suspect it is because we are overriding `$(Configuration)` in the project, but not always since we are also building in a `Release` environment. Both the top level `Configuration.props` is using `$(Configuration)` as well as the test project, but the test project gets a value of `Debug` from the build yaml. I think it is confusing things, but I have not been able to track it down. Lets try to clean up the `Mono.Android.NET-Tests.csproj` test project after it has been built and run, to make sure any old outputs are not there. Also try running the `Debug` test first, so that it's running in a clean environment.
1 parent d806eb4 commit e55c38f

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

build-tools/automation/azure-pipelines.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,6 @@ extends:
154154

155155
- template: /build-tools/automation/yaml-templates/start-stop-emulator.yaml@self
156156

157-
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
158-
parameters:
159-
configuration: $(XA.Build.Configuration)
160-
testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)
161-
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
162-
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml
163-
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
164-
artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration)
165-
166157
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
167158
parameters:
168159
buildConfiguration: $(XA.Build.Configuration)
@@ -173,6 +164,15 @@ extends:
173164
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.apk
174165
artifactFolder: $(DotNetTargetFramework)-Debug
175166

167+
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
168+
parameters:
169+
configuration: $(XA.Build.Configuration)
170+
testName: Mono.Android.NET_Tests-$(XA.Build.Configuration)
171+
project: tests/Mono.Android-Tests/Runtime-Microsoft.Android.Sdk/Mono.Android.NET-Tests.csproj
172+
testResultsFiles: TestResult-Mono.Android.NET_Tests-$(XA.Build.Configuration).xml
173+
artifactSource: bin/Test$(XA.Build.Configuration)/$(DotNetTargetFramework)-android/Mono.Android.NET_Tests-Signed.aab
174+
artifactFolder: $(DotNetTargetFramework)-$(XA.Build.Configuration)
175+
176176
- template: /build-tools/automation/yaml-templates/apk-instrumentation.yaml@self
177177
parameters:
178178
configuration: $(XA.Build.Configuration)

build-tools/automation/yaml-templates/apk-instrumentation.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,10 @@ steps:
4141
testResultsFiles: ${{ parameters.testResultsFiles }}
4242
testRunTitle: ${{ parameters.testName }}
4343
condition: and(${{ parameters.condition }}, ne('${{ parameters.testResultsFiles }}', ''))
44+
45+
- template: /build-tools/automation/yaml-templates/run-dotnet-preview.yaml@self
46+
parameters:
47+
project: ${{ parameters.project }}
48+
arguments: -t:Clean -c ${{ parameters.configuration }} --no-restore
49+
displayName: Clean ${{ parameters.testName }}
50+
continueOnError: false

0 commit comments

Comments
 (0)