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

36 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7659696c23
[autoformat] Add xharness.csproj. (#16322) 2022-10-13 23:10:08 +02: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 0069323b6a
[Xharness] Add a label per test project to later be able to filter them. (#14844) 2022-05-04 10:46:07 -04:00
Přemek Vysoký 1730426ec9
[Xharness] Bump Microsoft.DotNet.XHarness.iOS.Shared to `1.0.0-prerelease.22211.4` (#14743) 2022-04-14 16:10:14 -04: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 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge fe0cc33b8c
[xharness] Disable msbuild node reuse to fix issue with msbuild processes interfering with eachother. (#11689)
Fixes https://github.com/xamarin/maccore/issues/2444.
2021-05-26 20:36:48 +02:00
Přemek Vysoký 0fba63cdc7
[xharness] Remove Microsoft.DotNet.XHarness.iOS.Shared project and use NuGet instead (#9980) 2020-11-13 11:05:10 -05:00
Manuel de la Pena 9ddb35720b
[Harness] Add a more general IHarness interface. (#8868)
In order to be able to test the TestSelectro in PR
https://github.com/xamarin/xamarin-macios/pull/8768 we need a more
general interface to mock and ensure that the correct properties are set
by the TestSelector.
2020-06-16 16:04:38 -04:00
Přemek Vysoký b14a055265
[Harness] Move code to a shared library (#8234)
- Code that will later be moved to the `dotnet/xharness` repo is first moved to an isolated project before it will be extracted to the new repo and NuGetified
- New project for the shared code and new test project for tests accompanying the moved code are created
- Only Factories are left behind that are used only by XHarness
2020-04-01 13:32:21 -04:00
Přemek Vysoký 6209719f51
[Harness] Remove Harness as a dependency (#8203) 2020-03-27 12:41:31 -04:00
Manuel de la Pena 79a089cd0d
[Harness] Generalize XmlResultParser. (#8156)
First step to try and clean up the psring of results and ensure that we
are doing the correct thing. We have several issue there. We want to
move all the complicated logic out of AppRunner and test the different
outputs and the full result matrix.

This commit first allows to use an instance class for the parsing, later
we will move things out. Step by step
2020-03-19 17:42:51 -04:00
Přemek Vysoký 5f2905c5a4
[Harness] Move utilities out of Harness.cs (#8125)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-17 14:42:21 -04:00
Přemek Vysoký ef9f7e4e9b
[Harness] Make Harness properties immutable (#8093)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-13 10:41:02 -04:00
Rolf Bjarne Kvinge f2063efefb
Revert "[Harness] Move utilities out from Harness.cs, refactor AppRunner fields (#8074)" (#8082)
* Revert "[Harness] Refactor simulators and devices listing. (#8064)"

This reverts commit e53b686ef6.

* Revert "[Harness] Move utilities out from Harness.cs, refactor AppRunner fields (#8074)"

This reverts commit 78dd3b861c.
2020-03-11 10:38:03 +01:00
Přemek Vysoký 78dd3b861c
[Harness] Move utilities out from Harness.cs, refactor AppRunner fields (#8074)
Move all the extension methods to a class. After this refactor, we will
be able to DI the manager in the other classes and assert that the
processes are called with the correct parameters without the need of
launching them.

Also added tests for the manager. We create a dummy console app that
will be executed by the tests. The console app has a number of
parameters that will be used to ensure that the new process behaves as
we want:

- Use the passed exit code.
- Create child proecesses if needed.
- Sleep to force a timeout.
- Writer messages to stdout and stderr.

Our tests call the dummy app and ensures that the results match the
behaviour expected by the dummy app.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-10 12:44:18 -04:00
Přemek Vysoký fa7ffbcabc
[Harness] Split out Targets, Utils and remove external links (#8061)
* [Harness] Refactor process management to be testable.

Move all the extension methods to a class. After this refactor, we will
be able to DI the manager in the other classes and assert that the
processes are called with the correct parameters without the need of
launching them.

Also added tests for the manager. We create a dummy console app that
will be executed by the tests. The console app has a number of
parameters that will be used to ensure that the new process behaves as
we want:

- Use the passed exit code.
- Create child proecesses if needed.
- Sleep to force a timeout.
- Writer messages to stdout and stderr.

Our tests call the dummy app and ensures that the results match the
behaviour expected by the dummy app.

* Apply suggestions from code review

Co-Authored-By: Přemek Vysoký <premek.vysoky@microsoft.com>

* Move out utils into a separate namespace

* Move Cache to the test project

* Fix namespaces after merge

* Remove unneeded code

* Move Target files

* Sort csproj

* Refactor Targets

* Rename Cache to TempDirectory

* Fix using

* Move ProjectFileExtensions

* Remove dead code

* Move Extensions

* Add empty StringUtilsTests

* Add StringUtils tests

* Revert refactorings

* Update tests/xharness/Utilities/StringUtils.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Update tests/xharness/Utilities/StringUtils.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

* Add better formatarguments test

* Update tests/xharness/Utilities/StringUtils.cs

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-10 13:12:33 +01:00
Manuel de la Pena 169cecfe93
[Harness] Refactor a little the code for logging to simplify testing. (#8021)
Move to use interfaces, that will let us later add tests that will
verify that all the correct logging is performed. As an example, added a
test for XmlResultParser that ensures that the failures are correctly
generated. The test uses Moq to pass the different paths to be used and
later be able to verify the wirtten xml.
2020-03-03 13:59:44 -05:00
Manuel de la Pena dc57f88e9f
[Xharness] We support diff xml outputs. Allow to pass the desired one. (#7971)
We support different outputs, lets add the avility for the caller to
decide which one to use. We default to NUnit V3 due to or dependency to
it in VSTS.
2020-02-27 20:10:48 -05:00
Rolf Bjarne Kvinge 303aa0a649 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +02:00
Rolf Bjarne Kvinge 2fe7377003
[tests] Remove 32-bit Xamarin.Mac tests (both Classic and Unified). (#6301)
* [tests] Remove 32-bit Xamarin.Mac tests (both Classic and Unified).

We're removing support for 32-bit Xamarin.Mac apps (#6300), which means we
don't need to run the tests anymore.

This part of the implementation for #6300, I'm starting with the tests because
some of our XM/Classic tests are failing and making the bots unnecessarily red
(since we'll remove XM/Classic support anyway). Also CI will be faster if we
don't run these tests.

* [mmptest] Fix build.

* [tests] Fix build for mono-native-mac.csproj.
2019-06-17 08:03:58 +02:00
Manuel de la Pena f1c7d1e3fd
[Harness] Pass extra arguments to configure the linker for certain tests (#6143)
Some tests need a special linker configuration. Add the extra arguments
so that tests do pass on device.

Fixes: https://github.com/xamarin/maccore/issues/1608
2019-05-28 07:04:42 -07:00
Rolf Bjarne Kvinge 9d65e42f58 Fix testing 32-bit XM apps. Fixes maccore issue 884. (#4555)
* [jenkins] Only XM apps with variations are Classic/32-bit apps, so adjust ignore logic accordingly. Fixes maccore issue 884.

Fixes https://github.com/xamarin/maccore/issues/884.

* [mmp] Fix passing -stdlib=libc++ to clang.

* [tests] Fix 32-bit XM issues.

* [xharness] Add support for building 32-bit XM apps by using Xcode 9.4.

* [xharness] Since xharness can now build 32-bit mac apps, enable them by default.

* Remove debug code.

* Remove unused variable.
2018-08-03 17:06:23 -04:00
Rolf Bjarne Kvinge 79f193709b
[xharness] Make it possible to select from the command line whether tests requiring system permissions should be executed or not. (#3053) 2017-11-28 19:16:46 +01:00
Rolf Bjarne Kvinge 6d063afdb5
[tests] Run the tests on Wrench like we do on Jenkins. (#3026)
* [xharness] Add support for executing a command periodically.

This will be used to run 'rsync' on bots to upload the html report somewhere
while the tests are running.

* [tests] Disable all the wrench test targets, and instead run the jenkins target (only) on wrench.

* [xharness] Write xharness log to stdout as well on wrench.

Wrench has a 30-min stdout timeout: if nothing is printed in 30 minutes, then
the step fails. Printing the harness log to stdout makes us not hit this
timeout.

* [xharness] Timestamp a few more logs.

* [xharness] Disable the @MonkeyWrench calls, since we're not uploading directly to wrench anymore.
2017-11-22 16:03:36 +01:00
Rolf Bjarne Kvinge 71a17aa673 [xharness] Add support for generating only specific variations for iOS projects. Fixes #57529 (#2751)
And use it to skip watchOS tests for Mono.Security, since we don't ship Mono.Security.dll for watchOS.

https://bugzilla.xamarin.com/show_bug.cgi?id=57529
2017-09-22 18:04:32 +02:00
Rolf Bjarne Kvinge fa98739e94 [xharness] Add support for writing a summary in markdown format. (#2563)
This is useful for VSTS, which allows for showing a file in markdown format on
the front page of a build.
2017-08-29 14:59:37 +02:00
Rolf Bjarne Kvinge 9f8f96a1de [xharness] Add support for specifying labels on the command line to select what to do. (#2414) 2017-08-03 14:31:02 +02:00
Rolf Bjarne Kvinge 9f02c44613 [xharness] Add support for using the system's Xamarin.iOS/Xamarin.Mac instead of a locally build one. (#1498)
* [tests] Use the target directory from the loaded configuration.

* [xharness] Find the root directory based on xharness.exe's location (unless specified).

* [tests] Add makefile target to generate test config using the system XI.
2017-01-16 07:24:14 +01:00
Rolf Bjarne Kvinge ab21da1b85 [xharness] Add support for uninstalling apps from device. (#1413)
The new error message / number is used in mlaunch.
2017-01-02 08:58:46 +01:00
Rolf Bjarne Kvinge 281f1bbe07 [xharness] Clear XCODE_DEVELOPER_DIR_PATH from the environment. (#1417) 2016-12-24 10:55:51 -05:00
Rolf Bjarne Kvinge 15b1204874 [xharness] Unify simulator selection code between Jenkins and Wrench and automatically create device pairs if none applicable is found. (#1202)
* [xharness] Don't crash if we can't find a simulator.

* [xharness] Create a device pair if none applicable is found.

* [xharness] Use an enum instead of string values for the target.

* [xharness] Unify the simulator selection code between Jenkins and Wrench.
2016-11-16 15:23:11 +01:00
Rolf Bjarne Kvinge 56fc26b26f [xharness] Split the mscorlib/System test run for watchOS into multiple executions. (#564)
* [tests] Implement filtering based on test name to make it possible to run a subset of tests manually.

* [xharness] Add support for passing environment variables to test apps.

* [xharness] Split the mscorlib/System test run for watchOS into multiple executions.

When running on a watch, the complete set of mscorlib and System tests use too
much memory, so they end up crashing the app.

So instead don't run all the tests in the same test run, but
instead split them up.

This splits the System tests in 5 different sets, based on the first
character of the test class name.

The mscorlib tests are split in 26 different sets, one for each
character (A-Z).
2016-08-05 22:28:13 +02:00
Rolf Bjarne Kvinge d9bf0e1728 [xharness] Add support for building and running mac tests on jenkins. 2016-06-15 10:51:14 -07:00
Rolf Bjarne Kvinge d135612f59 [tests] Implement support in xharness for running the simulator tests grouped by simulator, and write out an html report. 2016-06-15 10:51:14 -07:00
Rolf Bjarne Kvinge ecfdea9508 [tests] Import 2016-05-26 15:06:52 +02:00