Skip to content

Commit

Permalink
[iOS] Remove unnecessary newline from CI script (#67861)
Browse files Browse the repository at this point in the history
A newline was incorrectly added to the script that executes xharness, causing it to return a 0 exit code even if there was a crash. This caused CI to report a pass no matter what.

The change also disables tests that were causing crashes.
  • Loading branch information
steveisok committed Aug 2, 2022
1 parent 27a1a75 commit aac729f
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 23 deletions.
8 changes: 6 additions & 2 deletions eng/pipelines/libraries/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,15 @@ jobs:

# iOS devices
- ${{ if in(parameters.platform, 'iOS_arm64') }}:
- OSX.1015.Amd64.Iphone.Open
# split traffic for runtime-extra-platforms (which mostly runs on rolling builds)
- ${{ if ne(parameters.jobParameters.isExtraPlatforms, true) }}:
- OSX.1015.Amd64.Iphone.Open
- ${{ if eq(parameters.jobParameters.isExtraPlatforms, true) }}:
- OSX.1200.Amd64.Iphone.Open

# tvOS devices
- ${{ if in(parameters.platform, 'tvOS_arm64') }}:
# split traffic for PR's and rolling builds
# split traffic for runtime-extra-platforms (which mostly runs on rolling builds)
- ${{ if ne(parameters.jobParameters.isExtraPlatforms, true) }}:
- OSX.1015.Amd64.AppleTV.Open
- ${{ if eq(parameters.jobParameters.isExtraPlatforms, true) }}:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/runtime-extra-platforms-other.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ jobs:
testGroup: innerloop
nameSuffix: AllSubsets_Mono
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true
buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true
timeoutInMinutes: 180
condition: >-
or(
Expand Down
5 changes: 2 additions & 3 deletions eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@
<_AfterBuildCommands>
mv $XHARNESS_OUT/AOTBuild.binlog &quot;$HELIX_WORKITEM_UPLOAD_ROOT&quot;
sign &quot;$app&quot;
xharness apple test --app &quot;$app&quot; --output-directory &quot;$output_directory&quot; --target &quot;$target&quot; --timeout &quot;$timeout&quot; --xcode &quot;$xcode_path&quot; -v --launch-timeout &quot;$launch_timeout&quot; $(_ResetSimulatorSwitch) $(_SignalAppEndSwitch) --
</_AfterBuildCommands>
xharness apple test --app &quot;$app&quot; --output-directory &quot;$output_directory&quot; --target &quot;$target&quot; --timeout &quot;$timeout&quot; --xcode &quot;$xcode_path&quot; -v --launch-timeout &quot;$launch_timeout&quot; $(_ResetSimulatorSwitch) $(_SignalAppEndSwitch) -- </_AfterBuildCommands>

<RunScriptCommand>$(_AOTBuildCommand) $(_AfterBuildCommands)</RunScriptCommand>
</PropertyGroup>
</PropertyGroup>

<Import Project="$(MonoProjectRoot)\msbuild\apple\build\AppleApp.props"
Condition="'$(BuildTestsOn)' == 'local'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly()
public static bool IsNotIntMaxValueArrayIndexSupported => s_largeArrayIsNotSupported.Value;

public static bool IsAssemblyLoadingSupported => !IsNativeAot;
public static bool IsNonBundledAssemblyLoadingSupported => !IsAssemblyLoadingSupported && !IsMonoAOT;
public static bool IsMethodBodySupported => !IsNativeAot;
public static bool IsDebuggerTypeProxyAttributeSupported => !IsNativeAot;
public static bool HasAssemblyFiles => !string.IsNullOrEmpty(typeof(PlatformDetection).Assembly.Location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ _ when (length < ushort.MaxValue) => 1 + sizeof(ushort),
}

[Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73150", TestPlatforms.iOS | TestPlatforms.tvOS)]
public static void CborDocument_Roundtrip(CborPropertyTestContext input)
{
byte[] encoding = CborDocumentSerializer.encode(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void ExtractToDirectoryNull()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72951", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void ExtractToDirectoryUnicode()
{
string zipFileName = zfile("unicode.zip");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void ExtractToDirectoryExtension()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/72951", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void ExtractToDirectoryExtension_Unicode()
{
using (ZipArchive archive = ZipFile.OpenRead(zfile("unicode.zip")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Net.Http;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.Remoting;
using System.Security;
Expand Down Expand Up @@ -258,7 +259,7 @@ public void ExecuteAssemblyByName()
}).Dispose();
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsAssemblyLoadingSupported))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonBundledAssemblyLoadingSupported))]
public void ExecuteAssembly()
{
CopyTestAssemblies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder)
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60586", TestPlatforms.iOS | TestPlatforms.tvOS)]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes
public void GetLogicalDrives_Unix_AtLeastOneIsRoot()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace System.Runtime.InteropServices.Tests
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public class GetDelegateForFunctionPointerTests
{
[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[InlineData(typeof(NonGenericDelegate))]
[InlineData(typeof(MulticastDelegate))]
[InlineData(typeof(OtherNonGenericDelegate))]
Expand All @@ -28,7 +28,7 @@ public void GetDelegateForFunctionPointer_NonGeneric_ReturnsExpected(Type t)
VerifyDelegate(functionDelegate, targetMethod);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected()
{
MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static);
Expand All @@ -51,7 +51,7 @@ public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected()
VerifyDelegate(functionDelegate, targetMethod);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
public void GetDelegateForFunctionPointer_Generic_ReturnsExpected()
{
MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static);
Expand All @@ -63,7 +63,7 @@ public void GetDelegateForFunctionPointer_Generic_ReturnsExpected()
VerifyDelegate(functionDelegate, targetMethod);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
public void GetDelegateForFunctionPointer_GenericInvalidType_ReturnsExpected()
{
MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static);
Expand Down Expand Up @@ -139,7 +139,7 @@ public void GetDelegateForFunctionPointer_InvalidType_ThrowsArgumentException(Ty
AssertExtensions.Throws<ArgumentException>("t", () => Marshal.GetDelegateForFunctionPointer((IntPtr)1, t));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
public void GetDelegateForFunctionPointer_CantCast_ThrowsInvalidCastException()
{
MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace System.Runtime.InteropServices.Tests
{
public class GetFunctionPointerForDelegateTests
{
[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpected()
{
Expand All @@ -23,7 +23,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpect
Assert.Equal(pointer1, pointer2);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsExpected()
{
Expand All @@ -40,7 +40,7 @@ public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsEx
Assert.Equal(pointer1, pointer2);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected()
{
Expand All @@ -53,7 +53,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected(
Assert.Equal(pointer1, pointer2);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)]
public void GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected()
{
Expand Down Expand Up @@ -92,7 +92,7 @@ public void GetFunctionPointer_GenericDelegate_ThrowsArgumentException()
AssertExtensions.Throws<ArgumentException>("delegate", () => Marshal.GetFunctionPointerForDelegate(d));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")]
public void GetFunctionPointerForDelegate_MarshalledOpenStaticDelegate()
{
Expand All @@ -102,7 +102,7 @@ public void GetFunctionPointerForDelegate_MarshalledOpenStaticDelegate()
Assert.NotEqual(IntPtr.Zero, ptr);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser.")]
public void GetFunctionPointerForDelegate_MarshalledClosedStaticDelegate()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static IEnumerable<object[]> IsComObject_TestData()
yield return new object[] { collectibleComImportObject };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
[MemberData(nameof(IsComObject_TestData))]
public void IsComObject_NonComObject_ReturnsFalse(object value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace System.Runtime.InteropServices.Tests
public class PtrToStructureTests
{
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void StructureToPtr_NonGenericType_ReturnsExpected()
{
var structure = new SequentialClass
Expand Down Expand Up @@ -64,6 +65,7 @@ public void StructureToPtr_GenericType_ReturnsExpected()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void StructureToPtr_NonGenericObject_ReturnsExpected()
{
var structure = new SomeTestStruct
Expand All @@ -90,6 +92,7 @@ public void StructureToPtr_NonGenericObject_ReturnsExpected()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void StructureToPtr_GenericObject_ReturnsExpected()
{
var structure = new SomeTestStruct
Expand Down Expand Up @@ -146,6 +149,7 @@ public void PtrToStructure_AutoLayoutClass_ThrowsArgumentException()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public unsafe void PtrToStructure_GenericLayoutClass_Generic()
{
int i = 42;
Expand All @@ -156,6 +160,7 @@ public unsafe void PtrToStructure_GenericLayoutClass_Generic()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public unsafe void PtrToStructure_GenericLayoutClass()
{
int i = 42;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ public unsafe void StructureToPtr_OpaqueStruct_In_NonBlittableStructure_Success(
}

[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/73008", TestPlatforms.iOS | TestPlatforms.tvOS)]
public void StructureToPtr_Flat_And_Nested_NonBlittableStructure_Success()
{
MarshalAndDestroy(new NonBlittableStruct_Flat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ private Assembly ResolveNullAssembly(AssemblyLoadContext sender, AssemblyName as
return null;
}

[Fact]
// Does not apply to Mono AOT scenarios as it is expected the name of the .aotdata file matches
// the true name of the assembly and not the physical file name.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoAOT))]
public void LoadInDefaultContext()
{
// This will attempt to load an assembly, by path, in the Default Load context via the Resolving event
Expand Down
21 changes: 18 additions & 3 deletions src/libraries/tests.proj
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@
<ProjectExclusions Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Simulator\**\*.Test.csproj" />
</ItemGroup>

<!-- Excluding all tests for devices until building on helix works properly -->
<ItemGroup Condition="'$(TargetOS)' == 'tvOS' and '$(RunDisablediOSTests)' != 'true'">
<!-- Ref.Emit in XSLCompiledTransform -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\Xslt\XslCompiledTransformApi\System.Xml.Xsl.XslCompiledTransformApi.Tests.csproj" />
Expand All @@ -276,21 +275,29 @@
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj" />

<!--
System.Formats.Cbor crashes on tvOS
Mysterious crashes on tvOS
-->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Formats.Cbor\tests\System.Formats.Cbor.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.MemoryMappedFiles\tests\System.IO.MemoryMappedFiles.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Numerics\tests\System.Runtime.Numerics.Tests.csproj" />

<!--
Test apps that are too large and take too long to build
Keep here until aggressive trimming targets can work on helix.
https://github.com/dotnet/runtime/issues/72834
https://github.com/dotnet/runtime/issues/72836
-->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\UnitTests\System.Text.RegularExpressions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.RegularExpressions\tests\FunctionalTests\System.Text.RegularExpressions.Tests.csproj" />

<!--
Source generator tests aren't necessary on mobile
https://github.com/dotnet/runtime/issues/72836
-->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)Microsoft.Extensions.Logging.Abstractions\tests\Microsoft.Extensions.Logging.Generators.Tests\Microsoft.Extensions.Logging.Generators.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Unit.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />

<!-- Functional tests on devices have problems with return codes from mlaunch -->
Expand Down Expand Up @@ -616,11 +623,19 @@
<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetOS)' == 'iOS'">
<!-- Only System.Runtime tests on iOS for now -->
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />

<ProjectReference Include="$(RepoRoot)\src\tests\FunctionalTests\iOS\Device\**\*.Test.csproj"
Exclude="@(ProjectExclusions)"
BuildInParallel="false" />
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(TargetOS)' == 'iOS' and '$(IsManualOrRollingBuild)' == 'true'">
<!-- These crash on tvOS, but do not on iOS. Run these only on the rolling builds -->
<ProjectReference Include="$(MSBuildThisFileDirectory)System.IO.MemoryMappedFiles\tests\System.IO.MemoryMappedFiles.Tests.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Runtime.Numerics\tests\System.Runtime.Numerics.Tests.csproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)System.Formats.Cbor\tests\System.Formats.Cbor.Tests.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(ArchiveTests)' == 'true' and '$(RunSmokeTestsOnly)' != 'true' and '$(TargetOS)' == 'iOSSimulator'">
<!-- https://github.com/dotnet/runtime/issues/57666 -->
<!-- <ProjectReference Include="$(MonoProjectRoot)sample\iOS\Program.csproj"
Expand Down

0 comments on commit aac729f

Please sign in to comment.