Граф коммитов

293 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 9ab18236b8
[xharness] Fix path to mlaunch when using mlaunch from a .NET SDK pack. (#16361) 2022-10-18 08:04:13 +02:00
Rolf Bjarne Kvinge ad8cdb3f91
[msbuild] Build the solution with .NET. (#16304)
Hopefully this fixes some of the recurrent build problems where we'd fail to
restore nuget packages.

Ref: https://github.com/xamarin/maccore/issues/2620

I wasn't able to execute ilrepack.exe with .NET, so that continues to be
executed with mono.
2022-10-17 07:22:24 +02:00
Rolf Bjarne Kvinge 98ffb7e32b
[xharness] Don't run Mac Catalyst tests if Mac Catalyst isn't enabled. (#16324) 2022-10-14 14:51:11 +02:00
Rolf Bjarne Kvinge 7659696c23
[autoformat] Add xharness.csproj. (#16322) 2022-10-13 23:10:08 +02:00
Rolf Bjarne Kvinge e8c7805ddf
Remove part of the maccore logic. (#16181)
* Don't load maccore/mk/versions.mk anymore, which means we're not checking
  any subsequent dependencies listed in maccore. Note that we still need the
  maccore dependency itself for a little while longer.
* Remove some outdated testing code that called into maccore.
* Don't recurse into the maccore directory during make.
* Remove some code checking for ENABLE_XAMARIN that's not used anymore, in
  particular in xharness.
2022-09-30 09:30:12 +02:00
Rolf Bjarne Kvinge f592de721d
[tests/xharness] Skip legacy tests if legacy isn't enabled. (#16073) 2022-09-23 13:54:26 +02:00
Rolf Bjarne Kvinge 6e49a6748a
[xharness] Find a different mlaunch if legacy Xamarin is disabled. (#15996) 2022-09-21 14:27:10 +02:00
Rolf Bjarne Kvinge 897ce7b736
[xharness] Environment variables need to be fetched. (#15316) 2022-06-23 12:15:21 -04:00
Manuel de la Pena b1ea4b51aa
[CI] Allow tests to be ran in parallel. (#15322)
This allows the CI to run ALL the tests that the project has in
parallel. This is divided in two main changes:

1. Xharness - We move away from using boolenas to use a flag that states
   the tests to run.
2. yaml - We have move the code to use a template per label. This new
   jobs all run in parallel and the results are later collected by a
   funel job
3. pwsh - Added a new class that understands that we have several mark
   downs with the tests results. The classes parses them and them writes
   a single comment (and example can be found here: https://github.com/xamarin/xamarin-macios/pull/15201#issuecomment-1162366240

The changes gives the following advantages vs how we used to run tests:

1. The CI run for all tests moves from taking 13 hours to 3/4 hours
   (depending on the number of bots in the pool).
2. The download needed to verify the results on a case of failure is
   smaller. Rather than downloading several GBs we now just download
   that part of the html that we are interested in.
3. Better bot utlization. Bots are just used to a max of 2 hours, this
   means that we can use the bots better since they are fragmented.
4. Less VMs. VSDrops has added support for macOS and Linux, we take
   advanges of that here.


Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-06-23 08:54:21 -04:00
Rolf Bjarne Kvinge a1d0b6eba9
Make our local .NET the default .NET for the build. (#15086)
Make our local .NET the default .NET (in the root's global.json), and then if
a directory wants to use the system .NET, then that directory would have to
opt-in (using its own global.json).

This way we don't have to copy global.json/NuGet.config files around to run
tests with the correct .NET setup.
2022-06-07 10:11:02 +02:00
Manuel de la Pena 0069323b6a
[Xharness] Add a label per test project to later be able to filter them. (#14844) 2022-05-04 10:46:07 -04:00
Rolf Bjarne Kvinge 5740e372a0
[xharness] Honor the TESTS_USE_SYSTEM environment variable in addition to the --use-system command-line argument. (#14561)
Fixes https://github.com/xamarin/maccore/issues/2561.
2022-03-30 18:59:40 +02:00
Rolf Bjarne Kvinge e369f466f7
[dotnet] Rename the DOTNET6 make variable to DOTNET. (#14441)
This is the follow-up to where the DOTNET variable was renamed SYSTEM_DOTNET.
2022-03-21 15:56:57 +01:00
Rolf Bjarne Kvinge d3643414e7
[dotnet] Rename the DOTNET make variable to SYSTEM_DOTNET. (#14416)
This makes it line up with our other make variables (SYSTEM_MSBUILD,
SYSTEM_MONO, SYSTEM_CSC, etc.), and also prepares for removing the version
from the DOTNET6 variable (so that it becomes just DOTNET).
2022-03-17 10:26:59 +01:00
Rolf Bjarne Kvinge 69015b3cec
[dotnet] Honor 'TrimMode' to specify linker behavior if LinkMode/MtouchLink aren't set. Fixes #13518. (#13543)
* Change dotnet-linker to only care about whether we're actually trimming anything or not.
* Allow LinkMde/MtouchLink to not be set if TrimMode is set.
* Detect if any assemblies are linked or not by checking the global TrimMode
  property + any TrimMode properties on assemblies.

Fixes https://github.com/xamarin/xamarin-macios/issues/13518.
2021-12-15 09:27:00 +01:00
Rolf Bjarne Kvinge f1e4cbcfcd
[tests] Modify a few test directories with multiple projects to have the projects in subfolders. (#12921)
This fixes a problem where the build from the different projects could stomp
on eachother in the obj/bin folders. It's technically possible to make this
work by setting up custom [Base][Intermediate][OutputPath] properties in the
project files, but the simplest solution is to just make sure there's no more
than a single project per directory.
2021-10-05 18:06:35 +02:00
Rolf Bjarne Kvinge 26771dfefa
[xharness] Remove iOS 32-bit simulator support, current Xcodes don't support it. (#12880)
Our existing tests that claimed to run iOS 32-bit tests were really executing
in 64-bit mode.
2021-10-01 08:33:18 +02:00
Rolf Bjarne Kvinge 298d423cf1
[xharness] Don't generate makefiles anymore. (#12751)
We either use the html web page, or for .NET tests there are custom makefile
logic.

This avoids having to maintain the makefile generation to keep up with our new
tests, and it fixes numerous warnings like this:

    Makefile-mac.inc:56: warning: overriding recipe for target 'build-mac-modern-macOS'
    Makefile-mac.inc:41: warning: ignoring old recipe for target 'build-mac-modern-macOS'
    Makefile-mac.inc:59: warning: overriding recipe for target 'clean-mac-modern-macOS'
    Makefile-mac.inc:44: warning: ignoring old recipe for target 'clean-mac-modern-macOS'
    Makefile-mac.inc:62: warning: overriding recipe for target 'exec-mac-modern-macOS'
    Makefile-mac.inc:47: warning: ignoring old recipe for target 'exec-mac-modern-macOS'
    Makefile-mac.inc:65: warning: overriding recipe for target 'run-mac-modern-macOS'
    Makefile-mac.inc:50: warning: ignoring old recipe for target 'run-mac-modern-macOS'
2021-09-16 17:23:07 +02:00
Rolf Bjarne Kvinge 88cf80da2d
[xharness] Remove legacy Mac Catalyst support. (#12642)
We're going .NET all the way.

This simplifies xharness a little bit, and speeds up our test run somewhat.
2021-09-07 18:35:33 +02:00
Rolf Bjarne Kvinge 69b95172b3
[xharness] Unify the list of test projects for .NET between iOS and macOS. (#12469)
* [xharness] Unify the list of test projects for .NET between iOS and macOS.

* [xharness] Don't enable all .NET tests if .NET is enabled.

Some tests (such as device tests) have additional checks that must be honored as well.

* [xharness] If a test is ignored, then it doesn't matter what the corresponding build task is doing.

A build task can be shared between multiple tests, and it can be building for
another (enabled) test. This happens for iOS 32-bits and 64-bits simulator:
the app is built once, but have two different tests running.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-06 15:23:41 +02:00
Rolf Bjarne Kvinge ef61ab51f6
[tests] Add .NET version of link sdk for macOS. (#12462)
* [tests] Add .NET version of link sdk for macOS.

* [src] Add linker substitution files for macOS and Mac Catalyst.
2021-08-18 10:01:26 +02:00
Rolf Bjarne Kvinge cd60fc7123
[tests] Add .NET version of link all for macOS. (#12436)
This also required changing some linker code to not have platform-specific conditional compilation,
because dotnet-linker is built only once for .NET (same binary for all platforms).
2021-08-17 16:39:43 +02:00
Rolf Bjarne Kvinge 874a6f93b6
[tests] Add .NET version of dont link for macOS. (#12432) 2021-08-13 22:49:03 +02:00
Rolf Bjarne Kvinge e0e7f0f4eb
[tests] Add/improve interdependent-binding-projects on .NET (#12429)
* [tests] Share project logic in the .NET version of interdependent-binding-projects.

* [tests] Make interdependent-binding-projects work on macOS.
2021-08-13 20:15:06 +02:00
Rolf Bjarne Kvinge 617b88e270
[introspection] Share the logic for .NET between all platforms. (#12409)
* Share the logic for .NET between all platforms.
* This means adding a macOS variation of introspection for .NET.
* A few fixes to make sure the macOS variation passes:
    * Make NSTabViewController.SegmentedControl fully unavailable (it's never
      been in any stable version of Xcode).
    * Treat API with an Obsolete attribute as API with an Obsoleted attribute
      with regards to availability.
    * Ignore OSPlatform attributes we don't understand.
    * Ignore the ApiAvailabilityTest.LegacyAttributes test on macOS as well.
2021-08-13 09:32:56 +02:00
Rolf Bjarne Kvinge 1b5cb35623
[tests] Add .NET versions of xcframeworks-test and bindings-xcframework-test. (#12420) 2021-08-13 09:30:45 +02:00
Rolf Bjarne Kvinge 104ab12bdd
[dotnet/msbuild] Fix publishing user frameworks and dynamic libraries from binding projects. (#12396)
We extract frameworks from third-party libraries when running the linker, and
we need to store this information on disk and the reload it after the linker
has executed, and add it to the existing MSBuild variables that keep track of
the user frameworks and dynamic libraries that have to be copied to the app
bundle.

Fixes the framework-test tests.
2021-08-11 09:58:00 +02:00
Rolf Bjarne Kvinge 7b286adb47
[tests] Add a .NET version of framework-test to our test list. (#12373) 2021-08-10 07:40:00 +02:00
Rolf Bjarne Kvinge 013054a48c
[tests] Add .NET version of the fsharp test. (#12359)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2021-08-06 09:29:30 +02:00
Rolf Bjarne Kvinge a91e34f01b
[xharness] Automatically inline Imports to a "shared.csproj" when cloning projects. Fixes #12316 and #12277. (#12322)
This way we process the shared.csproj that we use in our .NET test projects.
The main effect is that we'll clone any project references included in the
shared.csproj, which will fix #12316. On another hand, it means that we'll
add/remove defines in referenced projects, which fixes #12277.

It also allows us to put more code in the "shared.csproj" files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12316.
Fixes https://github.com/xamarin/xamarin-macios/issues/12277.
2021-08-04 18:13:02 +02:00
Rolf Bjarne Kvinge b9c12e5fb0
[introspection] Make green on .NET/Mac Catalyst. Fixes #10215. (#12329)
* [introspection] Ignore the ApiAvailabilityTest.LegacyAttribute test on Mac Catalyst as well.

* [introspection] #10883 only applies to Mac Catalyst for legacy Xamarin.

* [xharness] introspection is now green on .NET/Mac Catalyst
2021-08-03 17:58:10 +02:00
Rolf Bjarne Kvinge 2ca8970122
[tests] Add a .NET version of introspection for Mac Catalyst. (#12039)
* [tests] Add a .NET version of introspection for Mac Catalyst.

It shows a lot of failures (so it's disabled by default), but this way we can
at least start to fix the failures.

* [xharness] Always ignore the new test.

* [xharness] Ignored projects should be ignored.
2021-07-28 09:39:29 +02:00
Rolf Bjarne Kvinge b890b2b248 [xharness] Add .NET/Mac Catalyst versions of dont link, link sdk and link all. 2021-07-20 15:54:48 +02:00
Manuel de la Pena 4626b30156
[CI] Do not run monotouch mac dotnet if it is not dotnet enabled. (#11654) 2021-05-21 17:57:20 -04:00
Manuel de la Pena 8ec9182b12
[CI] Allow to ignore tests if dotnet is enabled. (#11604) 2021-05-20 09:37:22 -04:00
Rolf Bjarne Kvinge 12afa170bf [tests] Add a .NET/MacCatalyst variation of monotouch-test.
Also:

* Use the right arm64 runtime identifier depending on the target platform.
* Don't add CoreCLR variations of Mac Catalyst tests.
* Exclude UISearchDisplayController from tests, since it isn't available in
  Mac Catalyst anymore.
2021-05-13 16:03:34 +02:00
Rolf Bjarne Kvinge 4354b96889 [xharness] Add an ARM64 variation of the xammac tests. 2021-05-11 15:54:39 +02:00
Sebastien Pouliot bbee8a0a57
[tests][link all] Fix nunit silent exception causing some tests not to be enabled (#11287)
This exposed a few tests that are failing on dotnet (adjusted or fixed)
Also fix a typo in an exception message in `src/ObjCRuntime/PlatformAvailability.cs`
and a build warning in `tests/common/TestRuntime.cs`

Fix part of https://github.com/xamarin/xamarin-macios/issues/11243
And allows enabling the tvOS/dotnet link all tests
2021-04-22 09:14:33 -04:00
Sebastien Pouliot 5accd102cf
[dotnet][tvos] Enable ICU (instead of using Invariant) and additional tests (#11247) 2021-04-21 20:19:05 -04:00
Rolf Bjarne Kvinge 9a0cd6182b
[introspection] Add/fix/remove availability attributes for Mac Catalyst to make introspection's Introduced test pass. (#10587)
Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2021-04-13 15:48:20 -04:00
Alex Soto 225ad67175 [monotouch-tests] Disable dotnet MacCat tests for now since they hang in BS 2021-04-08 23:11:24 -04:00
Alex Soto 360bb93c5e [monotouch-tests] Disable MacCat tests for now since they hang in BS 2021-04-08 17:55:55 -04:00
Rolf Bjarne Kvinge 32e4d05195
[dotnet] Add support for specifying the VM with the _XamarinRuntime property. (#10881)
Use a private property (prefixed with underscore) for now, until we can decide
on a better/general name.

Also add a variation to xharness to build monotouch-test with CoreCLR
(building works fine, but it crashes at startup, which is expected at this
point).
2021-03-16 18:32:04 +01:00
Rolf Bjarne Kvinge 538fd86172
[tests] Add a .NET/macOS version of monotouch-test. (#10672)
* [tests] Add a .NET/macOS version of monotouch-test.

I made a macOS version of monotouch-test instead of a .NET version of xammac tests,
so that one day we might have only one test suite for all our API tests.

* Add a project file for .NET/macOS
* Fix some code to handle the fact that we're called 'monotouchtest' on macOS (but
  only on .NET).
* Ignore exception marshalling tests, those aren't working yet.

* [xharness] Add support for .NET/macOS and add a macOS version of monotouch-test to our tests

* [dotnet-linker] Skip libSystem.Net.Security.Native and libSystem.Native when collecting native methods to preserve for .NET/macOS.
2021-02-24 16:07:04 +01:00
Rolf Bjarne Kvinge 3a29de80a8
[tests] Make link sdk and link all work on Mac Catalyst. (#10579)
* [link sdk/link all] Adjust to compile on Mac Catalyst.

* [tests] Adjust the LinkAllRegressionTest.NoFatCorlib to work on Mac Catalyst.

* [tests] Add version checks to make link sdk green on Mac Catalyst.

* [tests] Make the LinkSdkRegressionTest.SpecialFolder test pass on Mac Catalyst.

* [xharness] link sdk and link all are green on Mac Catalyst now.

* Fix test build.
2021-02-05 07:43:33 +01:00
Rolf Bjarne Kvinge 5ef69f173b
[msbuild/tests] Fix support for XCFrameworks for Mac Catalyst. (#10578)
* [tests] Use the 'Apple Developer' code signing key instead of 'iPhone Developer' for xcframework-test.

* [msbuild] Fix resolving the XCFramework for Mac Catalyst.

* [xharness] Enable xcframework-test by default on Mac Catalyst.
2021-02-05 07:39:38 +01:00
Rolf Bjarne Kvinge 37a25a7ca1
[xharness] framework-test is now green on Mac Catalyst (#10572) 2021-02-04 08:28:47 +01:00
Rolf Bjarne Kvinge 13fd8f5b07
[tests] Adjust BundledResources.ResourcesTest to pass on Mac Catalyst. (#10553)
This makes dont link green on Mac Catalyst.

Also adjust xharness to run dont link/Mac Catalyst by default.

Contributes towards https://github.com/xamarin/xamarin-macios/issues/10440.
2021-02-01 18:42:40 +01:00
Rolf Bjarne Kvinge d9af032dd5 [xharness] Run Mac Catalyst variations by default, and disable all but monotouch-test by default.
This will effectively run monotouch-test on Mac Catalyst by default.
2021-01-28 08:08:02 +01:00
Rolf Bjarne Kvinge 93bbfe7a86
[tests] Merge apitest into xammac_tests. (#10276)
* [apitest] Sanitize files by adding missing eols.

* [apitest] Add #if __MACOS__ to all test files.

In preparation for the move into monotouchtest.

* [apitest] Move test files into monotouchtest.

* [tests] Remove the apitest project.

* [monotouch-test] Remove MessagingMac.cs, it's not needed.

* [xammac-tests] Add file PlatformInfo.cs to the build.

* [xammac-tests] Move files into monotouch-test.

* [monotouch-test] Rename test class to not clash with another test class of the same (Objective-C) name.

* [tests] How did this ever work?

Answer: it never did.

* [monotouch-test] Remove duplicated test code.

* [xammac-tests] Define DYNAMIC_REGISTRAR when we're using the dynamic registrar.

* [monotouch-test] Adjust the BundleTest.TestGetBundleId test to cope with having multiple apps for the same bundle id.

* [monotouch-test] Ignore a test that doesn't work with the static registrar (due to a bug in the static registrar).
2020-12-18 11:45:06 +01:00