xamarin-macios/tests/dotnet/UnitTests
Rolf Bjarne Kvinge 7da04184cf
[tests] Improve the CustomizedCodeSigning tests to not depend on file order. (#20889)
The CustomizedCodeSigning test asserts that a certain condition shows a
particular error message from codesign.

There are multiple files in the app bundle that can trigger this particular
message, so change the logic to not assert on a particular file, instead use
assert on the remained of the error message.

Fixes this random test failure:

    Xamarin.Tests.DotNetProjectTest.CustomizedCodeSigning(iOS,"ios-arm64"): Failure when comparing error messages:
        Unexpected error message #0:
            Expected: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll
            Actual: /usr/bin/codesign exited with code 1:\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
        Unexpected error message #1:
            Expected: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Diagnostics.DiagnosticSource.dll
            Actual: Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature\n/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all\nIn subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
        All errors:
            /usr/bin/codesign exited with code 1:
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all
                In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64
                        Failed to codesign '/Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app': /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: replacing existing signature
                /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app: code object is not signed at all
                In subcomponent: /Users/builder/azdo/_work/4/s/xamarin-macios/tests/dotnet/CustomizedCodeSigning/iOS/bin/Debug/net9.0-ios/ios-arm64/CustomizedCodeSigning.app/System.Collections.NonGeneric.aotdata.arm64

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2024-08-12 18:58:17 +02:00
..
ApplePlatformExtensions.cs [dotnet] Stop using a separate default platform version. (#19754) 2024-01-09 09:47:07 +01:00
AssetsTest.cs [tests] Update .NET tests to cope with updated min OS version and no more 32-bit iOS support. (#17088) 2022-12-21 18:15:28 +01:00
BundleStructureTest.cs [tests] Fix BundleStructure when building for only tvOS. (#20677) 2024-06-04 09:07:51 +02:00
DotNetUnitTests.csproj Get Mono.Cecil from NuGet everywhere. (#19535) 2023-12-04 20:15:03 +01:00
DotNetUnitTests.sln
Extensions.cs [Tests] Fix trim warnings tests (#20132) 2024-02-18 10:05:31 -05:00
ExtensionsTest.cs [tests] Enable nullability for numerous files in the .NET tests. (#16976) 2022-12-12 17:13:02 +01:00
GlobalImports.cs [tests] Add global imports to the .NET unit tests to simplify code. (#15770) 2022-08-26 13:40:12 +02:00
IncrementalBuildTest.cs [tests] Add missing check for available runtime identifiers in a few tests. (#18739) 2023-08-16 10:29:42 +02:00
Makefile [tests] Make the 'run-tests' and 'run-unit-tests' targets equivalent. (#20223) 2024-03-01 09:54:33 +01:00
MauiTest.cs [dotnet] Delay computing trimming options until MAUI has had a chance to change the default. (#20970) 2024-08-07 14:43:53 +02:00
MlaunchTest.cs [xcode15.3] Bump to Xcode 15.3 bindings (#20780) 2024-07-11 11:41:31 +02:00
PackTest.cs [tests] Skip framework-test on iOS and tvOS. (#20590) 2024-05-30 10:34:14 +02:00
PartialAppManifestTest.cs [tests] Fix a few nullability issues in cecil-tests and the .NET tests. (#17095) 2022-12-21 10:19:13 +01:00
PostBuildTest.cs [net8.0] Revert "[tests] Ignore tests that publish universal apps." (#18944) 2023-09-11 18:40:16 +02:00
ProjectTest.cs [tests] Improve the CustomizedCodeSigning tests to not depend on file order. (#20889) 2024-08-12 18:58:17 +02:00
PublishTrimmedTest.cs [dotnet] Improve error message when someone tries to disable trimming by setting PublishTrimmed=false. (#17568) 2023-02-21 14:54:44 +01:00
RebuildTest.cs [msbuild] Re-aot referencing assemblies. Fixes #17708. (#18509) 2023-08-07 20:19:30 +02:00
RegistrarTest.cs [tests] Fix the InvalidStaticRegistrarValidation test to only run on x64. (#19782) 2024-01-15 17:10:30 +01:00
TemplateProjectTest.cs [tests] Enable nullability for numerous files in the .NET tests. (#16976) 2022-12-12 17:13:02 +01:00
TemplateTest.cs [tests] Update the .NET template tests. 2023-01-31 13:01:46 +01:00
TestBaseClass.cs [tests] Improve the CustomizedCodeSigning tests to not depend on file order. (#20889) 2024-08-12 18:58:17 +02:00
TrimmerWarningsTest.cs [ObjCRuntime] Refactor the Block.SetupBlock(Delegate,Delegate) implementation a bit. (#20353) 2024-03-22 10:19:37 +01:00
WindowsTest.cs [msbuild] Don't support RuntimeIdentifiers for Hot Restart. (#20750) 2024-07-01 19:26:57 +02:00
ZipHelpers.cs [tests] Run the BundleStructure test on Windows in remote mode. (#20045) 2024-04-17 16:21:37 +02:00