Skip to content

[Apple mobile] Use merged runners for runtime tests #107118

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

Merged
merged 64 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e33b371
Use merged runners for ios tests
jkoritzinsky Aug 28, 2024
aae403b
Remove some iOS logic used for non-merged runners to try to get the p…
jkoritzinsky Aug 29, 2024
d013476
Forward the "build tests on helix" property down to the test groups
jkoritzinsky Aug 29, 2024
d691882
Don't treat ILLink warnings as errors
jkoritzinsky Aug 29, 2024
4cd399e
Try adding the necessary logic to the src/tests helix-publish project…
jkoritzinsky Sep 6, 2024
9895267
Forward the extra helix arguments
jkoritzinsky Sep 9, 2024
c493243
Fix duplicate project
jkoritzinsky Sep 9, 2024
6404d1b
Look for build-apple-app when building apps on helix instead of RunTests
jkoritzinsky Sep 10, 2024
7d427d3
Adjust extracting info from the marker's location
jkoritzinsky Sep 10, 2024
31c24e9
Copy from within the AppBundle folder and make sure we're passing the…
jkoritzinsky Sep 10, 2024
19d05e3
Pass the zip as the "app bundle"
jkoritzinsky Sep 10, 2024
edc614d
Relative path to payload root should be through AppBundle
jkoritzinsky Sep 10, 2024
1ceda02
Forward down the ContinuousIntegrationBuild property to the inner tes…
jkoritzinsky Sep 11, 2024
2609bde
Pass the zip as the identity instead of the app bundle path
jkoritzinsky Sep 12, 2024
34b7836
Update build.proj
jkoritzinsky Sep 13, 2024
24c16e8
Now that we're passing through "MonoForceInterpreter", maybe we don't…
jkoritzinsky Sep 13, 2024
ff98b79
Update the iossimulator legs
jkoritzinsky Sep 13, 2024
95a67a0
Merge branch 'main' into ios-merged-runner
kotlarmilos Oct 24, 2024
711ccc8
Add extraHelixArguments
kotlarmilos Oct 25, 2024
4fb389b
Add /p:NeedsToBuildAppsOnHelix=true parameter
kotlarmilos Oct 31, 2024
6b4baa7
Add BuildTestsOnHelix property
kotlarmilos Nov 14, 2024
4419431
Include test runner
kotlarmilos Nov 19, 2024
368b855
Pass testlib argument for runtime test
kotlarmilos Nov 19, 2024
1806d91
Add Apple mobile job to the runtime.yml to allow PR testing
kotlarmilos Dec 9, 2024
8fe4dca
Merge branch 'main' into ios-merged-runner
kotlarmilos Dec 26, 2024
04f6045
Remove extra-platform params
kotlarmilos Dec 27, 2024
74d3493
Pass assembly name to the test runner
kotlarmilos Dec 27, 2024
c7d2911
Fix command
kotlarmilos Dec 27, 2024
51bd3ce
Update XUnitWrapperGenerator for mobile to use temp output path
kotlarmilos Jan 3, 2025
f3d5389
Use apple run command for merged tests
kotlarmilos Jan 3, 2025
caa6b48
Use apple run command for merged tests
kotlarmilos Jan 3, 2025
c1d6981
Disable failing tests and remove unused code
kotlarmilos Jan 4, 2025
a33c73e
Fix iossimulator jobs
kotlarmilos Jan 4, 2025
78e2f58
Fix XUnitWrapperGenerator
kotlarmilos Jan 4, 2025
20b14b6
Fix path in test runner for Apple mobile only
kotlarmilos Jan 6, 2025
ca39f05
Fix syntax
kotlarmilos Jan 6, 2025
3711e47
Try fix failing tests
kotlarmilos Jan 6, 2025
aa576ee
Revert Helix queue update
kotlarmilos Jan 6, 2025
e0ba00d
Set RunAOTCompilation as default prop
kotlarmilos Jan 8, 2025
70180d0
Add RunAOTCompilation prop
kotlarmilos Jan 9, 2025
3c24be7
Merge branch 'main' into ios-merged-runner
kotlarmilos Jan 10, 2025
7da5077
Revert changes
kotlarmilos Jan 10, 2025
95cbb09
Fix code style
kotlarmilos Jan 10, 2025
088f23e
Merge branch 'main' into ios-merged-runner
kotlarmilos Jan 13, 2025
ff5e3d9
Disable failing tests
kotlarmilos Jan 13, 2025
2b7cf9b
Disable failing tests
kotlarmilos Jan 13, 2025
94ec367
Disable failing tests
kotlarmilos Jan 13, 2025
086e553
Port some disables from issues.targets to attributes to fix failures …
jkoritzinsky Jan 13, 2025
3cab8d1
Fix typo
kotlarmilos Jan 14, 2025
66cb5fa
Fix typo
kotlarmilos Jan 14, 2025
aba116c
Fix typo
kotlarmilos Jan 14, 2025
8b1958e
Fix typo
kotlarmilos Jan 14, 2025
e617bc6
Add missing assembly externs and reference TestLibrary with the regul…
jkoritzinsky Jan 24, 2025
7e5148d
Merge branch 'main' of https://github.com/dotnet/runtime into ios-mer…
jkoritzinsky Jan 28, 2025
f50e05f
Disable more failing tests
jkoritzinsky Jan 29, 2025
7c83b84
Reference mscorlib as System.Runtime isn't present in this test
jkoritzinsky Jan 29, 2025
44e17d5
Add tracking issues
kotlarmilos Jan 29, 2025
38343c2
Merge branch 'main' into ios-merged-runner
kotlarmilos Jan 29, 2025
6b4cf19
Reference mscorlib as System.Runtime isn't present in this test
kotlarmilos Jan 29, 2025
06c7180
Reference mscorlib as System.Runtime isn't present in this test
kotlarmilos Jan 29, 2025
f2b86eb
Specify a version for TestLibrary
jkoritzinsky Jan 30, 2025
0b1c7a5
Add missing using.
jkoritzinsky Jan 30, 2025
7619658
Merge branch 'main' into ios-merged-runner
kotlarmilos Jan 31, 2025
5533317
Adjust test disables
jkoritzinsky Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ parameters:
variables: {}
pool: ''
dependsOn: []
compileOnHelix: false
interpreter: false
extraHelixArguments: ''
buildAllTestsAsStandalone: false
#arcade-specific parameters
condition: always()
Expand Down Expand Up @@ -84,56 +83,41 @@ steps:
env:
__MonoToolPrefix: aarch64-linux-gnu-

