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

249 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 65590ba8c0 Merge remote-tracking branch 'origin/main' into msr 2023-05-18 15:19:39 +02:00
Rolf Bjarne Kvinge cdac4507a2
[devops] Stop building test dependencies on each test run. (#18096)
Stop building the test dependencies on each test run, and instead use the archived test dependencies we have from the main build:

* Stop running 'make all' in tests/ on every separate test run.
* Add a lot more stuff in the package-test-libraries.zip archive.
* Extract all the new stuff on every test run. We add stuff from outside the tests/
  directory, so adjust archive creation and extraction to use the root directory
  of the repository as the root of the zip archive as well.
* Also add the introspection dependencies to the same archive to simplify the logic.
* Fix xharness to not store absolute paths in generated projects.
* Fix test project to not automatically run make in tests/test-libraries when running
  on the bots.

Building the test dependencies takes ~10 minutes for each test run, so this saves
about that time for each test run.
2023-05-15 18:41:49 +02:00
Rolf Bjarne Kvinge 3ac9b8fc76 [xharness] Add new variations using the managed static registrar for monotouch-test. 2023-05-11 12:21:53 +02:00
Rolf Bjarne Kvinge f358715a38
[xharness] Use our own SetProperty to set properties instead of the SetTopLevelPropertyGroupValue extension method. (#18253)
This is because the SetTopLevelPropertyGroupValue method doesn't always
work as expected (it doesn't always set seomthing), while SetProperty does.

Fixing the SetTopLevelPropertyGroup method is somewhat complex, since it
lives in the dotnet/xharness repository, so instead use the SetProperty
method, which is our own (working) version.
2023-05-10 10:53:53 +02:00
Rolf Bjarne Kvinge 36af029204
Change all null checking expressions to use 'is' and 'is not'. (#18176)
Change all null checking expressions to use 'is null' and 'is not null'
instead of '== null' and '!= null'.

This was mostly done with sed, so code can probably be improved in many
other ways with manual inspection, but that will come over time.

Also add code to the autoformat script to automatically fix these issues in the future.
2023-05-05 17:52:19 +02:00
Rolf Bjarne Kvinge 185a9a8c9a
[xharness] Add a release + all optimization test variation of monotouch-test for desktop. (#18140)
Add a 'release + all optimization' test variation of monotouch-test for
macOS and Mac Catalyst.
2023-05-05 11:24:26 +02:00
Rolf Bjarne Kvinge 70e33e4924
[xharness] Unify MtouchExtraArgs and MonoBundlingExtraArgs handling when creating test variations. (#18215)
Make the code that creates test variations set a single BundlingArguments
property, and then when we generate the corresponding test project we set both
MtouchExtraArgs and MonoBundlingExtraArgs. The property that doesn't apply to
the current platform will just be ignored.
2023-05-04 22:44:55 +02:00
Rolf Bjarne Kvinge 066ab68bc6
[xharness] Append to MtouchExtraArgs/MonoBundlingExtraArgs instead of just setting the value. (#18200)
When generating/cloning test projects and modifying
MtouchExtraArgs/MonoBundlingExtraArgs, we always want to add to any existing
properties instead of overwriting them, so do exactly that.

With this change we now find the latest top-level PropertyGroup in the project
file with no Condition, and add a MtouchExtraArgs/MonoBundlingArgs that adds
to any existing property.
2023-05-04 17:09:50 +02:00
Rolf Bjarne Kvinge a4b5edd1d1
[xharness] Remove the MtouchExtraArgs parameters/properties/fields in numerous places. (#18182)
It's not being used for anything at all, it's only passing empty strings
around.
2023-05-03 14:10:11 +02:00
Rolf Bjarne Kvinge 6e2ff59b30
[tests] Port Cecil tests to a .NET test project. (#17836) 2023-03-23 08:34:52 +01:00
Rolf Bjarne Kvinge e86c77a773
[devops] Run .NET tests with the 'Windows' category on Windows (#17796) 2023-03-22 07:49:03 +01:00
Rolf Bjarne Kvinge 480a6ed844
[src/runtime] Fix lookup of RID-specific satellite resources. Fixes #16847. (#17117)
If we're creating a universal app, and here are satellite assemblies that are not
identical across all RuntimeIdentifiers, those assemblies will be stored in a RuntimeIdentifier-specific
subdirectory during the build.

Unfortunately we didn't know how to find those assemblies at runtime, causing localizations
in universal apps to not work.

This change will:

* Add support for looking in the directory where RID-specific satellite assemblies
  are stored.
* Add an assembly resolution event handler to our CoreCLR bridge so that we can
  execute our custom lookup code.
* Add an assembly resource lookup test to monotouch-test.
* Add a macOS + Mac Catalyst variation of monotouch-test to xharness that triggers
  the bug (a universal test app).

Fixes https://github.com/xamarin/xamarin-macios/issues/16847.
2023-01-13 21:58:34 +01:00
Rolf Bjarne Kvinge ab0294169f
[xharness] Bump the timeout for the .NET tests. (#17110)
We keep adding more and more tests...
2023-01-09 10:42:09 +01:00
Rolf Bjarne Kvinge 3bbf06aef2
[xharness] Print more diagnostic code during and after the test run. (#16709)
* Print the load average every 15 minutes. Also print a full process list if
  the load average > 10.
* Print a full process list of the system every hour.
* Print a summary to stdout at the end of the test run.

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2022-11-16 07:55:53 +01:00
Rolf Bjarne Kvinge 06945fb238
[xharness] Ignore Mac Catalyst if Mac Catalyst is disabled. (#16356) 2022-10-17 17:54:04 +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 e54019a336
[dotnet] Make it possible to specify the registrar using a 'Registrar' property in MSBuild. (#15483)
Co-authored-by: Marius Ungureanu <therzok@gmail.com>
2022-08-18 17:21:48 +02:00
Rolf Bjarne Kvinge c55fbdfef9
[xharness] Collect and upload any crash reports that occurred during the entire test run. (#15466) 2022-07-13 15:16:11 +02:00
Rolf Bjarne Kvinge 7ad3f2b740
Bump xharness. (#15423)
Bump xharness to get TCC fix:

53594edb70
2022-07-11 19:55:56 +02:00
Manuel de la Pena eee31cb3fa
Should be || not && (#15367) 2022-06-28 20:29:40 -04:00
Manuel de la Pena 2521d07ab2
[CI] Do not run introspection unless it has been selected. (#15342) 2022-06-24 12:45:26 -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
Manuel de la Pena 9b962748d9
[Harness] Revert label changes (#15101)
This reverts commit 0e179206d2.
This reverts commit 2953cf1fed.
2022-05-23 22:02:14 -04:00
Manuel de la Pena 2953cf1fed
[Xharness] Move to use a flag to decide what tests to use (#15032)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-05-18 10:50:19 -04:00
Rolf Bjarne Kvinge 06041ab37f
[xharness/devops] Enable .NET tests by default. (#14998)
Which alo means there's no need to select them if .NET is enabled.
2022-05-12 14:58:24 +02:00
Rolf Bjarne Kvinge 447e637ac0
[xharness] Fix logic to include the .NET xtro tests. (#14991)
Both 'IncludeXtro' and 'IncludeDotNet' must be set to run the .NET xtro tests
(which means they're ignored if either is false).
2022-05-12 08:20:06 +02:00
Manuel de la Pena 22ba05bed5
[Xharness] Enable nullable in the BuildProject class and clean code a little. (#14897) 2022-05-11 07:25:48 -04:00
Manuel de la Pena 99de095726
[XHarness] Enable nullable and fix some code issues (wrong inheritance) (#14867) 2022-05-06 17:14:00 -04:00
Manuel de la Pena caf68aac82
[Xharness]Enable nullability and update C# to new code patterns. (#14866)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-05-04 10:46:34 -04: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
Manuel de la Pena 7a69d08cf0
[Xharness] Clean test task code. (#14857)
We are going to be changing code in xharness. Is a good time to clean
things a little, make code more modern then enable nullability.

Try to get as much help from the new features and try to clean alittle
debt we have from the last time we moved code.
2022-04-30 10:12:31 -04:00
Rolf Bjarne Kvinge 277baaf521
[tests] Request labels after each test from NUnit. (#14628)
Fixes this NUnit warning:

> labels=All is deprecated and will be removed in a future release. Please use labels=Before instead.

We don't follow the suggestion from the warning, because the advantage of
writing the label after each test is that the test result will also be
printed, which means it's possible to see if any tests failed during the test
run, as opposed to having to wait until the entire test run is completed
(which can take a while) to realize that pretty much every test failed with
some silly mistake which could have been quickly fixed before re-running the
tests.
2022-04-04 19:19:45 +02:00
Rolf Bjarne Kvinge aa4f94bb05
[xharness] Don't test documentation, it's broken. (#14373)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-03-11 18:44:37 -05:00
Rolf Bjarne Kvinge 5ef6fac236 [xharness] Give the .NET tests another hour to complete. 2022-01-14 10:58:33 +01:00
Rolf Bjarne Kvinge 05ca39b211 [xharness] Bump timeout for .NET tests to 3 hours. 2021-12-22 21:50:33 +01:00
Přemek Vysoký 27cd6f78c3
[xharness] Compare the `TestExecutingResult.TimedOut` flag only (#13498) 2021-12-06 14:13:47 -05:00
Rolf Bjarne Kvinge b0a4dbfe91 [xharness] Add arm64/simulator variations for introspection and monotouch-test 2021-11-30 18:20:43 +01:00
Rolf Bjarne Kvinge f916702568 [xharness] Don't run both legacy and .NET xtro at the same time. 2021-11-25 00:20:22 +01:00
Rolf Bjarne Kvinge 7e255ddcb5 [xharness] Add support for running xtro in .NET mode. 2021-11-24 15:39:03 +01:00
Rolf Bjarne Kvinge 8e150c5bfe
[xharness] Bump to the latest version of Microsoft.DotNet.XHarness.iOS.Shared (1.0.0-prerelease.21527.2). (#12899)
* [xharness] Bump to the latest version of Microsoft.DotNet.XHarness.iOS.Shared (1.0.0-prerelease.21479.1).

* [xharness] Handle an exceptional condition when we fail to enumerate simulators.

* [xharness] Use new xharness API to select which simulators to use.

This also required bumping xharness.

* Bump again.

* Bump yet again.

* [xharness] Bump and fix according to API break.

* [xharness] Stop the listener before cancelling it.

Cancelling it doesn't do anything if the listener has connected, and that's
usually the case. This prevents subsequent logic from reading incomplete logs.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-11-02 07:43:07 +01:00
Rolf Bjarne Kvinge 02431b9fc8
[.NET] Move the nfloat type to the ObjCRuntime namespace for .NET. (#13092)
Also move the NMath type from the System namespace to the ObjCRuntime namespace.

Ref: https://github.com/xamarin/xamarin-macios/issues/13087
2021-10-28 11:06:31 +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 28102a55b7
[xharness] Set the EnableSGenConc value for all project configurations. (#12698)
* Update to use EnableSGenConc instead of MtouchEnableSGenConc (either works,
  the former is the new future).
* Set EnableSGenConc as a top-level property, so we make sure it's set no
  matter how the project is executed.

This makes it so that this setting work for .NET projects, where we're not using project configurations.
2021-09-13 16:13:59 +02:00
Rolf Bjarne Kvinge 7f1d62ca13
[xharness] Skip some device variations for .NET. (#12699)
Skip:

* Any Thumb variation (Thumb code isn't supported anymore in .NET).
* Any AssemblyBuildTarget variation (compiling assemblies to dylibs [fastdev]
  or frameworks - neither is supported/implemented for .NET).

This trims down the test list a bit.
2021-09-13 16:13:36 +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