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

70 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 7659696c23
[autoformat] Add xharness.csproj. (#16322) 2022-10-13 23:10:08 +02:00
Rolf Bjarne Kvinge 9e04da9006
[xharness] Fix typo in method name. (#15968) 2022-09-19 11:51:05 +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 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 3be1d9d760
Use unix-style line endings in project files. (#15303)
This also removes the BOM in a few project files.

This is a whitespace-only change, as can be seen here: https://github.com/xamarin/xamarin-macios/pull/15303/files?w=1
2022-06-21 17:22:58 +02:00
Přemek Vysoký 93bad76aae
Bump Microsoft.DotNet.XHarness.iOS.Shared to `1.0.0-prerelease.22157.2` (#14350)
I don't expect anything changed since Nov 19th but there might be miniature API changes this week so want to bump now and then after.
2022-03-09 18:32:44 +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 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 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
Přemek Vysoký 1c34588487
[xharness] Bump the shared library version
This is mainly to bring in this fix: dotnet/xharness@841114a
(two parameters were swapped and BundleIdentifier was set to AppPath)

Other changes contained:

We don't log the full XML when listing devices anymore, just the file size
SimulatorLoader has a new method that accepts retryCount
2021-01-08 15:47:56 -05: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
Rolf Bjarne Kvinge 1eb0c2cd3b [tests] Info.plists should be inside LogicalName, not Link.
This makes it possible to simplify a bit more code inside xharness as well.
2020-07-23 15:34:58 +02:00
Rolf Bjarne Kvinge 4a10ba51db
[xharness] Generate BCL projects asynchronously. (#9083)
Split the BCL project generation in two: one part that figures out which
projects to generate, and which is done synchronously (because we need it to
compute the list of tests), then split out the actual generation and run it on
a background thread (since that doesn't have to happen until we want to
execute those tests).

This speeds up launching xharness in server mode significantly (from ~2s to
~0.2s).
2020-07-21 17:14:36 +02:00
Rolf Bjarne Kvinge af1323f4c5
[xharness] Always capture stdout/stderr from the simulator to actual files. (#8689)
This avoids confusion when tests are run locally using 'make runner' (and
would print the simulator's stdout/stderr to the terminal) versus when run on
bots (and would write the simulator's stdout/stderr to separate files that
would show up in the html report).
2020-05-27 15:31:20 +02:00
Manuel de la Pena 488bce571e
[Harness] Refactor Hml generation. (#8686)
This is a step towards trying to make the modification of the html
easier for other team members, the are just to small logical changes:

1. Removed the GenerateReportImpl to a HtmlReportWriter.
2. Do not make the HtmlReportWriter call the Marckdown one, the are
independent.

There is room for improvement, since there are some collections
re-calculated. That change will come once we have this out of the way.

At some point, we ought to be able to make changes in the html just be
as hard as they should be (html + css, we are not experts on that).
2020-05-26 22:11:09 -04:00
Manuel de la Pena 17e413fa7b
[Harness] Move the logic to reload the simulators outside Jenkins. (#8658)
Following other PRs, try to reduce the work of the Jenkins class to
orchestrate the different classes and move any other logic to classes
with a single concern. Add tests for the new class.
2020-05-25 20:03:04 -04:00
Manuel de la Pena efd7fa6d46
[Harness] Move the resource manager implementation out of Jenkins. (#8660)
Move the resource management out of Jenkins. Add tests to the new class.
2020-05-25 16:10:50 -04:00
Manuel de la Pena 98016a760e
[Harness] Move the periodic command execution logic out of Jenkins. (#8657)
Move the logic out, Jenkins class should just orchestrate all the diff
tasks but should not know how they are executed.
2020-05-25 10:00:57 -04:00
Rolf Bjarne Kvinge b601c5c62a
[xharness] Make AppBundleInformationParser.ParseFromProject async and make it take an ILog and a IProcessManager. (#8662)
This will be required in a later PR.
2020-05-25 14:47:10 +02:00
Manuel de la Pena 465ba9b2e7
[Harness] Move the Markdown code out of Jenkins + tests. (#8651)
Move the generation of the markdown out and add tests. Make sure that
the report writes the expected results and specially that it shows the
known issues.
2020-05-21 23:56:30 -04:00
Manuel de la Pena ea514286ba
[Harness] Move the definition of the tasks outside of the jenkins class. (#8635)
Create some enumerables that will state the tests to run, that way, if
new tests need to be added, there will not be a need to edit the
jenkins class.

Add tests to ensure that all the tests are added. That away we will make
sure that tests are not removed by accident.
2020-05-21 12:48:05 -04:00
Manuel de la Pena 7d320fb9b6
[Harness] Move GetColor method out of Jekins. (#8616)
Reduce the logic that is not related to the execution of tests out of
jenkins. Add tests.
2020-05-19 15:37:56 -04:00
Manuel de la Pena 2187eadf05
[Harness] Move the generation of the variations out. (#8611)
Try to make the Jenkins class do a single task. Move the generation of
the variations logic out (which is hard to test atm, but will be doable
in a second round).

Moved some useful methos also out and add tests.
2020-05-19 11:13:31 -04:00
Manuel de la Pena 52afa11bbd
[Harness] Fix broken tests. (#8551)
Tests are not ran as part of the CI and got borken again. Fix them, will
add them as part of the CI once they land fixed.
2020-05-11 09:52:24 -04:00
Manuel de la Pena 16ad7e642d
[Harness] Small refactor to get the knowledge base out of jenkins. (#8502)
* [Harness] Small refactor to get the knowledge base out of jenkins.

Some small changes to make things a little easier to understand:

* Add a new method in case we find known install issues.
* enable nullable, lets go step by step.
* Move logic outside Jenkins.cs
* Add tests! \o/
2020-05-04 15:09:19 -04:00
Manuel de la Pena 617777ae73
[Harness] Add support to create tunnels. (#8446)
* [Harness] Add support to create tunnels.

Add support to create tunnels in case the devices cannot connect to
the host. This option is false by default, which means that unless told
otherwise xharness will try to se a tcp connection over the WiFi.

We are not setting it as default because the devices in DDFun will have
access to an unrestricted network. Nevertheless after this PR we will
create a new one with the following logic:

1. Try to use the tcp connection using the network.
2. If devices cannot connect to the host via the network, fall back to
the tcp tunnel.

This change executes a tunnel process per test application, most of the
cases out of the 150 test application we execute, most of them (maybe 98%
but most % are made up) will pass, and just a few of them will fail. The
reason is that there is a daemon in the OS that gets underwater.

Rather than tryingt o find a hacky way to re-use the tunnel, lets KISS
and if we need to hack that, do it as an enhancement.
2020-05-04 13:21:38 -04:00
Přemek Vysoký 530f2a2bfa
[Harness] Rename device management classes (Devices, Simulators, ILoadAsync) (#8295) 2020-04-06 14:33:27 -04:00
Přemek Vysoký b4a262eb42
Fix unit tests, make Devices fields readonly (#8293) 2020-04-06 10:57:31 -04:00
Přemek Vysoký ce9f9278b6
[Harness] Move TestImporter into the shared library (#8283) 2020-04-03 18:28:49 -04:00
Manuel de la Pena d7160b3dcf
[Harness] Completely remove the BCL prefix from the test importer. (#8224)
Remove the last BCLPrefix and move the InfoPlistGenerator to the managed
namespace since it is part of the managed template.
2020-04-03 11:01:56 -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
Manuel de la Pena f383593924
[Harness] Merge the Generator and the Factory in a same object and rename namespace. (#8222)
The Generator and the Factory classes are a xamarin-macios thing.
Initially, they were separated because the code that generated the bcl
tests was not inside xharness. That is not longer the case. We can merge
both classes, generalize the namespace and be more prepared to move out
of the xamarin-macios repo.
2020-03-30 23:23:33 -04:00
Manuel de la Pena bdce02622f
[Harness] Remove the BCLTestProjectInfo class. (#8221)
Remove two classes that are not really needed and a method. We moved to
named tuples to make things simpler. Unfortunally C# does not support:

```csharp
using MyNamedTuple = (string Name, double value, bool answer);
```

But we have to live with this. Makes the namespace simpler and removes
confusion with the already present project classes that are more widely
used.

* [Harness] Remove the BCLTestProjectInfo class.

The class is not really needed. Move to a tuple, make the definition of
the group test project nicer since the dictionary initiallization makes
it cleaner.
2020-03-30 15:20:50 -04:00
Manuel de la Pena 728442e01f
[Harness] If empty nodes are found, do not crash. (#8201)
Looks like we have cases in which we get empty nodes when listing
devices, which makes the parsing of the nodes fail and crash.

Move the code to a diff method, try to parse the data, if there is an
exception (missing data) return null. If null is returned, do not add
it.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8160
2020-03-30 10:41:38 -04:00
Manuel de la Pena b371133216
[Harness] Verify that issue #8214 is fixed. (#8229)
Added a test in the xml parser that verifies that the parsing of the xml
is correct and that the correct number of failures is reported in the
human readable form.

fixes: https://github.com/xamarin/xamarin-macios/issues/8214
2020-03-30 07:29:22 -04:00
Manuel de la Pena 3623d7a72f
[Harness] Remove not needed classes from the BCLTestImporter. (#8218)
Remove two classes that are not really needed and a method. We moved to
named tuples to make things simpler. Unfortunally C# does not support:

```csharp
using MyNamedTuple = (string Name, double value, bool answer);
```

But we have to live with this. Makes the namespace simpler and removes
confusion with the already present project classes that are more widely
used.
2020-03-30 07:26:15 -04:00
Přemek Vysoký 7d47b073cf
[Harness] Remove AppRunner references from TestReporter (#8212) 2020-03-29 12:02:03 -04:00
Přemek Vysoký 6209719f51
[Harness] Remove Harness as a dependency (#8203) 2020-03-27 12:41:31 -04:00
Přemek Vysoký 46a2d96c55
[Harness] Fix XHarness unit tests (#8208)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-27 09:46:54 -04:00
Přemek Vysoký a48667b761
[Harness] Remove TextWriter dependency, refactor Logging (#8184) 2020-03-26 09:59:43 -04:00
Přemek Vysoký d98c515a4c
[Harness] Add strongly typed mlaunch args and escape them (#8167)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-25 10:59:29 -04:00
Manuel de la Pena 0324fbab34
[Harness] Refactor, simplify and fix issues in the result parsing. (#8183)
Refactor result parsing and test it. Make sure that all the possible
corner cases are taken into account. The changes are as follow:

1. Move all the logic to a new class, which will take care of the reustl
parsing.
2. Simplify the parsing method by splitting the noise code to other
functions. There is no need to parse several files in the same method.
3. Add tests that make sure that the correct result is returned when:
  a. The app cannot launch.
  b. The app timesout.
  c. The app crashes.
2020-03-25 02:44:47 -04:00
Přemek Vysoký 6a58674960
Extract AppBundleInformationParser (#8174) 2020-03-24 10:02:22 +01:00
Přemek Vysoký 29e978e0be
[Harness] Add AppRunner.RunAsync unit tests (#8159)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-20 14:18:28 -04:00
Přemek Vysoký ec420e6740
[Harness] Make CrashSnapshotReporter injectable and add unit tests (#8129)
* Move AppInstallMonitorLog

* Move Helpers.GenerateStableGuid

* Move DirectoryUtilities

* Move DirectoryUtilities.RootDirectory

* Add CrashSnapshot ctor

* refactor CrashReportSnapshot

* Add WrenchLog

* Move stuff out of Harness

* Remove RootDirectory

* Revert RootDirectory

* Remove Initialize() calls

* Make CrashReportSnapshot injectable

* Remove Harness dependency from CrashReportSnapshot

* Add device snapshot tests

* Trim down IHarness and make properties of Harness readonly

* Memoize xcoderoot

* Use MlaunchArguments

* Add MlaunchArguments docs

* Add CrashReportSnapshot docs

* Rename method

* Rename class

* Refactor CrashSnapshotReporter

* Inject AppRunner

* Indent parameters

* Indent parameters

* Fix unit tests

* Fix gathering crash logs

* Add crash logs to output

* Fix getting xcode root

* Fix alignment

Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-20 11:42:43 +01: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
Manuel de la Pena a4b71841df
[Harness] Create a more general TestAssemblyDefinition. (#8149)
XHarness TestAssemblyDefinition is very particular on the way we deal
with the mono test assemblies, in the general case, it only contains the
assembly name, but in the xamarin-macios it calculates the name of the
assembly using the platform.

Create an interface so that the command line was its own implementaiton
and move as much as possible to use the AssemblyLocator class. Later we
can add two simpler implementations for the more general cases.

Move the AssemblyLocator out of the Templates namespace since it makes
more sense.
2020-03-19 13:40:13 -04:00
Přemek Vysoký f8d744cf54
Create DeviceLogCapturer factory and inject it (#8154)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-19 13:38:35 -04:00
Přemek Vysoký 5422d4f9b8
Inject ProcessManager into SimulatorDevice (#8145)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-19 13:37:21 -04:00
Přemek Vysoký 16cbf4a025
Create CaptureLogFactory and make CaptureLog injectable (#8141)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-18 18:39:10 -04:00