# Checks the value of the compileOnHelix parameter
# and if set invokes libraries pipeline for AOT on Helix
- ${{ if eq(parameters.compileOnHelix, 'true') }}:
- template: /eng/pipelines/libraries/helix.yml
parameters:
osGroup: ${{ parameters.osGroup }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
archType: ${{ parameters.archType }}
targetRid: ${{ parameters.targetRid }}
buildConfig: ${{ parameters.buildConfig }}
interpreter: ${{ parameters.interpreter }}
testRunNamePrefixSuffix: ${{ parameters.testRunNamePrefixSuffix }}
extraHelixArguments: ${{ parameters.extraHelixArguments }}
helixQueues: ${{ parameters.helixQueues }}
creator: ${{ parameters.creator }}
- ${{ else }}:
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
displayName: Send tests to Helix
buildConfig: $(buildConfigUpper)
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup}}
coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
runtimeVariant: ${{ parameters.runtimeVariant }}
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
displayName: Send tests to Helix
buildConfig: $(buildConfigUpper)
archType: ${{ parameters.archType }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup}}
coreClrRepoRoot: $(Build.SourcesDirectory)/src/coreclr
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
runtimeVariant: ${{ parameters.runtimeVariant }}

${{ if eq(variables['System.TeamProject'], 'internal') }}:
# Access token variable for internal project from the
# DotNet-HelixApi-Access variable group
helixAccessToken: $(HelixApiAccessToken)
${{ else }}:
creator: $(Build.DefinitionName)
${{ if eq(variables['System.TeamProject'], 'internal') }}:
# Access token variable for internal project from the
# DotNet-HelixApi-Access variable group
helixAccessToken: $(HelixApiAccessToken)
${{ else }}:
creator: $(Build.DefinitionName)

helixBuild: $(Build.BuildNumber)
helixSource: $(_HelixSource)
${{ if ne(parameters.readyToRun, true) }}:
helixType: 'test/functional/cli/'
helixBuild: $(Build.BuildNumber)
helixSource: $(_HelixSource)
${{ if ne(parameters.readyToRun, true) }}:
helixType: 'test/functional/cli/'

