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

1351 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 2eccd8810c
[xharness] Bump the timeout for the cecil tests. (#19679)
It seems it's getting close to 5 minutes for slower bots, once in a while
hitting it, causing unnecessary test failures.
2023-12-20 14:45:14 +01:00
Rolf Bjarne Kvinge d4e49a53d2
[xharness] Fix a few minor code issues + wrong copyright. (#19583) 2023-12-07 08:05:39 +01:00
Rolf Bjarne Kvinge 107d644b55
[xharness] Convert to .NET. (#19541)
* Convert xharness.csproj and Xharness.Tests.csproj to .NET/sdk-style projects.
* Fix numerous nullability issues that came up.
* Adjust Make logic to do the correct thing now that the executable is named differently.
* Port usage of WebClient to HttpClient, since WebClient is deprecated.
* Find an alternative solution to System.Web.MimeMapping.GetMimeMapping, which
  doesn’t exist in .NET.
* Fix misc other warnings and errors.
2023-12-06 15:57:12 +01:00
Rolf Bjarne Kvinge 1ddc0b4b74
Get Mono.Cecil from NuGet everywhere. (#19535)
Also:

* Store the version in Directory.Build.props, which makes it much easier to update.
* Bump all versions to latest (0.11.5).
2023-12-04 20:15:03 +01:00
Rolf Bjarne Kvinge 3f9e00cb27
[install-source] Migrate project to use PackageReference instead of package.config. (#19536) 2023-11-29 16:23:34 +01:00
Rolf Bjarne Kvinge eeb0aaaf19
Update the Mono.Options package references to the same (latest) version everywhere. (#19457) 2023-11-16 14:01:45 +01:00
Rolf Bjarne Kvinge 7df4fc3274
[dotnet] Complete support for universal builds when using NativeAOT. (#19183)
We couldn't do universal builds using NativeAOT, because .NET had a sanity
check that was a bit too eager and caused unnecessary build failures. We've
now been able to add an escape hatch to that sanity check, so let's use it.

This makes universal builds using NativeAOT work, so we can also enable/add
corresponding test variations in xharness.

Also ask the runtime to allow SelfContained without a RuntimeIdentifier (the
runtime has an overeager sanity check that doesn't apply to us, so we must
skip it). Fixes #19142.

Fixes https://github.com/xamarin/xamarin-macios/issues/19142.
Fixes https://github.com/xamarin/xamarin-macios/issues/19206.
2023-10-16 10:19:55 +02:00
Rolf Bjarne Kvinge 7e3eeb1dab [net8.0] Merge main into net8.0. 2023-09-20 19:20:32 +02:00
Rolf Bjarne Kvinge 2b439fc0b7
[tests] Remove the 32-bit/64-bit difference for iOS tests. (#19053)
This fixes an issue where we wouldn't enable the mtouch tests, because we
check if iOS is enabled to enable them, and it turns out iOS isn't enabled by
default, only 64-bit iOS.

This is rather unintuitive, so just remove the 32-bit/64-bit distinction in
xharness and Azure Pipeline, since our support for 32-bit iOS is very rapidly
going away (with Xcode 15 support) anyway.
2023-09-20 19:07:37 +02:00
Rolf Bjarne Kvinge 1a1fc93201
[xharness] Fix parsing configuration files. (#19052)
When parsing configuration files, our logic works on a first-come-wins basis,
where the first time we find a variable, that's the value we get.

In the makefiles it's the opposite: the final value is the last time a variable is set.

This means we must parse configuration files in the reverse order, otherwise this:

    INCLUDE_IOS=
    INCLUDE_IOS=1

will get the opposite result of what we want.
2023-09-20 08:25:36 +02:00
Rolf Bjarne Kvinge f88dc4406d [net8.0] Merge main into net8.0. 2023-09-14 07:23:52 +02:00
Rolf Bjarne Kvinge 862e232ef3
[xharness] Ignore the mtouch tests if iOS isn't enabled. (#18998)
This fixes an issue where we'd try to run the mtouch tests when only
macOS is the enabled platform.
2023-09-13 12:08:21 +02:00
Rolf Bjarne Kvinge 8ac62371e4 [net8.0] Merge main into net8.0. 2023-09-06 12:22:22 +02:00
Rolf Bjarne Kvinge 6f586dfa45
[xharness] Use .NET to build the MSBuild test projects. (#18895)
This is one more step towards dropping Mono, and also solves a random
network failure when doing 'nuget restore' with Mono (due to a bug in Mono).
2023-09-05 08:08:25 +02:00
Rolf Bjarne Kvinge d50f52df06
Add support for NativeAOT on macOS (#18765)
Co-authored-by: Filip Navara <navara@emclient.com>
2023-08-30 10:38:43 +02:00
Rolf Bjarne Kvinge 78b649c4e1 [net8.0] Merge main into net8.0. 2023-08-29 11:24:40 +02:00
Rolf Bjarne Kvinge 45225dc88d
[dotnet] Parameterize the pack names. (#18732)
We're going to change the pack names to support multi-targeting, so ahead
of the pack name change I'm changing the existing logic to use a variable
for the pack name in most places (this will make the rename much easier and
simpler).

These changes should have no effect by themselves.
2023-08-29 10:06:46 +02:00
Rolf Bjarne Kvinge 645ce96798 [net8.0] Merge main into net8.0. 2023-08-28 18:16:00 +02:00
Rolf Bjarne Kvinge d9405ff27c
[tests] Misc changes to make tests work/pass when .NET isn't enabled. (#18828) 2023-08-28 16:15:28 +02:00
Rolf Bjarne Kvinge c8ae3dc072 [net8.0] Merge main into net8.0. 2023-08-16 11:19:56 +02:00
Rolf Bjarne Kvinge 47b5601ffc
[tests/xharness] Add support for setting test configuration using environment variables. (#18738)
Setting test configuration variables using the environment is useful
when running tests on a Windows machine (easier than having to deal with
make).

Also refactor the code a bit to not use constants, and more consistent
naming.
2023-08-16 10:34:02 +02:00
Rolf Bjarne Kvinge ac90c511d1 [net8.0] Merge main into net8.0. 2023-08-14 15:36:54 +02:00
Rolf Bjarne Kvinge 8732e1cedd
[xharness] Stop hardcoding the target framework in xharness. (#18682) 2023-08-10 13:14:34 +02:00
Rolf Bjarne Kvinge 2eddcf8eea
[tests] Parse configure.inc for build settings as well. (#18674)
Additionally parse files in reverse order, because any variables at the
end should take precedence (when parsing config files the first time
variable is found is the one we use).
2023-08-10 07:55:50 +02:00
Rolf Bjarne Kvinge a33c80d6c7
[net8.0] Change the default RuntimeIdentifier. (#18495)
* When publishing a mobile app, choose a device architecture (as opposed
  to showing an error if none was specified by the developer)
* When building for the simulator, choose the arm64 runtime identifier
  if we're running on an arm64 machine.
* When building a Debug build for desktop, choose the arm64 runtime
  identifier if we're running on an arm64 machine.

Fixes https://github.com/xamarin/xamarin-macios/issues/18455.
Fixes https://github.com/xamarin/xamarin-macios/issues/16152.
Fixes https://github.com/xamarin/xamarin-macios/issues/17841.

Section in the release notes: https://github.com/xamarin/xamarin-macios/wiki/.NET-8-release-notes#default-runtimeidentifiers

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-08-07 17:51:37 +02:00
Rolf Bjarne Kvinge 729c403704 [net8.0] Merge main into net8.0. 2023-08-04 14:28:12 +02:00
Alexander Köplinger bfb8665d19
Convert XHarness.Tests from packages.config to PackageReference and add darc dependency (#18611)
Also needed a few tweaks to fix build errors that were introduced
recently.

---------

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2023-08-02 13:39:33 +02:00
Rolf Bjarne Kvinge 34667ebce6 [net8.0] Merge main into net8.0. 2023-08-01 17:10:44 +02:00
Manuel de la Pena 78f8985ac5
Update tests/xharness/Harness.cs 2023-07-28 12:50:37 -04:00
Manuel de la Pena a4972fd1bd Merge branch 'fix-mlaunch-location' of github.com:mandel-macaque/xamarin-macios into fix-mlaunch-location 2023-07-28 12:48:45 -04:00
Manuel de la Pena cc78a45eb6 Fix ompilation. 2023-07-28 12:45:21 -04:00
Manuel de la Pena 3a02f2b721
Update tests/xharness/Harness.cs
Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2023-07-28 11:32:18 -04:00
Manuel de la Pena 290206629a [Xharness] Fix path to mlaunch when using mlaunch from a .NET SDK pack on CI.
This commit fixes the code that was added in
https://github.com/xamarin/xamarin-macios/pull/16361.

The previous change uses the version number that is part of the config
file in the current build machine. That is correct when we are working
when we are running the tests in the same machine that built them. That
IS NOT THE CASE when building on CI.

Back when the CI did the separation to accommodate the EO we noticed
that if the workload is built in a diff machine, the versions were not
to be trusted, that is why the CI sets and enviroment variable to track
the version that was built in the original step. This change check if we
are on the CI, if we are we trust the version given by the previos
machine, else we use the config one.
2023-07-28 11:13:28 -04:00
Rolf Bjarne Kvinge 94cdec2f53 [xharness] Disable NativeAOT test variations for Mac Catalyst for now, we need a few upstream fixes. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge e31b0a6dc4 [xharness] Disable NativeAOT test variations for macOS for now, we're waiting for a dotnet/runtime fix. 2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 7d65804e32 [dotnet/tests] Only use NativeAOT when publishing.
This matches how NativeAOT works for other platforms.
2023-06-22 08:44:47 +02:00
Rolf Bjarne Kvinge 7f15d8625e [xharness] Add a NativeAOT variation of monotouch-test. 2023-06-21 20:49:50 +02:00
Rolf Bjarne Kvinge 6f1c0ea534 [net8.0] Merge main into net8.0. 2023-06-08 13:32:48 +02:00
Rolf Bjarne Kvinge 9e2143032f
Use Enum.GetValues<T> instead of Enum.GetValues in numerous places for .NET. (#18382)
NativeAOT warns about Enum.GetValues and suggests using Enum.GetValues<T>
instead, so do just that.
2023-06-07 08:47:55 +02:00
Rolf Bjarne Kvinge ab73088c0b [net8.0] Merge main into net8.0. 2023-05-19 08:06:07 +02:00
Rolf Bjarne Kvinge 65590ba8c0 Merge remote-tracking branch 'origin/main' into msr 2023-05-18 15:19:39 +02:00
Rolf Bjarne Kvinge 50cc0bedbe [net8.0] Merge main into net8.0. 2023-05-17 08:28:14 +02:00
Rolf Bjarne Kvinge 43cb1e8dcb
Auto-format source code. (#18278)
The autoformatter was down for a litle while, and these issues crept in.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
2023-05-16 12:46:24 +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 b8c7dc7dc3 [net8.0] Merge main into net8.0. 2023-05-11 11:54:37 +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