helixQueues: ${{ parameters.helixQueues }}
# This tests whether an array is empty
${{ if eq(join('', parameters.helixQueues), '') }}:
condition: false
publishTestResults: true
timeoutPerTestInMinutes: $(timeoutPerTestInMinutes)
timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes)
runCrossGen2: ${{ eq(parameters.readyToRun, true) }}
compositeBuildMode: ${{ parameters.compositeBuildMode }}
runInUnloadableContext: ${{ parameters.runInUnloadableContext }}
nativeAotTest: ${{ parameters.nativeAotTest }}
helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj'
scenarios: ${{ parameters.scenarios }}
helixQueues: ${{ parameters.helixQueues }}
# This tests whether an array is empty
${{ if eq(join('', parameters.helixQueues), '') }}:
condition: false
publishTestResults: true
timeoutPerTestInMinutes: $(timeoutPerTestInMinutes)
timeoutPerTestCollectionInMinutes: $(timeoutPerTestCollectionInMinutes)
runCrossGen2: ${{ eq(parameters.readyToRun, true) }}
compositeBuildMode: ${{ parameters.compositeBuildMode }}
runInUnloadableContext: ${{ parameters.runInUnloadableContext }}
nativeAotTest: ${{ parameters.nativeAotTest }}
helixProjectArguments: '$(Build.SourcesDirectory)/src/tests/Common/helixpublishwitharcade.proj'
extraHelixArguments: ${{ parameters.extraHelixArguments }}
scenarios: ${{ parameters.scenarios }}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ parameters:
runCrossGen2: ''
compositeBuildMode: false
helixProjectArguments: ''
extraHelixArguments: ''
runInUnloadableContext: ''
tieringTest: ''
hotColdSplitting: ''
Expand All @@ -38,7 +39,7 @@ steps:
- template: send-to-helix-inner-step.yml
parameters:
osGroup: ${{ parameters.osGroup }}
sendParams: ${{ parameters.helixProjectArguments }} ${{ parameters.msbuildParallelism }} /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog /p:TargetArchitecture=${{ parameters.archType }} /p:TargetOS=${{ parameters.osGroup }} /p:TargetOSSubgroup=${{ parameters.osSubgroup }} /p:Configuration=${{ parameters.buildConfig }}
sendParams: ${{ parameters.helixProjectArguments }} ${{ parameters.msbuildParallelism }} /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog /p:TargetArchitecture=${{ parameters.archType }} /p:TargetOS=${{ parameters.osGroup }} /p:TargetOSSubgroup=${{ parameters.osSubgroup }} /p:Configuration=${{ parameters.buildConfig }} ${{ parameters.extraHelixArguments }}
condition: and(succeeded(), ${{ parameters.condition }})
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
displayName: ${{ parameters.displayName }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ jobs:
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
parameters:
creator: dotnet-bot
testBuildArgs: /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
compileOnHelix: true
interpreter: true
testBuildArgs: /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkoritzinsky Did you intentionally remove NeedsToBuildAppsOnHelix?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying it as an option to see if it would work and be easier to debug. If you prefer, we can switch back to that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to provide MonoForceInterpreter here as well, but I'm not 100% positive on that.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ jobs:
- template: /eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml
parameters:
creator: dotnet-bot
testBuildArgs: /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
compileOnHelix: true
interpreter: true
testBuildArgs: /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:MonoForceInterpreter=true /p:BuildTestsOnHelix=true
testRunNamePrefixSuffix: Mono_$(_BuildConfig)
extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true

Expand Down
3 changes: 2 additions & 1 deletion eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

<_AppleBuildCommand Condition="'$(IncludesTestRunner)' == 'true'">apple test</_AppleBuildCommand>
<_AppleBuildCommand Condition="'$(IncludesTestRunner)' != 'true'">apple run</_AppleBuildCommand>

<_AppleExpectedExitCode Condition="'$(ExpectedExitCode)' != ''">--expected-exit-code $(ExpectedExitCode)</_AppleExpectedExitCode>
<_AfterBuildCommands>
mv $XHARNESS_OUT/AOTBuild.binlog &quot;$HELIX_WORKITEM_UPLOAD_ROOT&quot;
Expand Down Expand Up @@ -178,7 +179,7 @@
<HybridGlobalization>true</HybridGlobalization>
<IncludesTestRunner Condition="'$(IncludesTestRunner)' == ''">true</IncludesTestRunner>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(IsRuntimeTests)' != 'true' and '$(IncludesTestRunner)' == 'true'">AppleTestRunner.dll</MainLibraryFileName>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(IncludesTestRunner)' == 'true'">AppleTestRunner.dll</MainLibraryFileName>

<AppleBuildDir>$(PublishDir)</AppleBuildDir>
<AppleBundleDir>$(BundleDir)</AppleBundleDir>
Expand Down
2 changes: 1 addition & 1 deletion src/mono/msbuild/apple/build/AppleBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
<Import Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(UseMonoRuntime)' != 'false'" Project="$(_CommonTargetsDir)CommonMobileBuild.props" />
<Import Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(UseMonoRuntime)' != 'false'" Project="$(_CommonTargetsDir)RuntimeComponentManifest.targets" />
<Import Condition="'$(UseNativeAOTRuntime)' != 'true' and ('$(UseMonoRuntime)' != 'false' and '$(RunAOTCompilation)' == 'true')" Project="$(_CommonTargetsDir)MonoAOTCompiler.props" />
</Project>
</Project>
1 change: 1 addition & 0 deletions src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ public static bool IsNonZeroLowerBoundArraySupported
// These platforms have not had their infrastructure updated to support native test assets.
public static bool PlatformDoesNotSupportNativeTestAssets =>
OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS() || OperatingSystem.IsAndroid() || OperatingSystem.IsBrowser() || OperatingSystem.IsWasi();
public static bool IsAppleMobile => OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || OperatingSystem.IsWatchOS() || OperatingSystem.IsMacCatalyst();
}
}
28 changes: 20 additions & 8 deletions src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private static void AddRunnerSource(SourceProductionContext context, ImmutableAr
{
if (targetOS?.ToLowerInvariant() is "ios" or "iossimulator" or "tvos" or "tvossimulator" or "maccatalyst" or "android" or "browser")
{
context.AddSource("XHarnessRunner.g.cs", GenerateXHarnessTestRunner(methods, aliasMap, assemblyName));
context.AddSource("XHarnessRunner.g.cs", GenerateXHarnessTestRunner(methods, aliasMap, assemblyName, targetOS));
}
else
{
Expand Down Expand Up @@ -431,7 +431,7 @@ private static string GenerateFullTestRunner(ImmutableArray<ITestInfo> testInfos
return builder.GetCode();
}

private static string GenerateXHarnessTestRunner(ImmutableArray<ITestInfo> testInfos, ImmutableDictionary<string, string> aliasMap, string assemblyName)
private static string GenerateXHarnessTestRunner(ImmutableArray<ITestInfo> testInfos, ImmutableDictionary<string, string> aliasMap, string assemblyName, string? targetOS)
{
// For simplicity, we'll use top-level statements for the generated Main method.
CodeBuilder builder = new();
Expand All @@ -440,6 +440,18 @@ private static string GenerateXHarnessTestRunner(ImmutableArray<ITestInfo> testI
builder.AppendLine("XUnitWrapperLibrary.TestSummary summary;");
builder.AppendLine("System.Diagnostics.Stopwatch stopwatch;");
builder.AppendLine("XUnitWrapperLibrary.TestOutputRecorder outputRecorder;");
if (targetOS?.ToLowerInvariant() is "ios" or "iossimulator" or "tvos" or "tvossimulator" or "maccatalyst")
{
builder.AppendLine("string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);");
builder.AppendLine($@"string tempLogPath = System.IO.Path.Combine(documentsPath, ""{assemblyName}.templog.xml"");");
builder.AppendLine($@"string testStatsPath = System.IO.Path.Combine(documentsPath, ""{assemblyName}.testStats.csv"");");
}
else
{
builder.AppendLine($@"string tempLogPath = ""{assemblyName}.templog.xml"";");
builder.AppendLine($@"string testStatsPath = ""{assemblyName}.testStats.csv"";");
}

builder.AppendLine();

builder.AppendLine("try");
Expand Down Expand Up @@ -468,16 +480,16 @@ private static string GenerateXHarnessTestRunner(ImmutableArray<ITestInfo> testI

using (builder.NewBracesScope())
{
builder.AppendLine($@"if (System.IO.File.Exists(""{assemblyName}.tempLog.xml""))");
builder.AppendLine("if (System.IO.File.Exists(tempLogPath))");
using (builder.NewBracesScope())
{
builder.AppendLine($@"System.IO.File.Delete(""{assemblyName}.tempLog.xml"");");
builder.AppendLine("System.IO.File.Delete(tempLogPath);");
}

builder.AppendLine($@"if (System.IO.File.Exists(""{assemblyName}.testStats.csv""))");
builder.AppendLine("if (System.IO.File.Exists(testStatsPath))");
using (builder.NewBracesScope())
{
builder.AppendLine($@"System.IO.File.Delete(""{assemblyName}.testStats.csv"");");
builder.AppendLine("System.IO.File.Delete(testStatsPath);");
}
builder.AppendLine();

Expand All @@ -495,8 +507,8 @@ private static string GenerateXHarnessTestRunner(ImmutableArray<ITestInfo> testI
builder.AppendLine("Initialize();");

// Open the stream writer for the temp log.
builder.AppendLine($@"using (System.IO.StreamWriter tempLogSw = System.IO.File.AppendText(""{assemblyName}.templog.xml""))");
builder.AppendLine($@"using (System.IO.StreamWriter statsCsvSw = System.IO.File.AppendText(""{assemblyName}.testStats.csv""))");
builder.AppendLine($"using (System.IO.StreamWriter tempLogSw = System.IO.File.AppendText(tempLogPath))");
builder.AppendLine($"using (System.IO.StreamWriter statsCsvSw = System.IO.File.AppendText(testStatsPath))");
CodeBuilder testExecutorBuilder = new();

using (builder.NewBracesScope())
Expand Down
Loading
Loading