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

1118 Коммитов

Автор SHA1 Сообщение Дата
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ý 723ec1857c
[Harness] Refactor simple listeners (#8120)
* Add RunMode, DeviceClass

* Inject dependencies into AppRunner

* Add all readonly fields to ctor

* Add basic AppRunner tests

* Add first proper Install test

* Add Uninstall tests

* Refactor listener ctors

* Update tests/xharness/Harness.cs

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

* Use InvalidOperationException

* Hide fields

* Add TODO

Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-17 10:16:19 +01:00
Manuel de la Pena 5209b19ef4
[Harness] Move all test project generation to the template object. (#8122)
At this point the BCLTestProjectGenerator class just represents a configuration class that knows about the project that are particular to xamarin-macios. All the logic that creates the projects has been moved to the XamariniOSTemplate which creates the project using the information passed by the config class.

At this stage, we have the ability to generate test projects by simply passing the info classes, which can be built either by a class (like the generator one) or a command line. We have fully decoupled the project generation from Xharness.

Tests have been added or moved to the correct location.
2020-03-16 18:52:41 -04:00
Přemek Vysoký d1666d524d
Add MLaunchArgument classes (#8123)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-16 16:09:27 -04:00
Přemek Vysoký 26903778fb
[Harness] Refactor and unit-test AppRunner (#8117)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-16 09:26:46 -04:00
Manuel de la Pena 82bd730ee3
[Harness] Add several fixes to the crash reports. (#8107)
The name of the tests is picked up in a more inner node than
expected. Fwd the test name to make sure that noe all
crashes/timeouts/launches have the same name.
Add extra information when we have a timeout. We want to know the
name and the bot used to ensure that it is easier to identify patterns.
Timeout tests now have:

test title as: App Timeout {AppName} {Variation} on bot {device_name}
message: AppName} {Variation} Test run timed out after {timeout.TotalMinutes} minute(s) on bot {device_name}.
Build issues now have:

test title: App Build {projectTask.TestName} {projectTask.Variation}
That way we know the exact app that failed to build and the exact app that timeout and the device used to run it.
2020-03-13 18:15:02 -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
Manuel de la Pena e96c56bf3c
[Harness] Fix bug in TCCDb editing that is missing using the watchapp id. (#8098)
The wrong var name was used and the table was not correctly updated.
Updated tests to take into account the new \n in the sql.
2020-03-12 13:46:29 -04:00
Manuel de la Pena 7332c92263
[Harness] Move the templates src to be embedded resources. (#8090)
Move the project templates to be a resource in the dll. That way we can
move all the code outside of xharness and used it outside. This is not a
fill refactor but a first step to decouple the bcl test generation from
the xamarin-macios project.

XHarness should not see a difference, everythign works and simply makes
the dlls larger due to the new resources.

The code is going to take into account that the mono team will want to
use and unmanaged template with no dependencies on Xamarin.iOS and
Xamarin.Mac.



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

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-12 13:45:47 -04:00
Rolf Bjarne Kvinge 0b0f6ab043
[xharness] Improve TCC database editing. (#8094)
* Delete any previous entries before adding new ones in all simulators.
* Separate statements by newlines, so logs are easier to parse by humans.
2020-03-12 15:19:32 +01:00
Rolf Bjarne Kvinge 8be4333f43
[xharness] Rework how we build test-libraries a bit. (#8095)
* It's built in parallel with populating the tests.
* A failure isn't silently ignored, it's now shown in the html report.
2020-03-12 15:18:05 +01:00
Rolf Bjarne Kvinge 800d63bb4d Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-12 10:37:12 +01:00
Rolf Bjarne Kvinge 5dda97a0ef [xharness] Unset a few environment variables when running .NET tests. 2020-03-12 10:36:59 +01:00
Manuel de la Pena 16a84bd7f7
[Harness] Move the project templates out of the harness dir. (#8088)
Move the project templates to be a resource in the dll. That way we can
move all the code outside of xharness and used it outside. This is not a
fill refactor but a first step to decouple the bcl test generation from
the xamarin-macios project.

XHarness should not see a difference, everythign works and simply makes
the dlls larger due to the new resources.

The code is going to take into account that the mono team will want to
use and unmanaged template with no dependencies on Xamarin.iOS and
Xamarin.Mac.
2020-03-11 20:10:07 -04:00
Manuel de la Pena ed77f3bfd1
[Harness] Add extra tests for the SimDevice and Simulator classes. (#8079)
Add tests for the SimDevice and Simulators classes that ensure that the
process is correctly called and the xml with the simulators parsed and
returns the correct number of sims.
2020-03-11 20:09:38 -04:00
Manuel de la Pena afb11d65cc
[Harness] Add more context to crashes and timeouts. (#8078)
Update the generation of the xml to include a more descriptive title
than "AppCrash". After this commit the name of the testcase and the test
follow this pattern:

- "App Crash {ApplicationName} {Variation}"

This will make it easier to filter since the an example failure will be:

"App Crash Monotouch (Debug)"

Note, the '()' in the example are part of the variation and that is
build by xharness and passed to the runner.

Fixes: https://github.com/xamarin/xamarin-macios/issues/8077
2020-03-11 17:09:21 -04:00
Manuel de la Pena 4b3d2d1cb4
[Harness] Refactor simulators and devices listing. (#8086)
Moved the implementations under Hardare. Add the following to simplify
the testing of the AppRunner:

1. Add interfaces for the listing/loading of devices and simulators.
2. Add a special class for mlaunch args. That way we are sure that
arguments are correctly passed and we do not have typos.
3. Added tests for the new classes and for the device and devices
classes.
4. Added tests for the management of the TCC db.

Tests for the SimDevice and Simulators will come in a following PR. The
only reason for it is that I realize that the commit was getting to
large.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-03-11 17:06:40 -04:00
Rolf Bjarne Kvinge 067c88e2f4 [xharness] Fix merge problem. 2020-03-11 12:36:09 +01:00
Rolf Bjarne Kvinge dac68f33b4 Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-11 12:01:31 +01: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
Manuel de la Pena e53b686ef6
[Harness] Refactor simulators and devices listing. (#8064)
Moved the implementations under Hardware. Add the following to simplify
the testing of the AppRunner:

1. Add interfaces for the listing/loading of devices and simulators.
2. Add a special class for mlaunch args. That way we are sure that
arguments are correctly passed and we do not have typos.
3. Added tests for the new classes and for the device and devices
classes.
4. Added tests for the management of the TCC db.

Tests for the SimDevice and Simulators will come in a following PR. The
only reason for it is that I realize that the commit was getting to
large.


Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-Authored-By: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-03-10 15:10:37 -04:00
Rolf Bjarne Kvinge 7108f59f8b Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-10 19:27:46 +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
Rolf Bjarne Kvinge 5c323cebb4 Merge remote-tracking branch 'origin/master' into dotnet-bgen 2020-03-10 13:50:11 +01:00
Rolf Bjarne Kvinge d7d9baef2d Use full path to the 'dotnet' executable.
This way we don't have to change PATH on bots. It always makes it easier to
use a different location for the executable in the future if we wished to.
2020-03-10 13:41:16 +01: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
Rolf Bjarne Kvinge 1fc2f8e3c2 [xharness] Add support for running the generator tests in .NET mode.
This also meant adding support for running .NET tests in xharness. Some
refactoring was done to extract common code to shared members, in order to
avoid duplicating a lot of code.
2020-03-09 19:49:26 +01:00
Rolf Bjarne Kvinge bcefeb37b6
[xharness] Handle UTF8 text better. (#8065)
* Set UTF8 as the encoding for process output.
* Serve plain text as UTF-8 plain text from our test server.

This makes emojiis render as emojiis 😁😁😁
2020-03-09 18:40:46 +01:00
Rolf Bjarne Kvinge bd29f99aaa
[xharness] Rename XBuildTask to MSBuildTask. (#8067)
We're not using xbuild anymore, and haven't for quite a while.
2020-03-09 16:44:49 +01:00
Manuel de la Pena 597b7d7b0b
[Harness] Refactor process management to be testable. (#8053)
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: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-03-06 09:11:33 -05:00
Přemek Vysoký 65a7168c66
[Harness] Split out classes from Jenkins.cs to separate files (#8046)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-06 06:00:34 -05:00
Manuel de la Pena cd35f26d6f
[Harness] Add listeners tests.
Provide tests that will ensure that the Tcp listener and File listener
will work correctly. Tests ensure that both listeners receive the data
and write it in the ILog

The tcp test is an interesting one because it redirects the call of the
method to a diff callback that will write the data in a stream to check
the final result.
2020-03-05 06:41:52 -05:00
Manuel de la Pena 0c085cd719
[XHarness] Add tests for all the logging classes. (#8032)
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.


Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2020-03-04 15:27:52 -05: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
Alex Soto 709a90599e Merge remote-tracking branch 'xamarin/xcode11.4' into d16-5-xcode11.4-merge 2020-03-03 10:57:24 -05:00
Manuel de la Pena 8664a96f72
[Harness] When on device, check if we got a tcp exception on a crash. (#8015)
Some crashes are reported as tcp connection issues because they happen
before the app had the chance to write anything in the log. In that
case, we checked for the presence of the file, and if not present we
decided it was a tcp issue when it is not the case.

In this commit, we check for the tcp erorr message in the main_log so
that we are certain that the issue was with the connection and not
anyother.

Testingis simple, ran tests without the phone being part of the same
network and test with a branch that has a crash. For example the one in
https://github.com/xamarin/xamarin-macios/pull/8009 hash 83240612e8
2020-02-29 08:45:48 -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
Manuel de la Pena b9a45930ab
[Harness] Remove dead code. (#7990)
We do not longer compile the bcl tests, but we consume them as part or
mono. The old BCL targets and classes are not needed. As you can see,
the lists were empty.
2020-02-26 21:21:09 -05:00
Manuel de la Pena 3710528e0d
[Harness] Add tests for the xml result parser. (#7988)
Add tests to make sure that we can be safe when we make changes to that
part of the code.

Some methods are not tested but due to dependencies. Will work un
separating things a little to keep moving fwd.
2020-02-26 19:50:37 -05:00
Manuel de la Pena 3d32ab52a7
[Harness] Move BCLTestImport sources to their rightful place. (#7985)
We initially added a cmd to do the bcl test import generation that has
never been used.

We are moving the bcl test importer code to xharness and creating a
NUnit test project to run the tests that we already added. Unit tests
pass.
2020-02-26 14:10:36 -05:00
Manuel de la Pena d1eec8b3d0
[Harness] Add extra labels to allow to select a smaller set of tests. (#7937)
It will be nice to be able to have a smaller set of tests to be ran by
xharness. In this commit we add a set of labels to be able to divide the
test in the following groups:

* Xamarin - all tests BUT monotouch.
* Monotouch - just monotouch tests.
* Old BCL - The BCL tests that are based on NUnit
* New BCL - The BCL tests that are based on xUnit.
* mscorlib - Just the test that exercise mscorlib (and the different
groups, mscorlib 1, mscorlib 2 etc..)

This will allow to parallelize the execution of the full test suit in
different agents in VSTS.
2020-02-25 22:47:05 -05:00
Manuel de la Pena f3b02e2575
[Harness] Fix false crash report. (#7979)
fixes: https://github.com/xamarin/xamarin-macios/issues/7978
2020-02-25 22:46:27 -05:00
Manuel de la Pena 09c4c80c21
[Harness] Add start-time to work around a bug in the publishing tool. (#7951)
The publishing tool is a little fragile. In run
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=3490479&view=logs&j=67d14776-f827-5fe4-2625-2db4b5987fd1&t=fa262eec-9d97-5ba4-b4cc-a9292beecd8f
I noticed that valid test runs with a failing test (launch issues) were
not being uploaded.

I found out that the reason is a flaw in the logic on the parser of the
publishing tool. The tool assumes, that if there is no start-time, there
are no test results (do remember that NUnitV3 is schemaless we don't
know exactly what attrs are compulsory).

The culprint is line: https://dev.azure.com/mseng/AzureDevOps/_git/AzureDevOps?path=%2FTa%2FTasks%2FPublishTestResults%2FParser%2FNUnitResultParser.cs&version=GBmaster&line=473&lineEnd=473&lineStartColumn=63&lineEndColumn=64&lineStyle=plain

Basically:

```csharp
 if (testRunNode?.Attributes?["start-time"] != null) {
   // import test data
 }

 // do nothing interesting since there is no data
```

This commit fixes it by setting the start time as the current one, we
dont care since it is a failure xml result.
2020-02-21 14:00:14 -05:00
Manuel de la Pena 8554b84b67
[Harness] Do not add the variation two times to failure messages. (#7950)
AppName should only be the app name since we are passing the varation as
a parameter too. Else we end up with $"{appname} {variation} {variation}".
2020-02-21 10:24:21 -05:00
Manuel de la Pena ca26ef62d5
[Harness] Close message element correctly in NUnit3. (#7946)
Xml should be:
```
<failure>
  <message>Foo</message>
  <stack-trace>Bar</stack-trace>
</failure>
```

But we generate:

```
<failure>
  <message>Foo
    <stack-trace>Bar</stack-trace>
  </message>
</failure>
```

Makes the parsing of the failures impossible.
2020-02-20 11:15:57 -05:00
Manuel de la Pena 5b0361d911
[Harness] Provide device name in those errors where is device specific. (#7947)
In order to simplify the monitoring job add the device name to the
following failures:

* Installation
* Launch
* Tcp Connection

All the above are most of the time due to a misconfigured device. The
device name is useful information for the monitoring person to be able
to reach IT and address the issue.
2020-02-20 11:15:40 -05:00
Manuel de la Pena 44bd2c8589
[Harness] Fix merge mistake. (#7940) 2020-02-19 18:39:05 -05:00
Manuel de la Pena 271a7c5e6c
[Harness] Ensure that the crashed var is out and is propagated to the rest of the code. (#7938)
The parsing code set the crashed variable, but it was not set as an
output variable, that meant that the value was not used. Further in the
code we use the variable to decide if we had a crash or not. Most of the
time, there is no probel since if we have a real crash, we will get the
crash reports and to the right thing, but in the case of tcp connection
issues we do not have them, and therefore the crash xml result is not
created.

Bonus: the local logs variable was hidding a variable in another scope,
fixed that.
2020-02-19 13:18:34 -05:00
Manuel de la Pena 35c04caa1b
[Harness] If there is not BuildTask, do not add logs. (#7936)
xharness does not only allow to run tests in CI, but also helps to run
specific project. That feature is used for the mtouch tests. In that
scenario, we do not have a build task and therefore we will not have the
build logs.

fixes: https://github.com/xamarin/maccore/issues/2154
2020-02-19 11:25:44 -05:00
Manuel de la Pena af784d6613
[Harness] Create xml unit test failure when an application timesout. (#7929)
If we are in VSTS and we want to have correct reportings we need to
generate a test failure when the applicaiton times out. If not, we have
a missmatch between the results from xharness (we have failures) and
VSTS (success).
2020-02-18 10:28:06 -05:00
Manuel de la Pena f9c502579b
[Harness] Create a xml crash file when we do not have a result file. (#7928)
On devices that cannot reach the host via TCP we do not have a log, this
means that in the if statement needs to have a case for it.

The main problem is that when the device cannot connect to the host, we
do not get a log OR a crash reason from the crash logs. It makes sense
not to have a crash reason, because the app did not crash. In these
sitations, we have to create a xml crash report (since we really do not
know if we can parse the file) that will tell vsts that there was an
issue. Adding the main log will let the monitoring person see the
results of the test run.
2020-02-18 09:16:10 -05:00
Manuel de la Pena 8f58afe857
[Harness] Add a prefix to the final xml to be imported. (#7914)
Because the PublishTest task is taking a regular expression, it is
importing the test results more than one, which gives wrong stats. Add a
prefix to better filter those files we are interested in (thos with
attachments).

As a bonus, refactored the xml failure code for less copy pasting and to
have a single place where we had to add the prefix.
2020-02-17 12:27:22 -05:00
Manuel de la Pena 5475256f51
[XHarness] Close left open html tags. (#7915) 2020-02-17 12:18:31 -05:00
Manuel de la Pena 00c3867ca9
[Xhanress] If we fail to install the application, report it as an test failure. (#7902)
VSTS does not provide a good way to report an app installation issue,
but we can fake a failure in the test when the installation does not
happen.

In the case of the installation failure a xml test result is generated
that will expose all the required information and will attach all the
needed logs (install logs). An example of the generated result can be
seen here: https://gist.github.com/mandel-macaque/2274bcd8785eebd636b98142e228afa9
2020-02-14 17:28:00 -05:00
Manuel de la Pena d2eb074bb4
[XHarness] If there is a build error, report it as a test failure. (#7903)
If there is a build error generate a xml that will be imported by VSTS
and will be reported as a test failure.

Examnple of the error: https://gist.github.com/mandel-macaque/dab2a5a4f3d21a81c172a8c8450d2448
2020-02-14 17:27:35 -05:00
Manuel de la Pena 6fde517698
[Harness] If app does not launch or crash, create a test failure. (#7906)
Make sure that when we are running on VSTS we do get test failures when
the application cannot be launched or crashes.
2020-02-14 17:27:01 -05:00
Manuel de la Pena f41a64fd29
[Harness] Attach build logs to NUnit V3 xml results. (#7855)
Get the previous task ID and use it to build the log directory of the
builds, then add all the combined files as attachments.

Fixes: https://github.com/xamarin/xamarin-macios/issues/7854
2020-02-13 16:51:14 -05:00
monojenkins 86000d0c3b
[XHarness] Generate TestReorts for NUnit V3. (#7881)
Now that we have NUnit V3 xml results, do generate the test report for
those correctly.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-02-13 11:59:15 -05:00
Manuel de la Pena 2cfc456787
[Harness] Add code that will generate custom xml results with failures. (#7874)
There are two cases that are not currently considered in VSTS that we
need to report:

1. The application could not be built.
2. The application crashed.

In those cases we do not have xml to be imported by VSTS. What we are
going to do is create 'fake' test runs that will encapsulate a build
error or a crash to be imported by VSTS with the needed attachments.

This code just writes custom errors. The generated results are like the
following:

* [NUnit V2](ihttps://gist.github.com/mandel-macaque/7207f6acb5a90895adf84f40a05e0b21)
* [NUnit V3](https://gist.github.com/mandel-macaque/99898c0570cde2e54e38d8af5991f824)
* [xUnit](https://gist.github.com/mandel-macaque/4591cc06d3db0e46de6a0bf886804f13)
2020-02-12 22:06:24 -05:00
Manuel de la Pena 9303bb2dc5
[Xcode11.4][XHarness] Add logs to VSTS test runs. (#7844) (#7866)
As per the documentation of the VSTS test uploader (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml#attachments-support)
the tests support the addition of attachments. We want to be able to
access the logs of the different tests runs, this is achieved the
following way:

1. Move TouchUnit to use NUnit V3 which allows to add attachments.
2. Once the tests are ran, add the attachments to the following nodes:
   1. The very first test-suite. This will allow to have the logs for
   succesul tests.
   2. Add logs to failing tests. Reduces the number of clicks to be done
   to access to the logs when a test case fails.
3. Modify the assembly name of the test-suit to match the name of the
application. This ensures two things.
   1. We have a consistent name for the file column in VSTS, that can be
   used to see recurrent failing tests.
   2. The name is more readable, since if not, it will contain the UUID
   of the device.

Logs are not added to succesful tests because it will have the following
problems:

* Larger data storage usage.
* Longer upload time. The addtion of the logs per tests (succesful or
failed) was tested and resulted in an upload time LONGER than 6 hours
for all TouchUnit, NUnit blc tests and xUnit bcl tests.

In order for this to be useful, the task in the pipeline SHOULD NOT
merge test runs. We should have a test run PER application so that we do
not mix the logs.

Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-02-12 18:16:30 -05:00
Manuel de la Pena 35c010db63
[XHarness] USe static variables for common test names. (#7837) (#7853)
One of the reason why we lost the TestReport was because the xml added
from the new code did not use the same name for the log as the expected
one (https://github.com/xamarin/xamarin-macios/pull/7835/files#diff-03773861bcef485bf343300f31b60b0eR374).

If we are going to be using the description as a way to decide what is
going to be done with it, lets use static vars so that we do not have
logs added with the wrong name.
2020-02-12 07:36:43 -05:00
Manuel de la Pena 1a0b2bbcc0
[XHarness] Generate TestReorts for NUnit V3. (#7851)
Now that we have NUnit V3 xml results, do generate the test report for
those correctly.
2020-02-11 20:28:28 -05:00
monojenkins 0c89f403a4
[xcode11.4] [XHarness] Do write the TestReport when we have xUnit results. (#7849)
Add code to write the TestReport when we have xunit results. Also
refactored code for the NUnit format to not use LINQ, it will use less
memory and in the future we can move to async (not now since it might
raise other problems).

fixes: https://github.com/xamarin/xamarin-macios/issues/7826

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-02-11 18:43:39 -05:00
Manuel de la Pena be9a8b1e81
[XHarness] Add logs to VSTS test runs. (#7844)
As per the documentation of the VSTS test uploader (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml#attachments-support)
the tests support the addition of attachments. We want to be able to
access the logs of the different tests runs, this is achieved the
following way:

1. Move TouchUnit to use NUnit V3 which allows to add attachments.
2. Once the tests are ran, add the attachments to the following nodes:
   1. The very first test-suite. This will allow to have the logs for
   succesul tests.
   2. Add logs to failing tests. Reduces the number of clicks to be done
   to access to the logs when a test case fails.
3. Modify the assembly name of the test-suit to match the name of the
application. This ensures two things.
   1. We have a consistent name for the file column in VSTS, that can be
   used to see recurrent failing tests.
   2. The name is more readable, since if not, it will contain the UUID
   of the device.

Logs are not added to succesful tests because it will have the following
problems:

* Larger data storage usage.
* Longer upload time. The addtion of the logs per tests (succesful or
failed) was tested and resulted in an upload time LONGER than 6 hours
for all TouchUnit, NUnit blc tests and xUnit bcl tests.

In order for this to be useful, the task in the pipeline SHOULD NOT
merge test runs. We should have a test run PER application so that we do
not mix the logs.


Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-02-11 14:03:16 -05:00
Manuel de la Pena bd171282cf
[XHarness] USe static variables for common test names. (#7837)
One of the reason why we lost the TestReport was because the xml added
from the new code did not use the same name for the log as the expected
one (https://github.com/xamarin/xamarin-macios/pull/7835/files#diff-03773861bcef485bf343300f31b60b0eR374).

If we are going to be using the description as a way to decide what is
going to be done with it, lets use static vars so that we do not have
logs added with the wrong name.
2020-02-11 06:42:21 -05:00
Manuel de la Pena 072c262b9b
[XHarness] Do write the TestReport when we have xUnit results. (#7835)
Add code to write the TestReport when we have xunit results. Also
refactored code for the NUnit format to not use LINQ, it will use less
memory and in the future we can move to async (not now since it might
raise other problems).

fixes: https://github.com/xamarin/xamarin-macios/issues/7826
2020-02-10 21:44:33 -05:00
Sebastien Pouliot 7cbf90c5c6
[tests] Add cecil-based unit tests (#7825)
Only one to start... it's been discussed before but we generally
found other ways to do them. Let's continue to pick the best place
but we now have more options :)
2020-02-10 17:23:12 -05:00
Manuel de la Pena 359bbbb50b [XHarness] Refactor xml code to make the AppRunner class cleaner. (#7794)
There is a lot of logic related to xml in the AppRunner making it more
complicated than needed. Move the methods to a hlper class.
2020-02-10 10:58:50 -05:00
Manuel de la Pena 101c944bfc [Xharness] Fix all xml parsing issues and ensure that the xml can be consumed by VSTS. (#7768)
We ping the tcp listener to know that we have a tcp connection, that is
written in the xml logs, which means that parsing will not work. Ignore
the ping, parse xml, and make sure that the xml that will be consume by
vsts is valid.

This PR also fixes https://github.com/xamarin/maccore/issues/827 which does not longer happen.
2020-02-10 10:58:36 -05:00
Manuel de la Pena 9e45badf78 [Xharness] Add workaround when we could not share the internet in bots. (#7755)
Looks like we have issues with the internet sharing in the VSTS bots,
this means that now that we always try to parse the XML on CI, we get an
exception, catch it and do not show the results.

The workaround simply tries to read the xml, if possible, we will parse
it, else deal with the text only log. The fix will show the results, but
it is a workaround for a configuration issue in the CI.
2020-02-10 10:58:25 -05:00
Manuel de la Pena abf9dfc997 [Harness] Unify the CI properties. (#7750)
Unify the harness properties to just look at InCI and remove all the
other ones. There is no real need to have differences between jenkins
and VSTS and Wrench is gone.
2020-02-10 10:58:13 -05:00
Manuel de la Pena 2fb329bc96 [XHarness] If in CI, no matter which, use the Xml output. (#7745)
We used to test only on Jenkins, and if the build version had jenkins on
it, rather than doing so, just check if we are in the CI by looking if
BUILD_REVISION is present in the env.
2020-02-10 10:58:00 -05:00
monojenkins 6f712aeaef
[Harness] Just try to generate the report when is NUnit. (#7828)
Use the xml parsing helper methods to decide if the xml can be parsed
and if we will be able to generate the report. That way we avoid an
exception that makes the CI noise.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2020-02-10 10:40:59 -05:00
Manuel de la Pena 829af5eec3 [Harness] Just try to generate the report when is NUnit.
Use the xml parsing helper methods to decide if the xml can be parsed
and if we will be able to generate the report. That way we avoid an
exception that makes the CI noise.
2020-02-08 02:19:40 +00:00
Manuel de la Pena c169895499 [Harness] Just try to generate the report when is NUnit.
Use the xml parsing helper methods to decide if the xml can be parsed
and if we will be able to generate the report. That way we avoid an
exception that makes the CI noise.
2020-02-07 17:00:26 -05:00
Manuel de la Pena 1f80ebe15e [XHarness] Refactor xml code to make the AppRunner class cleaner. (#7794)
There is a lot of logic related to xml in the AppRunner making it more
complicated than needed. Move the methods to a hlper class.
2020-02-06 08:54:26 -05:00
Manuel de la Pena 8acfe3859e [Xharness] Fix all xml parsing issues and ensure that the xml can be consumed by VSTS. (#7768)
We ping the tcp listener to know that we have a tcp connection, that is
written in the xml logs, which means that parsing will not work. Ignore
the ping, parse xml, and make sure that the xml that will be consume by
vsts is valid.

This PR also fixes https://github.com/xamarin/maccore/issues/827 which does not longer happen.
2020-02-06 08:54:00 -05:00
Manuel de la Pena d9bbdcf065 [Xharness] Add workaround when we could not share the internet in bots. (#7755)
Looks like we have issues with the internet sharing in the VSTS bots,
this means that now that we always try to parse the XML on CI, we get an
exception, catch it and do not show the results.

The workaround simply tries to read the xml, if possible, we will parse
it, else deal with the text only log. The fix will show the results, but
it is a workaround for a configuration issue in the CI.
2020-02-06 08:53:34 -05:00
Manuel de la Pena fc0dd8812b [Harness] Unify the CI properties. (#7750)
Unify the harness properties to just look at InCI and remove all the
other ones. There is no real need to have differences between jenkins
and VSTS and Wrench is gone.
2020-02-06 08:53:13 -05:00
Manuel de la Pena 2aad661b4c [XHarness] If in CI, no matter which, use the Xml output. (#7745)
We used to test only on Jenkins, and if the build version had jenkins on
it, rather than doing so, just check if we are in the CI by looking if
BUILD_REVISION is present in the env.
2020-02-06 08:52:57 -05:00
Manuel de la Pena fe2b014d6a
[XHarness] Refactor xml code to make the AppRunner class cleaner. (#7794)
There is a lot of logic related to xml in the AppRunner making it more
complicated than needed. Move the methods to a hlper class.
2020-02-05 21:23:44 -05:00
Manuel de la Pena 0144c3b94f
[Xharness] Fix all xml parsing issues and ensure that the xml can be consumed by VSTS. (#7768)
We ping the tcp listener to know that we have a tcp connection, that is
written in the xml logs, which means that parsing will not work. Ignore
the ping, parse xml, and make sure that the xml that will be consume by
vsts is valid.

This PR also fixes https://github.com/xamarin/maccore/issues/827 which does not longer happen.
2020-02-04 11:03:38 -05:00
Rolf Bjarne Kvinge 65b872e7e9
[xharness] Improve TCC database editing. (#7773)
* Acquire permission for the microphone (the microphone permission dialog is
  not a blocking dialog, which is why things have worked so far).

* Set the last_modified field in the TCC database to now instead of 1970.
  Apparently some permissions time out (kTCCServiceMediaLibrary), which means
  that the last_modified field is important to get right.
2020-01-30 17:54:07 +01:00
Rolf Bjarne Kvinge 47ebd0d947
[xharness] Fix simctl arguments. (#7772)
* [xharness] Fix simctl arguments.

* Fix another case.
2020-01-30 12:07:02 +01:00
Manuel de la Pena 7130b16d98
[Xharness] Add workaround when we could not share the internet in bots. (#7755)
Looks like we have issues with the internet sharing in the VSTS bots,
this means that now that we always try to parse the XML on CI, we get an
exception, catch it and do not show the results.

The workaround simply tries to read the xml, if possible, we will parse
it, else deal with the text only log. The fix will show the results, but
it is a workaround for a configuration issue in the CI.
2020-01-28 14:44:34 -05:00
Manuel de la Pena afaaf10d77
[Harness] Unify the CI properties. (#7750)
Unify the harness properties to just look at InCI and remove all the
other ones. There is no real need to have differences between jenkins
and VSTS and Wrench is gone.
2020-01-24 07:47:44 -05:00
Manuel de la Pena 088dd2a9b2
[XHarness] If in CI, no matter which, use the Xml output. (#7745)
We used to test only on Jenkins, and if the build version had jenkins on
it, rather than doing so, just check if we are in the CI by looking if
BUILD_REVISION is present in the env.
2020-01-23 18:28:12 -05:00
Rolf Bjarne Kvinge 54b07b2f2d
[msbuild] Build the MSBuild task assemblies for netstandard2.0. (#7706)
* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@210c664 Adds net451 to Xamarin.MacDev.csproj
* xamarin/Xamarin.MacDev@64db365 [winios] Changes provisioning profiles default path
* xamarin/Xamarin.MacDev@d34430a Switch to short-form projects and build for both net461 and netstandard2.0. (#68)

Diff: 0f578f51e6..210c664e56

* [msbuild] Update to latest Mono.Cecil.

The older version doesn't support netstandard2.0.

No code changes were required.

* [msbuild] Remove unused usings.

* [msbuild] Make ILMerge work when building for netstandard2.0.

Also unify/deduplicate the ILMerge logic between Xamarin.iOS and Xamarin.Mac.

* [msbuild] Build for netstandard2.0 in addition to net461.

* [msbuild] Use custom project configurations to support running the tests for both netstandard2.0 and net461.

Use custom project configurations to support running the tests for when the
tasks assembly is built for netstandard2.0 and net461.

* [tests] Make command-line based 'make test-ios-tasks' run tests for both netstandard2.0 and net461.

* [xharness] Add test configuration to run iOS MSBuild tests using either netstandard2.0 or net461.

* [msbuild] Make the netstandard2.0-buils task assemblies the default.

* [msbuild] ILRepack lib assemblies, not ref assemblies.

Ask MSBuild to copy lib assemblies to the output folder when building for
netstandard2.0, this way we can easily find the actual implementation
libraries to pass to ILRepack.

* [msbuild] Merge System.Text.Encodings.Web.dll as well.

* [xharness] Fix build of MSBuild tests for iOS.
2020-01-16 18:22:48 +01:00
Rolf Bjarne Kvinge 34c0a9e106
[xharness] Fix two compiler warnings. (#7703)
* [xharness] Fix two compiler warnings.

Fixes these warnings:

    Jenkins.cs(538,37): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
    Jenkins.cs(877,14): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

* [xharness] Simplify async code a bit.
2020-01-14 08:17:58 +01:00
Rolf Bjarne Kvinge c4e15ed6b6
[msbuild] Convert project files to sdk-style project files. (#7698)
* [msbuild] Convert to short-form csproj.

* [msbuild] Make asserts more useful.

* [msbuild] Make tests ignore the actual location of the test assembly.

* [msbuild] Short-style projects default to deterministic builds, which is not compatible with wildcard versions.

* [msbuild] Adjust test.

* Update .gitignore.

* Bump NUnit.ConsoleRunner version.

* [msbuild] Fix indentation.

* [msbuild] Simplify csproj.
2020-01-14 08:16:02 +01:00
Pramit Mallick cd9a151c98 [xharness] Run duration (#7661)
Update the label used in xharness to be more clear about the run duration.
2020-01-07 13:38:27 -05:00
monojenkins 2139efecb5 [xharness] Only run 'dont link' on release configuration (#7672)
The 32bits **debug** binaries are now too big for Apple's native linker
to process, which gives us (non useful) build errors on the bots.

This will still run the release builds configuration of the tests since
they are smaller and still within the limits of the tooling.

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@gmail.com>
2020-01-06 16:53:01 -05:00
Sebastien Pouliot fc9b3fa8ae [xharness] Only run 'dont link' on release configuration (#7662)
The 32bits **debug** binaries are now too big for Apple's native linker
to process, which gives us (non useful) build errors on the bots.

This will still run the release builds configuration of the tests since
they are smaller and still within the limits of the tooling.
2020-01-02 15:06:54 -05:00
monojenkins 49d853a23d [d16-5] [Test] Bump mono and use the new splited tests. (#7648)
Bump mono to get the new splited test dlls and add them to be ran in
xharness. Special logic is used for mscorlib so we make sure that all
the 'parts' of the test dll do have the same configurations.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com>
2019-12-23 23:57:19 -05:00
Manuel de la Pena 4c6181e904
[Test] Bump mono and use the new splited tests. (#7626)
Bump mono to get the new splited test dlls and add them to be ran in
xharness. Special logic is used for mscorlib so we make sure that all
the 'parts' of the test dll do have the same configurations.


Co-Authored-By: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com>
2019-12-23 18:39:41 -05:00
monojenkins 441912e20d [xharness] Fix 32 bit device tests selection (#7639)
**Problem**

32 bit tests could only be executed with 64 bit tests. E.g: `run-ios-32-tests` didn't work on its own, only `run-ios-tests,run-ios-32-tests` worked

**Solution**

- Change the logic so that 32 bit tests are only looking for `IncludeiOS32` and 64 bit tests only `IncludeiOS64`
- To keep `run-ios-tests` and `skip-ios-tests` working, hack `SetEnabled` so `IncludeiOS` also sets `IncludeiOS32` and `IncludeiOS64`.
  Otherwise the way the code is currently organised we'd have to use `skip-ios-32-tests` and `skip-ios-64-tests`.

Co-authored-by: Vincent Dondain <vidondai@microsoft.com>
2019-12-23 13:07:43 -05:00
Alex Soto 3d927e0466
[xharness] Fix ExecuteCommandAsync args parameter 2019-12-18 12:22:00 -05:00
Alex Soto d527862915
[xharness] Fix ExecuteCommandAsync args parameter 2019-12-18 12:19:22 -05:00
Alex Soto f1f867af03
Merge branch 'd16-5' into d16-5-xcode11.3 2019-12-18 12:01:21 -05:00
monojenkins 8e363024b7 [d16-5] [Tests] Split groups so that they work on iOS 32b. (#7616)
After this commit we will have more application but they will be the
appropiate size so that they can be built with the linker for iOS 32b.
It is important to note that the following apps WILL CONTINUE to fail
since the dlls need to be splitted in mono:

* mscorlib tests
* Mono BCL tests group 5 - Which is monotouch_System.Core_xunit-test.dll
and is too large.
2019-12-18 11:16:49 -05:00
monojenkins 7a22053587 [xcode11.3] [Tests] Split groups so that they work on iOS 32b. (#7617)
After this commit we will have more application but they will be the
appropiate size so that they can be built with the linker for iOS 32b.
It is important to note that the following apps WILL CONTINUE to fail
since the dlls need to be splitted in mono:

* mscorlib tests
* Mono BCL tests group 5 - Which is monotouch_System.Core_xunit-test.dll
and is too large.
2019-12-18 11:16:29 -05:00
Alex Soto 9ac17bdbcf
Merge remote-tracking branch 'xamarin/xcode11.3' into master-xcode11.3 2019-12-17 19:25:11 -05:00
Alex Soto 01c1d04877
Merge remote-tracking branch 'xamarin/xcode11.3' into d16-5 2019-12-17 18:56:12 -05:00
Manuel de la Pena 867dcfaa77
[Tests] Split groups so that they work on iOS 32b. (#7612)
After this commit we will have more application but they will be the
appropiate size so that they can be built with the linker for iOS 32b.
It is important to note that the following apps WILL CONTINUE to fail
since the dlls need to be splitted in mono:

* mscorlib tests
* Mono BCL tests group 5 - Which is monotouch_System.Core_xunit-test.dll
and is too large.
2019-12-17 17:09:28 -05:00
monojenkins aaafa2df6f [xharness] Don't try to parse log files that don't exist. (#7614)
Makes xharness throw fewer exceptions, which makes tracing output simpler to read.
2019-12-17 17:04:00 -05:00
Rolf Bjarne Kvinge c422869c4b
[msbuild] Update tests to NUnit 3.12. (#7597)
Updating the msbuild tasks to use netstandard2.0 requires us to bump NUnit to 3+.

This requires:

* A few code changes due to breaking API changes in NUnit.
* Changes in xharness and a makefile to cope with the new location for the
  NUnit console runner (I added a helper script to make things slightly
  easier).
2019-12-16 23:55:59 +01:00
Rolf Bjarne Kvinge 9b30d7016a
[xharness] Don't try to parse log files that don't exist. (#7583)
Makes xharness throw fewer exceptions, which makes tracing output simpler to read.
2019-12-12 19:13:19 +01:00
Vincent Dondain 612a5aa158
[xharness] Fix 32 bit device tests selection (#7540)
**Problem**

32 bit tests could only be executed with 64 bit tests. E.g: `run-ios-32-tests` didn't work on its own, only `run-ios-tests,run-ios-32-tests` worked

**Solution**

- Change the logic so that 32 bit tests are only looking for `IncludeiOS32` and 64 bit tests only `IncludeiOS64`
- To keep `run-ios-tests` and `skip-ios-tests` working, hack `SetEnabled` so `IncludeiOS` also sets `IncludeiOS32` and `IncludeiOS64`.
  Otherwise the way the code is currently organised we'd have to use `skip-ios-32-tests` and `skip-ios-64-tests`.
2019-12-04 11:35:09 -05:00
monojenkins 5c5112e7d4 [xharness] Make sure to always stop log and system capture. (#7503)
This will hopefully stop the runaway mlaunch processes we've seen on the bots.

Ref: https://github.com/xamarin/maccore/issues/1965.
2019-12-03 17:04:58 +01:00
Rolf Bjarne Kvinge e808ad48aa
[xharness] Make sure to always stop log and system capture. (#7506)
This will hopefully stop the runaway mlaunch processes we've seen on the bots.

Ref: https://github.com/xamarin/maccore/issues/1965.
2019-12-02 21:54:07 +01:00
monojenkins 44d411b8de [xharness] Add a timeout to the periodic command. (#7504)
This will hopefully prevent the periodic command from keeping xharness alive longer than it should.
2019-12-02 21:48:22 +01:00
monojenkins c7348f408f [xharness] Add a timeout to the periodic command. (#7505)
This will hopefully prevent the periodic command from keeping xharness alive longer than it should.
2019-12-02 18:39:05 +01:00
Rolf Bjarne Kvinge 0f8bb77320
[xharness] Make sure to always stop log and system capture. (#7499)
This will hopefully stop the runaway mlaunch processes we've seen on the bots.

Ref: https://github.com/xamarin/maccore/issues/1965.
2019-11-27 11:44:26 -05:00
Rolf Bjarne Kvinge e86a76e6c7
[xharness] Add a timeout to the periodic command. (#7500)
This will hopefully prevent the periodic command from keeping xharness alive longer than it should.
2019-11-27 09:09:44 -05:00
Rolf Bjarne Kvinge 806404fa51
Keep track of SDK versions and OS versions separately. Fixes xamarin/maccore#2066. (#7454)
The latest SDK version and the latest OS version does not necessarily have to
match (for instance the iOS 13.2 SDK can support both iOS 13.2 and iOS 13.3),
so keep track of them separately.

Also use the latest OS version to determine which simulator to run, instead of
the latest SDK version (Xcode 11.3 ships with the iOS 13.2 SDK but only has an
iOS 13.3 simulator, not an iOS 13.2 simulator).

Fixes https://github.com/xamarin/maccore/issues/2066.
2019-11-15 17:21:10 +01:00
Vincent Dondain 44fd06324a Merge master into d16-5 2019-11-08 10:21:12 -05:00
Vincent Dondain a558d84457 Merge branch 'xcode11.2' into master-merge-xcode11.2 2019-11-05 15:25:49 -05:00
Vincent Dondain ec3c01d131 Merge branch 'xcode11.2' into d16-4-xcode11.2-merge 2019-11-01 17:11:44 -04:00
Rolf Bjarne Kvinge 34f02ff0a0
Bump mono to a hash with archives and use them. (#7299)
* Bump mono to a hash with archives and use them.

New commits in mono/mono:

* mono/mono@6af4ae7635 [2019-06][ci] Add Xcode 11.2beta2 for XI/XM Mono SDK builds

Diff: 476d72b9e3..6af4ae7635

* Bump mono to get min iOS version fix.

New commits in mono/mono:

* mono/mono@3775d5ac0a [sdks] Bump min iOS version to 7.0.

Diff: 6af4ae7635..3775d5ac0a

* [xharness] Bump mtouch tests timeout to 3h, we have a couple of new PR bots which are old and slow.

The new PR bots are late 2012 mac minis, so quite slow.
2019-10-25 22:13:20 +02:00
Rolf Bjarne Kvinge 7df9ddd973
[xharness] Fix a process argument typo. (#7284) 2019-10-23 19:05:54 +02:00
Rolf Bjarne Kvinge cd2e86e86d
[xharness] Fix typo when launching mlaunch to get crash reports. (#7234) 2019-10-15 21:59:35 +02:00
Rolf Bjarne Kvinge a8fdf6db6e
Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process. (#7177)
* Implement a different escaping/quoting algorithm for arguments to System.Diagnostics.Process.

mono changed how quotes should be escaped when passed to
System.Diagnostic.Process, so we need to change accordingly.

The main difference is that single quotes don't have to be escaped anymore.

This solves problems like this:

    System.ComponentModel.Win32Exception : ApplicationName='nuget', CommandLine='restore '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable/CellCustomTable.sln' -Verbosity detailed -SolutionDir '/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories/ios-samples/WorkingWithTables/Part 3 - Customizing a Table\'s appearance/3 - CellCustomTable'', CurrentDirectory='/Users/vsts/agent/2.158.0/work/1/s/tests/sampletester/bin/Debug/repositories', Native error= Cannot find the specified file
      at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x0029f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2019-08/external/bockbuild/builds/mono-x64/mcs/class/System/System.Diagnostics/Process.cs:778

ref: https://github.com/mono/mono/pull/15047

* Rework process arguments to pass arrays/lists around instead of quoted strings.

And then only convert to a string at the very end when we create the Process
instance.

In the future there will be a ProcessStartInfo.ArgumentList property we can
use to give the original array/list of arguments directly to the BCL so that
we can avoid quoting at all. These changes gets us almost all the way there
already (except that the ArgumentList property isn't available quite yet).

We also have to bump to target framework version v4.7.2 from v4.5 in several
places because of 'Array.Empty<T> ()' which is now used in more places.

* Parse linker flags from LinkWith attributes.

* [sampletester] Bump to v4.7.2 for Array.Empty<T> ().

* Fix typo.

* Rename GetVerbosity -> AddVerbosity.

* Remove unnecessary string interpolation.

* Remove unused variable.

* [mtouch] Simplify code a bit.

* Use implicitly typed arrays.
2019-10-14 16:18:46 +02:00
Rolf Bjarne Kvinge 8128976084
[runtime] Split the build differently: build libraries for simulator and device separately. (#7143)
This has a couple of advantages:

* It makes it easier to add a catalyst version of these libraries (because it
  becomes cumbersome to build for catalyst when the build rules assumes we're
  building for both simulator and device).
* It makes it easier to create an xcframework of our libraries, because the
  contents in an xcframework is split like this.
2019-10-03 16:38:44 +02:00
Vincent Dondain a7e50fd89d
[xharness] Bring more joy to the developer when all tests pass 🎉 (#6962) (#7037)
- When everything just works, skip the "test results" header and output that all tests pass with a 🎉 (:
2019-09-20 14:11:03 -04:00
monojenkins 982346cbb3 [xharness] Fix incorrect merge. (#7034)
Add new device tasks to the right list so that they're processed and marked as
ignored correctly later.
2019-09-19 18:53:26 +02:00
Rolf Bjarne Kvinge 7fc8db2fca
[xharness] Fix incorrect merge. (#7032)
Add new device tasks to the right list so that they're processed and marked as
ignored correctly later.
2019-09-19 14:40:32 +02: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 f6e0531197 Merge xcode11 into d16-3. 2019-09-12 08:29:02 +02:00
Vincent Dondain 483285adc6
[xharness] Bring more joy to the developer when all tests pass 🎉 (#6962)
- When everything just works, skip the "test results" header and output that all tests pass with a 🎉 (:
2019-09-11 08:15:06 -04:00
Rolf Bjarne Kvinge 7b1dada456 [xharness] Run the mtouch tests when anything in runtime/ changes. (#6594)
This would have caught/avoided #6593.
2019-07-17 21:33:07 +02:00
Rolf Bjarne Kvinge 121f04ce3d
[tests] Improve handling of permission dialogs. Fixes xamarin/maccore#1856. (#6544)
* macOS 10.15 starts putting up permission dialogs we can't automatically
  dismiss anymore, so start honoring the 'IncludeSystemPermissionTests' option
  for macOS tests.
* Improve the 'IncludeSystemPermissionTests' option to have three states: if
  set (either true or false), that takes precedence, but if not set, we now
  don't run any tests that require permission dialogs on macOS or on device if
  we're running in CI. Tests executed locally will still put up dialogs, both
  on macOS and on device.
* This needed a few changes to the html report, since the
  'IncludeSystemPermissionTests' is exposed in the UI and the code didn't
  handle the three different states.
* Update a few tests to check for permission to the contacts.

Fixes https://github.com/xamarin/maccore/issues/1856.
2019-07-12 07:05:57 -07:00
monojenkins a3f27ccbc1 [xharness] Propagate the BUILD_REVISION variable to test apps to specify if we're in CI or not. Fixes xamarin/maccore#649. (#6469)
We have tests whose behavior changes when executed on CI, and those tests use
the BUILD_REVISION variable to detect where they're being executed. For this
to work we need to propagate the BUILD_REVISION variable to the test
executable.

Hopefully fixes https://github.com/xamarin/maccore/issues/649 now.
2019-07-02 09:53:09 +02:00
monojenkins f2e4657f84 [xharness] Don't try to find simulators for ignored tests. (#6468)
Trying to find a simulator will mark the test as a failure if the simulator
couldn't be found, and we don't want that to happen to ignored tests.

This should fix an issue where xharness seems to try to run the 32-bit
simulator tests when asked to run only device tests.
2019-07-01 19:28:08 +02:00
Rolf Bjarne Kvinge 1d13468f21
[xharness] Propagate the BUILD_REVISION variable to test apps to specify if we're in CI or not. Fixes xamarin/maccore#649. (#6467)
We have tests whose behavior changes when executed on CI, and those tests use
the BUILD_REVISION variable to detect where they're being executed. For this
to work we need to propagate the BUILD_REVISION variable to the test
executable.

Hopefully fixes https://github.com/xamarin/maccore/issues/649 now.
2019-07-01 19:02:56 +02:00
Rolf Bjarne Kvinge 22699633ae
[xharness] Don't fail to write report if failing to list referenced assemblies. Fixes xamarin/maccore#1821. (#6448)
Fixes https://github.com/xamarin/maccore/issues/1821.
2019-06-28 07:31:02 +02:00
Rolf Bjarne Kvinge f9b4639631
[xharness] Fix Makefile-mac.inc generation after recent disruptive changes. (#6401)
This boils down to the makefile-generation code having the information it
needs (and that information being correct).

This fixes running of tests on other macOS bots (older/newer), because now we
can build the test package again.
2019-06-24 16:08:13 +02:00
Rolf Bjarne Kvinge 84db931287
[xharness] Serialize access to nuget. Fixes xamarin/maccore#1779. (#6402)
Nuget might freak out if multiple nuget processes run at the same time, so
make sure that doesn't happen.

Fixes https://github.com/xamarin/maccore/issues/1779.
2019-06-24 08:37:36 +02:00
Rolf Bjarne Kvinge 2e0a3f34ec
[xharness] Fix compiler warning about override having different parameter names than the base implementation. (#6400) 2019-06-24 08:35:50 +02:00
Rolf Bjarne Kvinge e9ce1e222a
Merge pull request #6381 from rolfbjarne/xcode11-bump-mono-d16-2
[xcode11] Merge d16-2. Fixes #6325.
2019-06-20 19:08:10 +02:00
Rolf Bjarne Kvinge 4c990affe7 [xharness] Don't depend on the Harness.Mac value except to determine what to configure.
Currently we execute most of the same logic both during the configure phase
and when running tests, and the Harness.Mac value is only set in the configure
phase.

While it doesn't matter right now, this makes sure there aren't any future
surprises in this area, since otherwise we could end up with different
behavior between the configure phase and when running tests.
2019-06-20 10:48:51 +02:00
Rolf Bjarne Kvinge 4893a4a1f5 [xharness] Refactor how mac tests projects are generated. Fixes #6322.
Harness.AutoConfigureMac now loads all the mac test projects both when
configuring and running tests, the only difference is that the test projects
that must be generated are only generated when configuring. This means that
the Harness.MacTestProject list contains the exact same test projects both
when configuring and when running tests.

This made it possible to remove logic to clone (mac) test projects the Jenkins
class (since Harness.MacTestProjects contains all the test projects already).

Consolidate logic to generate (mac) test projects:

* First we generate BCL and mono-native projects from their templates.
* Then we generate Full/System variations of any project that needs it.

This way we can remove logic to generate Full/System variations from the logic
to generate BCL/mono-native projects, which means less duplicated (and less
confusing) code.

To this purpose, significant changes were required:

* MacTestProject.TargetFrameworkFlavor has been modified to contain a bit mask
  of the variations to generate.
* MacMonoNativeInfo has been significantly simplified, and some of the
  generated code has been moved to the actual template instead.
* Some project generation (in MacTarget) to make things work as expected.

Fixes https://github.com/xamarin/xamarin-macios/issues/6322.
2019-06-20 10:48:51 +02:00
Rolf Bjarne Kvinge a63ee4f782 [xharness] Select the right GuiUnit project file depending on the mac flavor. 2019-06-20 10:36:34 +02:00
Rolf Bjarne Kvinge 0cd58ff199 [xharness] Add helper methods to get/set deployment target in plist for macOS. 2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge 27e8c737f4 [xharness] Rename MacTarget.Mobile to MacTarget.Modern. 2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge 49e62ec992 [xharness] Unify some code. 2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge b5dc6201dd [xharness] Move *TestProject.BCLInfo and *TestProject.MonoNativeInfo to their base class. 2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge d9cf090a65 [xharness] Rename MacUnifiedTarget to MacTarget.
Everything is Unified now, so specifying it is redundant.
2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge aaf29c559f [xharness] Incorporate MacTarget into MacUnifiedTarget.
Since there's no MacClassicTarget anymore, we don't need the intermediate
class.
2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge bdb67b0514 [xharness] Improve ProjectFileExtensions.FixInfoPListNode.
* Share code with GetInfoPListInclude to find the same Info.plist nodes, so
  that FixInfoPListNode also finds existing nodes whose names isn't
  "Info.plist".
* Add support for specifying the new Info.plist name.
2019-06-20 10:36:15 +02:00
Rolf Bjarne Kvinge 0eff97976a [xharness] Refactor/rename TestPlatform fields.
Rename TestPlatform fields to be more in line with the rest of the code, and
drop the Unified prefix, since everything is Unified now.

* Unified -> Modern
* UnifiedXM45 -> Full
* UnifiedSystem -> System
2019-06-20 10:36:14 +02:00
Rolf Bjarne Kvinge 523349bf69 Merge remote-tracking branch 'origin/d16-2' into xcode11-bump-mono-d16-2 2019-06-20 10:27:04 +02:00
Rolf Bjarne Kvinge f9d39c640b
Merge pull request #6164 from monojenkins/backport-pr-6159-to-d16-2
[d16-2] [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
2019-06-19 17:29:43 +02:00
Rolf Bjarne Kvinge 14cac96c90
[d16-2] Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279) (#6361)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)

* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```

* [xibuild] Fix incorrect mscorlib.dll being used (#6068)

* [xibuild] Fix incorrect mscorlib.dll being used

The `GuiUnit_NET_4_5` project, when built with `xibuild` uses the wrong `mscorlib.dll`.

From https://github.com/xamarin/xamarin-macios/issues/5760#issuecomment-472457202 :

```
- mscorlib.dll is being used from mono/4.5 and the other system assemblies are from mono/4.5-api
- GuiNet* project is built with xibuild

What is happening here is:

	xibuild sets[1] `SetToolsetProperty ("TargetFrameworkRootPath", FrameworksDirectory + Path.DirectorySeparatorChar);`
	which points to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks`.
	This causes $(FrameworkPathOverride) to be set[2] to `/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETFramework/v4.5`,
	but that doesn't have a mscorlib.dll, so it gets reset[3] to /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5/.

	If we don't set TargetFrameworkRoothPath, then we get `FrameworkPathOverride = /Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api`,
	causing `_ExplicitReference=/Library/Frameworks/Mono.framework/Versions/5.22.0/lib/mono/4.5-api/mscorlib.dll`(correct one) to be used.
```

Fixes https://github.com/xamarin/xamarin-macios/issues/5760

1. https://github.com/xamarin/xamarin-macios/blob/master/tools/xibuild/Main.cs#L209
2. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L79
3. https://github.com/mono/msbuild/blob/xplat-master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L84

* Revert "Workaround https://github.com/xamarin/xamarin-macios/issues/5760 in generator csproj"

This reverts commit 9bd927bb7f.

The previous commit for xibuild removes the need for this.

* [xibuild] Handle "incorrectly" cased msbuild property names  (#6202)

msbuild property names are case insensitive. While generating the custom
app.config, in `SetToolsetProperty(..)` we try to update the property if
it already exists. But the name lookup was case sensitive, thus causing
the lookup to fail, resulting in two entries for the same property name
differing only in case. Eg. `MSBuildSDKsPath` vs `MSBuildSdksPath`.

Fixed to ignore case.

Fixes https://github.com/mono/mono/issues/14765 .
2019-06-19 17:28:01 +02:00
Ankit Jain e271d5e18d Bump VSMac to 8.1.0.2742 to fix msbuild issues (#6279)
* Bump VSMac to 8.1.0.2742 to fix msbuild issues

This is required to get the support for the msbuild `ToolsVersion`
change from `15.0` to `Current`.

* [tests][msbuild] Fix Binding resources test with updated msbuild

Test failure with updated msbuild and vsmac 8.1:

```
Xamarin.iOS.Tasks.NativeReferencesNoEmbedding("iPhone").ShouldNotUnnecessarilyRebuildBindingProject(True)
     Binding project build did not create package?
  Expected: True
  But was:  False

at Xamarin.iOS.Tasks.NativeReferencesNoEmbedding.ShouldNotUnnecessarilyRebuildBindingProject (System.Boolean framework) [0x000a0] in <74b8f7d8a53e40109916d305bb4d7403>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo cul
ture) [0x0006a] in <0519fa732e8845b6a809ce9180f541db>:0
```

The test builds the project multiple times. Before the 3rd build, the project
file's timestamp is updated and expects that the binding package will be
rebuilt. But it is not, because the target `_CreateBindingResourcePackage`
doesn't depend on that project file. So, add that to the target inputs.

* [nuget] Use xibuild to run nuget

Fix errors seen during `nuget restore` for tests:

```
Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xammac_tests/xammac_tests.csproj(213,3): error MSB4024: The imported project file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" could not be loaded. Could not find file "/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets"
```
2019-06-19 07:07:26 +02:00
Rolf Bjarne Kvinge 9be8fdeb7b
[xharness] Automatically enable tests on older simulators if we're using a beta Xcode. (#6334)
Usually it's when working on beta Xcodes we make mistakes that only show up
when running on older simulators (and devices):

* Missing/wrong availability attributes.
* Tests for new API that don't check the OS if that API is available.

So automatically enable the tests on older simulators for PR builds when using
a beta Xcode.
2019-06-17 19:15:41 +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
Rolf Bjarne Kvinge d3c60e516b
[xharness] Backport a few changes to get HE0038 reporting. (#6272)
* [xharness] Show links to previous test runs in html report in server mode. (#6031)

* [xharness] Change url for server mode.

* [xharness] Show links to previous test runs in html report in server mode.

This makes it much easier to see what failed in a previous test run.

* [XHarness] Show when we have a watch HE0038 error. (#6060)

To simplify the life of the monitorer, if we get a crash with a HE0038
we will propagate the result to the html and will provide a link to the
issue so that it is easy to report it.

* [xharness] Look for HE0038 anywhere in a log file. (#6175)

Most log files now have timestamps, which means that looking for 'HE00380' at
the start of each line won't work anymore.

Fixes an issue where the HE0038 issue isn't detected properly.
2019-06-12 16:47:15 +02:00
Sebastien Pouliot bf44459d8a Merge branch 'd16-2' into xcode11-d16-2-20190611 2019-06-11 13:23:04 -04:00
monojenkins e27067ab30 [d16-2] [xharness] Don't report tests whose device were not found if there were no such tests. (#6169) 2019-06-03 22:47:41 +02:00
Rolf Bjarne Kvinge 01e5ec39f7
Merge pull request #6193 from rolfbjarne/maccore-issue-1682-workaround
[xharness] Improve marking and reporting of known failures in tests.
2019-06-03 07:38:09 -07:00
Rolf Bjarne Kvinge 69a6d7204f [xharness] One issue is fixed, but another showed up, so the interpreter tests are still known failures for mscorlib. 2019-05-31 17:48:13 +02:00
Rolf Bjarne Kvinge ceefaac144 [xharness] The interpreter has been fixed for monotouch-test, so we can unignore those tests. Fixes xamarin/maccore#1613.
Fixes https://github.com/xamarin/maccore/issues/1613.
2019-05-31 17:47:59 +02:00
Rolf Bjarne Kvinge 4016597e37 [xharness] Mark the mscorlib interpreter tests as known failures. 2019-05-31 16:48:20 +02:00
Rolf Bjarne Kvinge e68f5cd1b3 [xharness] Don't run known failures when trying to run a collection of tests ('Run all' button).
It's still possible to running known failures by running the exact test
instead of the group it belongs to.
2019-05-31 16:48:20 +02:00
Rolf Bjarne Kvinge f9978488cd [xharness] Adjust HE0038 reporting to the new known failure logic.
This also makes it so that we only parse the log file once (when the test
finishes), instead of parsing every log named 'Run log' every time we produce
the html report.
2019-05-31 16:48:20 +02:00
Rolf Bjarne Kvinge e85d7119b8 [xharness] Add support for marking a test as a known failure and show the known failure text in the html report. 2019-05-31 16:48:20 +02:00
Manuel de la Pena 26a3394623
[XHarness] Clean the bcl-tests directory. (#6165)
The change is a pre step to fix https://github.com/xamarin/xamarin-macios/issues/6162

We are removing the not longer child directory bcl-test/BCLTests since
there is not longer any reason for it to exist. The changes make sure
that the tests work as expected in the new directory.

Next step, move all the test apps to their own directory.
2019-05-31 13:05:22 +02:00
Rolf Bjarne Kvinge 96517671f6 [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.
2019-05-31 06:32:58 +00:00
Rolf Bjarne Kvinge 9c29746825
[xharness] Add TimeoutMultiplier and multiply mscorlib's timeout by 2. (#6172)
mscorlib has many tests and need some extra time, especially on watchOS, so
bump the timeout by 2 (from 15 to 30 minutes).
2019-05-30 08:40:56 -07:00
Rolf Bjarne Kvinge 2a842e1265
[xharness] Look for HE0038 anywhere in a log file. (#6175)
Most log files now have timestamps, which means that looking for 'HE00380' at
the start of each line won't work anymore.

Fixes an issue where the HE0038 issue isn't detected properly.
2019-05-30 08:37:41 -07:00
Rolf Bjarne Kvinge 72d7a8ad9b Merge remote-tracking branch 'origin/master' into binary-artifacts 2019-05-30 07:25:03 +02:00
Rolf Bjarne Kvinge 0ce0010824
[Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941. (#6159)
* [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.

Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.

* [tests] MTLFunctionConstantValues didn't have a default ctor until Xcode 9.

* [tests] Use a higher offset when calling MTLBuffer.CreateTexture to try to comply with the requirements for the API.

Hopefully fixes this assertion:

> 07:42:06.7701360 validateStrideTextureParameters:1512: failed assertion `Linear texture: bytesPerRow (64) must be aligned to 256 bytes'

which doesn't happen on my machine.

* Fix whitespace.

* Simplify nested usings.

* Fix availability correctly.
2019-05-29 22:06:14 -07:00
Rolf Bjarne Kvinge 6a4cdb6a6d [Metal] Sprinkle [return: Release] on all 'new*' selectors. Fixes #5941.
Also add tests for all the API I could figure out how to use.

Fixes https://github.com/xamarin/xamarin-macios/issues/5941.
2019-05-29 19:27:21 +00:00
Rolf Bjarne Kvinge b5958e89c4 Merge remote-tracking branch 'origin/master' into binary-artifacts 2019-05-29 08:27:24 +02:00
Manuel de la Pena 0346e71213 [xharness] Remove mono tests built locally in favor of binary archive binaries (#6141)
* [XHarness] Remove the old style mscorlib tests.

Remove the old style test and replace it with the xunit equivalent which
has more tests and is provided by the mono package.

* Only skip the mscorlib tests on watchOS devices with 32b. Run them anywhere else.
2019-05-28 23:25:01 -07:00
Alexander Köplinger b8b79b03cb Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-28 21:43:52 +02:00
Manuel de la Pena c4a89496fc
[XHarness] Remove the mini tests since they are not longer needed. (#6152)
The tests in the mini project are the same ones found in
monotouch_Mono.Runtime.Tests_test.dll which is already ran via the
autogenerated bcl tests.

Mini tests therefore are redundant and require the mono sources which
will be removed.
2019-05-28 11:52:31 -07: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 8bd73ed060
[xharness] Timestamp all the things. (#6137)
* [xharness] Timestamp all the things.

I find myself wanting timestamps if I don't have them much more than wanting
them gone when I do.

Worst case scenario: timestamps can still be disabled for specific logs if
such a desire ever becomes overwhelming.

* [xharness] Don't timestamp xml files.
2019-05-28 05:25:50 -07:00
Rolf Bjarne Kvinge 74be8cec31
[xharness] Refactor a bit to simplify code. (#6140)
* [xharness] Refactor a bit to use named types for a few unnamed types with numerous fields.

Anonymous types becomes quite unwieldy the more fields they have.

* [xharness] Remove unnecessary field assignments.
2019-05-27 22:59:08 -07:00
Rolf Bjarne Kvinge 05aa58fd9e
[xharness] Order previous test runs so that the last test run show up at the top. (#6139) 2019-05-27 22:58:52 -07:00
Rolf Bjarne Kvinge 5f64e107b0
[xharness] Limit the number of errors/failures in the html report. (#6138)
Avoids creating a multi-gb index.html due to tens of thousands of compiler
errors by showing just a few of them instead.
2019-05-27 22:58:38 -07:00
Alexander Köplinger e9e7b835bd Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-28 02:01:28 +02:00
Manuel de la Pena fb3db66384
[XHarness] If no test are ran, consider it as a failed ran. (#6123)
If the total test run is 0 consider it a fail. Tests that failed after the change were also fixed.

Fixes: https://github.com/xamarin/xamarin-macios/issues/5767
2019-05-25 05:27:58 -07:00
Alexander Köplinger 8627c4311a Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-24 20:27:09 +02:00
monojenkins aab104dd1a [d16-2] [xharness] Don't use a dash in the bundle identifer for watchOS projects. (#6118)
* [xharness] Don't use a dash in the bundle identifer for watchOS projects.

It causes problems with the mscorlib test project, which can't be launched properly.

I'm not sure what's the underlying cause, but here are some of the symptoms:

* The watch app actually shows up fine on the device, but:
* mlaunch isn't notified about the new process, so it thinks the app didn't
  launch.
* The new process doesn't receive any environment variables we try to give it,
  which for instance means that it won't auto-start the tests upon launch.
* If we ask mlaunch to attach with lldb, mlaunch will ask watchOS to launch
  the process in a suspended state while lldb attaches. Yet the watch app
  shows up on the device as if not asked to be suspended upon launch.

It seems that the dash (I assume, because I haven't investigated this very
deeply, I just happened to find a solution that worked) makes watchOS launch
the app as if tapped, instead of launched from an IDE.

The strangest part is that this only happens with the mscorlib test project,
not any of the other test projects we run on the watch, and they all have
dashes in their bundle identifiers... yet replacing the dash with another
character (underscore, letter, removing it altogether) all made things work as
expected.

* [monotouch-test] Adjust expected value for watchOS bundle id.

The watchOS bundle ID changed in fc5067ee67, and
the test failure wasn't caught properly.
2019-05-24 08:47:02 -07:00
Rolf Bjarne Kvinge 0434104a92
[xharness] A test fails if there are either errors or failures. (#6129) 2019-05-24 03:34:52 -07:00
Manuel de la Pena f2188f9652
[XHarness] Fix exception when the result line is null. (#6122)
Fixes: https://github.com/xamarin/maccore/issues/1643
2019-05-24 01:25:00 -07:00
Rolf Bjarne Kvinge 7df24cc925
[xharness] Don't try to find simulators for ignored tests. (#6116)
Trying to find a simulator will mark the test as a failure if the simulator
couldn't be found, and we don't want that to happen to ignored tests.

This should fix an issue where xharness seems to try to run the 32-bit
simulator tests when asked to run only device tests.
2019-05-23 22:25:06 -07:00
Rolf Bjarne Kvinge 28f853b3f7
[xharness] Overwrite any existing html reports instead of throwing an exception if a report already exists. (#6117)
If a report already exists, it's probably because a previous attempt failed
for some reason. This is no reason to not try again, overwriting the previous
attempt.
2019-05-23 22:24:35 -07:00
Alexander Köplinger 776d40550c Merge remote-tracking branch 'upstream/master' into binary-artifacts 2019-05-23 20:19:27 +02:00
Rolf Bjarne Kvinge fc5067ee67
[xharness] Don't use a dash in the bundle identifer for watchOS projects. (#6114)
It causes problems with the mscorlib test project, which can't be launched properly.

I'm not sure what's the underlying cause, but here are some of the symptoms:

* The watch app actually shows up fine on the device, but:
* mlaunch isn't notified about the new process, so it thinks the app didn't
  launch.
* The new process doesn't receive any environment variables we try to give it,
  which for instance means that it won't auto-start the tests upon launch.
* If we ask mlaunch to attach with lldb, mlaunch will ask watchOS to launch
  the process in a suspended state while lldb attaches. Yet the watch app
  shows up on the device as if not asked to be suspended upon launch.

It seems that the dash (I assume, because I haven't investigated this very
deeply, I just happened to find a solution that worked) makes watchOS launch
the app as if tapped, instead of launched from an IDE.

The strangest part is that this only happens with the mscorlib test project,
not any of the other test projects we run on the watch, and they all have
dashes in their bundle identifiers... yet replacing the dash with another
character (underscore, letter, removing it altogether) all made things work as
expected.
2019-05-23 10:19:35 -07:00
Rolf Bjarne Kvinge b14c66a191
[xharness] Don't include debug variations when the debug configuration isn't supported. (#6112) 2019-05-23 08:32:29 -07:00
Manuel de la Pena 8e57754ded
[XHarness] Improve xml parsing. Fixes #6072 (#6099)
The entire Xml parsing code has been changed to make the following
improvements:

1. Simplify the logic.
2. Ensure that the tests are not added more than once in the human text
log.
3. Do not use the APIs that load the entire tests into memory. XmlReader
is used to read the file and parse the results.

Fixes: https://github.com/xamarin/xamarin-macios/issues/6072
Fixes: https://github.com/xamarin/maccore/issues/1632
2019-05-23 01:04:37 -07:00
Rolf Bjarne Kvinge dbc9157945
[xharness] Don't report tests whose device were not found if there were no such tests. (#6102) 2019-05-22 23:19:41 -07:00
Alexander Köplinger 48b3b82410 Merge remote-tracking branch 'upstream/master' into binary-artifacts
# Conflicts:
#	builds/Makefile
#	external/mono
2019-05-22 20:07:18 +02:00
Rolf Bjarne Kvinge d2c4e4ac96 [xharness] Rework arm64_32 variations a bit so that they're not always enabled.
We don't want to try to run arm64_32 tests on bots that don't have devices
attached, so make sure they follow the logic of other device tests.
2019-05-22 08:12:56 +02:00
Rolf Bjarne Kvinge 281ea5f97d [xharness] Don't run the mono-native-compat test on ARM64_32.
ARM64_32 only supports the unified native mode.
2019-05-22 08:12:14 +02:00
Rolf Bjarne Kvinge 969c8b8251 [xharness] Don't add Debug variations for arm64_32, we don't support it yet. 2019-05-22 08:11:44 +02:00
Rolf Bjarne Kvinge 4e9b69e870 [xharness] Add ARM64_32 support. 2019-05-22 08:06:44 +02:00
Alexander Köplinger 247a6bf551 Switch to mono archive and remove submodule 2019-05-21 22:16:02 +02:00
Rolf Bjarne Kvinge 835daf1f60 Merge remote-tracking branch 'origin/master' into arm64_32-v3 2019-05-21 07:53:23 +02:00
Manuel de la Pena b8824524b2
[XHarness] Remove the old style bcl tests. (#6083) 2019-05-20 16:58:45 -07:00
Rolf Bjarne Kvinge a9372793a7 Merge remote-tracking branch 'origin/master' into arm64_32-v3 2019-05-20 18:45:19 +02:00
Manuel de la Pena 4db4e09e7e
[Xharness] Add support to pass extra arguments to the test bcl apps. (#6082)
Allow to add extra mtouch arguments to the bcl test applications to configure them. This will allow to pass required specific settings that some tests have, for example, for the linker.
2019-05-20 09:35:22 -07:00
Manuel de la Pena 94fe39b118
[XHarness] Do use the test dlls from the mono downloads. (#6055)
This updates the project generation. We cannot yet fully remove the submodule because:

* We are missing the xunit dlls which should be added in the SDK.
* We have not yet remove all the old style tests. Would make the PR huge, better to deal with it in a diff PR.
* The xunit CoreLib tests have issues loading all the tests, needs some extra work and again, the PR is already large.

Fixes: xamarin/maccore#1199
Fixes: xamarin/maccore#1204
Fixes: xamarin/maccore#1209
Fixes: xamarin/maccore#1510
2019-05-19 14:55:14 -07:00
Rolf Bjarne Kvinge 2d34cb259b Merge remote-tracking branch 'origin/master' into arm64_32-v3 2019-05-17 14:53:15 -07:00
Rolf Bjarne Kvinge 6ff6d313a2
[xharness] Don't run monotouch-test/interpreter for now. (#6067)
Works around https://github.com/xamarin/maccore/issues/1613.
2019-05-17 14:48:31 -07:00
monojenkins a07ee9a973 [xharness] 'Skipped' really meant 'DeviceNotFound', so rename things to avoid confusion. (#6070) 2019-05-17 14:47:51 -07:00
monojenkins 987c309647 [xharness] Don't run monotouch-test/interpreter for now. (#6071)
Works around https://github.com/xamarin/maccore/issues/1613.
2019-05-17 14:47:08 -07:00
Rolf Bjarne Kvinge d84c3a0892
[xharness] 'Skipped' really meant 'DeviceNotFound', so rename things to avoid confusion. (#6066) 2019-05-17 08:59:33 -07:00
Rolf Bjarne Kvinge 47beab425d Merge remote-tracking branch 'origin/master' into arm64_32-v3 2019-05-16 15:26:15 -07:00
Rolf Bjarne Kvinge b6f735c26b [xharness] Rework arm64_32 variations a bit so that they're not always enabled.
We don't want to try to run arm64_32 tests on bots that don't have devices
attached, so make sure they follow the logic of other device tests.
2019-05-16 15:24:51 -07:00
Manuel de la Pena c9692c8e34
[XHarness] Support binlogs for the tests projects. Fixes #1604 (#6056)
Generate binlogs to ensure that we can easily debug msbuild failures.
2019-05-16 13:06:44 -07:00
Manuel de la Pena f2948b268e
[XHarness] Show when we have a watch HE0038 error. (#6060)
To simplify the life of the monitorer, if we get a crash with a HE0038
we will propagate the result to the html and will provide a link to the
issue so that it is easy to report it.
2019-05-16 13:05:19 -07:00
monojenkins 71334a51b3 [VSTS] Ensure that the corrent tests are run on devices. (#6052)
The change allows to state the tests that have to be ran. ATM with these
changes, the vsts pipeline must add the following to the env vars:

* tvOS device pipelines: Must add run-tvos-tests to the labels.
* iOS device pipelines: Must add run-ios-tests to the labels.

This will ensure that only the tests for the devices are ran and if the
tests pass we get a green build with no unexpected skips.
2019-05-16 12:57:45 -07:00
Manuel de la Pena 81d6225eb7
[XHarness] Fix some issues in the BCL test generator. (#5938)
We had issues in the code that adds a type found in an assembly to
ensure that it was not removed by the linker. This resulted in some
assemblies having 0 tests.

Added the needed ignore for the corlib tests and system ones.
2019-05-11 12:03:38 +02:00
Rolf Bjarne Kvinge 3a72377b70 [xharness] Don't run the mono-native-compat test on ARM64_32.
ARM64_32 only supports the unified native mode.
2019-05-10 11:28:22 +02:00
Rolf Bjarne Kvinge 321c6e7a87 [xharness] Don't add Debug variations for arm64_32, we don't support it yet. 2019-05-10 11:28:22 +02:00
Rolf Bjarne Kvinge 2f8100d962 [xharness] Add ARM64_32 support. 2019-05-10 11:28:22 +02:00
Rolf Bjarne Kvinge 6d8eba812d
[xharness] Show links to previous test runs in html report in server mode. (#6031)
* [xharness] Change url for server mode.

* [xharness] Show links to previous test runs in html report in server mode.

This makes it much easier to see what failed in a previous test run.
2019-05-10 07:40:45 +02:00
Rolf Bjarne Kvinge 55df161d6a Merge remote-tracking branch 'origin/d16-2' into xharness-old-simulators-d16-2 2019-05-09 21:44:26 +02:00
monojenkins f5561c2a24 [xharness] Fix finding labels in pull requests. (#6025)
Looks like this regressed in
61bf0db817 (diff-b01110f512ec4a442e37213063a11758R39);
since then no manual labels have been applied to test runs in public jenkins.
2019-05-09 21:44:07 +02:00
Rolf Bjarne Kvinge b31b02002e
[xharness] Flush the log after getting results from listing simulators/devices with mlaunch. (#6030)
Now constantly refreshing the device/simulator listing log will show the
output as mlaunch writes it, which makes the impatient me happier.
2019-05-09 21:38:43 +02:00
Rolf Bjarne Kvinge c0d68b7e85
[xharness] Don't only build if asked to run using the UI. (#6026)
This makes it possible to run tests that are marked as 'BuildOnly' to see if
they've been fixed or not.

There's already a 'build' button if only a build is desired.
2019-05-09 18:22:35 +02:00
Manuel de la Pena de0691a22a
[XHarness] List the simulators and devices in the html. (#6020) 2019-05-09 15:12:52 +02:00
Rolf Bjarne Kvinge f53f602590 [xharness] Don't throw NRE if a simulator doesn't exist.
We automatically create simulators when needed, but it won't work if the
simulator runtime isn't installed. So handle the case where a test might not
have a simulator to execute in correctly.
2019-05-09 13:23:52 +02:00
Rolf Bjarne Kvinge 80d69516ae [xharness] Group simulator tasks by simulator UDID instead of platform.
Since we may have multiple simulators for each platform now.
2019-05-09 13:23:49 +02:00
Rolf Bjarne Kvinge beb60f2439 [xharness] Make old simulator tests opt-in by using a github label. 2019-05-09 13:23:45 +02:00
Rolf Bjarne Kvinge d69bd7f37f [xharness] Verify that tasks can be run in aggregated mode.
If tasks can't be run (because there aren't any available simulators), then
the task will now fail gracefully with a useful failure message.
2019-05-09 13:23:38 +02:00
Rolf Bjarne Kvinge f7796e1eee [xharness] Add support for running tests with the earliest possible simulator, and use it for introspection tests. 2019-05-09 13:23:34 +02:00
Rolf Bjarne Kvinge 6df96ffa9f
Merge pull request #6004 from rolfbjarne/xharness-old-simulators5
Add support for running tests with the earliest possible simulator, and use it for introspection tests.

* Add support for running tests with the earliest possible simulator
  (currently iOS 8.1, tvOS 9.1 and watchOS 2.0).
* Make the introspection tests run with the earliest possible simulator.
* Fix several binding issues (mostly missing availability attributes), and a
  couple of issues in the introspection tests themselves.

Reference: https://github.com/xamarin/xamarin-macios/issues/3668.
2019-05-09 13:20:21 +02:00
Manuel de la Pena f2f345ac25
[VSTS] Ensure that the corrent tests are run on devices. (#6019)
The change allows to state the tests that have to be ran. ATM with these
changes, the vsts pipeline must add the following to the env vars:

* tvOS device pipelines: Must add run-tvos-tests to the labels.
* iOS device pipelines: Must add run-ios-tests to the labels.

This will ensure that only the tests for the devices are ran and if the
tests pass we get a green build with no unexpected skips.
2019-05-09 13:06:49 +02:00
Rolf Bjarne Kvinge 744ec56156 Merge remote-tracking branch 'origin/master' into xharness-old-simulators5 2019-05-08 15:05:05 +02:00
Rolf Bjarne Kvinge 8c4e284ac7
[xharness] Fix finding labels in pull requests. (#6009)
Looks like this regressed in
61bf0db817 (diff-b01110f512ec4a442e37213063a11758R39);
since then no manual labels have been applied to test runs in public jenkins.
2019-05-08 15:04:28 +02:00
Rolf Bjarne Kvinge 62f0d29429
[xharness] Improve logging about labels found. (#6007) 2019-05-07 15:57:17 +02:00
Rolf Bjarne Kvinge c97d267faf
[runtime] Implement support for an arm64 dynamic registrar. (#6005)
This is required in order to execute downloaded assemblies (or any other
assembly not known at compile time) on device.
2019-05-07 07:35:39 +02:00
Rolf Bjarne Kvinge fa9125dcd0 [xharness] Don't throw NRE if a simulator doesn't exist.
We automatically create simulators when needed, but it won't work if the
simulator runtime isn't installed. So handle the case where a test might not
have a simulator to execute in correctly.
2019-05-06 17:00:39 +02:00
Rolf Bjarne Kvinge 3a83936dfd [xharness] Group simulator tasks by simulator UDID instead of platform.
Since we may have multiple simulators for each platform now.
2019-05-06 17:00:39 +02:00
Rolf Bjarne Kvinge 61b2dc817b [xharness] Make old simulator tests opt-in by using a github label. 2019-05-06 17:00:39 +02:00
Rolf Bjarne Kvinge 13497d3bab [xharness] Verify that tasks can be run in aggregated mode.
If tasks can't be run (because there aren't any available simulators), then
the task will now fail gracefully with a useful failure message.
2019-05-06 17:00:39 +02:00
Rolf Bjarne Kvinge e48955268f [xharness] Add support for running tests with the earliest possible simulator, and use it for introspection tests. 2019-05-06 17:00:33 +02:00
Rolf Bjarne Kvinge 682f54da87
[linker] Mark protocol interfaces when using the dynamic registrar. (#5988)
* [linker] Mark protocol interfaces when using the dynamic registrar.

Fixes this monotouch-test failure when using the dynamic registrar and the
linker at the same time:

    [FAIL] RegistrarTest.TestProtocolRegistration :   UIApplicationDelegate/17669
      Expected: True
      But was:  False

* [tests] Adjust test after linker change.

All Xamarin.iOS apps will now link with QuickLook when using the dynamic
registrar, because NSUrl implements a QuickLook protocol:
fcac64ad6e/src/foundation.cs (L5445).

Adjust LinkAll_Frameworks accordingly, and add a new test that verifies that
the old behavior (not linking with QuickLook when linking all assemblies) is
still correct.
2019-05-06 13:21:02 +02:00
Rolf Bjarne Kvinge d6aa896f03 [tests] Add tests for failing to marshal from managed array to NSArray, 2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge 4300aa8d03
Fix/improve marshalling of out/ref parameters, arrays, Classes and Selectors. Fixes #5171.
* Share much more marshalling code between the dynamic and static registrar
  (by refactoring code into separate functions used by both).
* Fix an issue with multiple out/ref parameters in the dynamic registrar.
* Throw an error instead of silently ignoring out/ref parameter types we don't
  completely understand in the dynamic registrar.
* Fix returning Class/SEL out/ref parameters in the static registrar.
* Fix returning NSString out/ref parameters in the dynamic registrar.
* Add/fix support for out/ref arrays everywhere.
* Fix support for the various supported out/ref parameter types in the
  generator.
* Add lots of tests.

Fixes https://github.com/xamarin/xamarin-macios/issues/5171.
2019-04-30 16:28:39 +02:00
Rolf Bjarne Kvinge 6c3674658a
Download the Mono SDK archive for macOS as well. (#5953)
* Download the Mono SDK archive for macOS as well.

* [tests] Don't forget the tests.
2019-04-26 16:44:29 +02:00
Rolf Bjarne Kvinge 67ed868f5f [tests] Add tests for failing to marshal from managed array to NSArray, 2019-04-26 11:20:15 +02:00
Manuel de la Pena 56ae1da5b9
[XHarness] Allow to ignore the iOS 32 tests and show the devices that are connected.
Two changes to improve CI:

1. List the devices connected to the bot.
2. Allow to ignore the 32 devices.
2019-04-25 17:38:10 +02:00
Rolf Bjarne Kvinge bd457212d5
[tests] Add sample tester. (#5870)
* [tests] Add sample tester.

Add a unit project that looks for iOS/macOS/tvOS sample projects in several
repositories, and builds them all.

* [tests][sampletester] Remove known issue which has now been fixed.

* [tests] Only run sample tests on CI in Azure Devops.

* Remove the possibility of automatically running the sample tests with
  xharness (so the sample tests won't run on PR bots or internal bots when the
  'run-all-tests' label is added). It's still possible to run the sample tests
  manually from the xharness web UI.

* Automatically trigger the sample test run in Azure Devops if the
  'run-sample-tests' label is applied to a PR (and that PR is executed on
  internal Jenkins).

* Fix typo.

* Fix path.

* Verbose output to track down scheduling failure.

* Bump maccore to get improved debug spew.

Diff: f527c9c526..f89d74b165

* [tests][sampletester] Fix build for TodoWCF.
2019-04-25 17:18:43 +02:00
Manuel de la Pena c9b834ddaa
[XHarness] Use better names for BCL watchOS tests. (#5867)
Ensure we do not use the target dir because that does not represent the
name of the test because it is shared by all of them.

Fixes https://github.com/xamarin/xamarin-macios/issues/5157
2019-04-08 19:22:22 +02:00
Manuel de la Pena 9cd5fd4ba2 [XHarness] Fix the generation of the fsharp today sln. (#5860)
Because we are missing a separator, the comparison results in a true,
when it is a substring BUT NOT in the same path.
2019-04-05 15:42:41 -05:00
Manuel de la Pena dd11ba5d6c
[XHarness] Fix issues building the today extensions for the BCL tests apps. (#5854) 2019-04-05 14:07:39 +02:00
Manuel de la Pena 411d673ead
[XHarness] Fix IntermediateOutputPath getting inserted in the wrong place. (#5841) 2019-04-03 17:29:07 +02:00
Alexander Köplinger e142ee7a57 [xharness] Display test assemblies contained in a BCL test group (#5814)
* [xharness] Display test assemblies contained in a BCL test group

* PR feedback
2019-03-29 10:17:39 +01:00
Vincent Dondain eb73f3ce6e
[xharness] Fix BuildOnly logic (#5813)
https://github.com/xamarin/xamarin-macios/pull/4884 introduced the logic of only building certain `RunTestTask`.
This was meant to disable iOS Extensions as part of a fix to https://github.com/xamarin/maccore/issues/1008.
However this didn't quite work and iOS extensions were still running (and failing).
The reason being that `BuildOnly` was set to a `RunDeviceTask` that's added to a list which is then given to `CreateTestVariations` which creates new instances of `RunDeviceTask`.
We now propagate `BuildOnly` to the new variation instance.
2019-03-28 09:23:40 -04:00
Manuel de la Pena 9bb4d2d2d5
[XHarness] Ensure we do not crash if the framework node is missing. (#5792) 2019-03-20 12:49:09 +01:00
Manuel de la Pena 1615b28ed1
[XHarness] Reduce the number of test applications for the BCL tests. (#5768)
This commit improves the state of the BCL testing in the following ways:

1. Improve the device tets running. Less apps, faster results.
2. WatchOS apps are left as they were to ensure that we do not have deplouyment/run issues.

We now support the ignore files per assembly name to simplify the
tracking of the ignored tests. All
2019-03-20 12:10:18 +01:00
Rolf Bjarne Kvinge 45f72fcbbe
[xharness] Remove bitcode from tvOS apps. (#5781)
We don't need the bitcode for testing, it makes test apps bigger (so big that
the Apple TV might refuse to install them).
2019-03-18 15:00:21 +01:00
Rolf Bjarne Kvinge 6447d0a498
[xharness] Add UI option to include (or not) tests that might put up permission dialogs. (#5780) 2019-03-18 12:52:06 +01:00
Manuel de la Pena 1cadb1bd2f
[XHarness] Add an extra configuration option for the tests matrix to match those in QA. (#5761)
New combinations have only been added to add-gc-test-matrix, mini and mscorlib
2019-03-14 11:37:37 +01:00
Manuel de la Pena 014aa6b2c9
[XHarness] Add an extra configuration option for the tests matrix to match those in QA. (Thumb) (#5763) 2019-03-13 19:00:49 +01:00
Rolf Bjarne Kvinge 5c1fa7dae6
[xharness] Add UI option to not automatically uninstall apps after running a test on device. (#5747)
This is useful when I want to re-run a test manually to debug failures. In
particular on the watch it's annoying to have to re-install the app.
2019-03-11 11:17:10 +01:00
Rolf Bjarne Kvinge ddc8b3dde2
[xharness] Simplify/unify the code to load simulators/devices. (#5746) 2019-03-08 19:31:53 +01:00
Rolf Bjarne Kvinge 99e727c90b
Merge pull request #4904 from xamarin/mono-2018-10
Bump to mono:2018-10
2019-03-08 11:06:50 +01:00
Manuel de la Pena bc3b5a2d43
[Tests] Fix the tests.sln to include the new test projects. (#5720)
Update the sun and ensure that the GUID of the projects are always the same to make the .sln file happy.
2019-03-07 13:14:53 +01:00
Alexander Köplinger 97b5aef47e Merge branch 'master' into mono-2018-10 2019-02-28 21:18:49 +01:00
Manuel de la Pena c2967c0d50
[XHarness] Ensure we do a nuget restore on bcl imported tests. Fixes #5383 (#5574)
* [XHarness] Ensure we do a nuget restore on bcl imported tests. Fixes #5383

We need to ensure that a nuget restore is done, otherwise we might have
build issues with missing libs.

Fixes https://github.com/xamarin/xamarin-macios/issues/5383
2019-02-28 18:27:01 +01:00
Alexander Köplinger bbbf15a72b Merge branch 'master' into mono-2018-10
# Conflicts:
#	tests/bcl-test/System.Core/System.Core.csproj.template
#	tests/bcl-test/System.Net.Http/System.Net.Http-mac.csproj.template
#	tests/bcl-test/System.ServiceModel.Web/System.ServiceModel.Web.csproj.template
#	tests/bcl-test/System.Xml.Linq/System.Xml.Linq-mac.csproj.template
#	tests/bcl-test/System/System.csproj.template
2019-02-28 13:06:00 +01:00
Manuel de la Pena 2619d8f5ca
[XHarness] Remove duplicated runs of certain bcl tests. (#5668)
Most of the tests are comming from the downloaded SDK, but some of them
have to reman because they are running/passing more tests. This
differences are due to how the tests that come from mono are written
(missing resources etc..)

Please take a look at
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/794210/ for the
list of bcl tests and test number differences.
2019-02-27 11:08:04 +01:00
Manuel de la Pena 9b2d22727b
[XHarness] Remove the test runs that are not needed in mac os x. (#5671)
The new test dlls already cover some of the tests. This PR removes those
that have the same amount or more passes in the new style tests.

Please read
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/794210/ to see
the run results.

Related PR: https://github.com/xamarin/xamarin-macios/pull/5668
2019-02-27 11:07:15 +01:00
Alexander Köplinger 1e9de96789 Merge branch 'master' into mono-2018-10 2019-02-24 10:20:44 +01:00
Alexander Köplinger 9dd4276f09 Update xharness mono-native config to expect static linking for frameworks 2019-02-22 21:17:52 +01:00
Rolf Bjarne Kvinge e5724788b6
[xharness] Improve rendering of newlines and tabs in html report. (#5648) 2019-02-22 09:59:30 +01:00
Rolf Bjarne Kvinge 156e8995fa
[xharness] Use existing (and pre-defined) defines for bitcode platforms. (#5650)
It's harder to forget setting the define if it's already set by default.

Fixes the mini tests on watchOS device:

    [FAIL] JitTests.Exceptions : System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.
    ----> System.ExecutionEngineException : Attempting to JIT compile method 'ExceptionTests:test_1_basic_filter_catch ()' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

since BITCODE wasn't defined everywhere it needed to be.
2019-02-21 18:08:33 +01:00
Alexander Köplinger 777a406838 Merge branch 'master' into mono-2018-10 2019-02-20 14:29:27 +01:00
Rolf Bjarne Kvinge cf6771e612
[xharness] Improve app installation on device. (#5628)
* Instead of calculating a timeout based on the app size and an estimated
  transfer speed, keep transferring as long as mlaunch outputs something to
  stdout. The actual transfer speed can vary a lot, in particular if
  installing to multiple nearby watches simultaneously.

* Improve progress text in the html report during installation to include more
  statistics for the impatient.
2019-02-20 06:33:30 +01:00
Rolf Bjarne Kvinge 3a1ac0e31f
[xharness] Do not include actual bitcode when building watch extensions. (#5627)
It makes watch extensions very big, and extremely slow to upload, when we have
no use for the bitcode since we won't publish anything.
2019-02-20 06:30:57 +01:00
Alexander Köplinger 75ea3ca9bc Merge branch 'master' into mono-2018-10
# Conflicts:
#	external/mono
#	tests/xharness/Extensions.cs
2019-02-18 18:04:06 +01:00
Rolf Bjarne Kvinge 2339a410b3
[xharness] Add UI option to disable auto-clean for successful test runs. (#5621)
By default xharness will clean the project after a successful test run (which
can be required if running many device tests without enormous amounts of disk
space).

However, sometimes this can be annoying, in particular if trying to re-run a
particular test manually.

So add an option in the UI to make cleaning optional.
2019-02-18 16:57:07 +01:00
Rolf Bjarne Kvinge b0975fb7c1
[xharness] Add commands to only build tests. (#5620)
Sometimes you just want to build.
2019-02-18 16:42:39 +01:00
Rolf Bjarne Kvinge 8d194c9ae8 [tests] Don't use 10.0 as the minimum tvOS version.
It runs into an Apple issue where the linker can't find
'dispatch_queue_create_with_target' if the minimum tvOS version is exactly
10.0.

Ref: http://openradar.appspot.com/radar?id=4966840983879680
2019-02-18 13:39:25 +01:00
Alexander Köplinger d8b97ad15e Fix NUnit.ConsoleRunner version in Makefiles (#5610)
It was updated to 3.9.0 in https://github.com/xamarin/xamarin-macios/pull/5538 but a few hardcoded 3.5.0 in the Makefiles were missed
2019-02-15 07:38:21 +01:00
Alexander Köplinger 3974db63c3 [xharness] Fix bug in Simulators.LoadAsync() (#5605)
The "Gizmo" and "Companion" are child elements, not attributes on the SimDevicePair.

Also replaced the custom Distinct() implementation with a comparer which can be used with standard LINQ.
2019-02-14 13:54:31 +01:00
Alexander Köplinger 90bed29175 [xharness] Fix bug in Simulators.LoadAsync()
The "Gizmo" and "Companion" are child elements, not attributes on the SimDevicePair.

Also replaced the custom Distinct() implementation with a comparer which can be used with standard LINQ.
2019-02-14 03:51:20 +01:00
Rolf Bjarne Kvinge 0f49b41513 Merge remote-tracking branch 'origin/master' into mono-2018-10 2019-02-13 13:51:37 +01:00
Rolf Bjarne Kvinge e76033f398
[xharness] Don't create 32-bit iOS interpreter variations, since the interpreter doesn't work on 32-bit iOS (yet). (#5597) 2019-02-13 13:47:12 +01:00
Rolf Bjarne Kvinge 7a46e2da25
[xharness] Don't try to autorefresh when loading from file:// urls. (#5590) 2019-02-13 13:29:04 +01:00
Rolf Bjarne Kvinge c58487b2da
[xharness] Ignore duplicated device pairs. (#5592)
According to simctl this shouldn't be possible (you get an error if you try),
but it happened on my system somehow, so cope with it.
2019-02-13 13:26:53 +01:00
Rolf Bjarne Kvinge e3fd461999
[xharness] Make the right queue list stay at the right when there's long text on the left. (#5593)
Previously the queue at the right would move to the top (above the test list)
if a node with a lot of text in the test list was expanded. This is annoying
(since things would move out of view unexpectedly), so change the css so that
the queue on the right stays on the right no matter what.

This also required reordering the left and right divs in the html, which is
most of the diff.
2019-02-13 13:25:11 +01:00
Rolf Bjarne Kvinge 53f77d6fcd
[xharness] Refactor a bit to use async code for the test listener instead of a thread pool thread. (#5581)
This fixes an issue where we'd consume a thread pool thread until the launch
timeout if the app launched, but the test run never started (it crashed at
launch for instance).
2019-02-11 17:36:13 +01:00
Rolf Bjarne Kvinge e82cd60e6e [xharness] Simplify and optimize the mono native library tests. 2019-02-11 13:49:38 +01:00
Rolf Bjarne Kvinge 5385f44021 [xharness] Some style/debug fixes. 2019-02-11 13:49:38 +01:00
Alexander Köplinger 3661e7869a Remove not needed xharness code 2019-02-06 01:15:56 +01:00
Alexander Köplinger 8829aa0c39 Merge branch 'master' into mono-2018-10
# Conflicts:
#	tests/xharness/Harness.cs
2019-02-05 21:38:47 +01:00
Rolf Bjarne Kvinge 6bc475e624
[xharness] Rework BCL test importation to not bail out completely if something went wrong. (#5540)
Rework BCL test importation to generate projects that won't compile instead of
giving up completely in case of generation failure.

This means that xharness can still be used for non-BCL tests even if the
generation of the BCL tests fail.
2019-02-05 12:55:46 +01:00
Rolf Bjarne Kvinge 6af4f139c2
[tests] Use latest version of NUnit for test projects to get support for parallelized tests. (#5538)
* [tests] Use latest version of NUnit for test projects to get support for parallelized tests.

* [xharness] Automatically find the correct nunit-console executable for NUnit tests.
2019-02-04 15:22:00 +01:00
Alexander Köplinger 68657484bb Merge branch 'master' into mono-2018-10 2019-02-04 15:11:58 +01:00
Rolf Bjarne Kvinge 204361d62e
[xharness] Simplify code slightly. (#5506) 2019-01-31 18:28:38 +01:00
Bernhard Urban bec4e8604a Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-2018-10 2019-01-18 14:09:29 +01:00
Bernhard Urban 269ccd1495
[xharness] recognize newer watches (#5419)
* [xharness] recognize newer watches

* s/iPod/Watch/
2019-01-18 14:00:01 +01:00
Rolf Bjarne Kvinge 3e9673560f
[xharness] Bump documentation tests timeout. (#5404)
Bump the documentation tests timeout. It can take a while to run the
documentation tests when they're run in parallel with other tests.

Reference: 85130ddbb7 (commitcomment-31935455)

Fixes https://github.com/xamarin/maccore/issues/1350.
2019-01-18 07:51:25 +01:00
Alexander Köplinger 929e4623c4 Merge branch 'master' into mono-2018-10
# Conflicts:
#	external/mono
2019-01-14 15:26:56 +01:00
Rolf Bjarne Kvinge 0075415c39
[xharness] Add support for GitHub authentication, and use it in Jenkins. (#5380)
This makes it much less probable to hit any rate limits, because authenticated
rate limits are much higher (5000 requests/hour vs 60 requests/hour).
2019-01-11 15:48:16 +01:00
Rolf Bjarne Kvinge e1061ee196
[xharness] Move javascript and css to external files. (#5378)
This makes editing them a bit simpler.

There are no functional changes.
2019-01-11 15:25:36 +01:00
Alexander Köplinger 25f306461c Fix building and running of BCL tests
BCL tests are now reading test assets from embedded resources instead of from disk.
2019-01-11 14:30:47 +01:00
Alexander Köplinger f2e5ffba6d Remove SyncTestResources.targets
It's no longer needed now that the BCL tests read test assets from embedded resources.
2019-01-10 22:14:58 +01:00
Alexander Köplinger bf4f4e0022 Improve logging 2019-01-10 22:14:58 +01:00
Alexander Köplinger 42a2434271 Fix build broken due to missing using statements in xharness 2019-01-10 22:14:58 +01:00
Alexander Köplinger ca90eb2e19 Merge branch 'master' into mono-2018-10
# Conflicts:
#	external/mono
2019-01-10 22:13:44 +01:00
Rolf Bjarne Kvinge 61bf0db817
[tests] Run tests-docs using xharness. (#5372)
Jenkins has a limitation where you can't mark a step a failure, it has to
*fail* to be reported as such.

This means that running multiple tests, and reporting a failure if any of
those tests fail is not possible.

We run into this with the normal test run + the docs tests; where we currently
don't show a red result in the UI if any of those fail.

So incorporate the test-docs step into xharness, so that we only have one
thing to in the Jenkinsfile, which makes it possible for us to fail the test
run step properly.

This also required a few upgrades to xharness to get more info for pull
requests, since the logic to enable the docs tests is a bit more complicated
than anything else we have (if the current branch (or the target branch for a
PR) is 'master' AND xamarin mode is enabled).
2019-01-10 16:43:02 +01:00
Rolf Bjarne Kvinge b7c8fdbedb
[tests] Add test to ensure LLVM succeeds on watchOS for every assembly we ship. (#5295)
* [tests] Add test to ensure LLVM succeeds on watchOS for every assembly we ship.

References:

* https://github.com/mono/mono/issues/12131: LLVM failed for 'UIEdgeInsets.Equals': opcode r4_cneq
* https://github.com/mono/mono/issues/12130: [watchOS] MT3001: Could not AOT the assembly mscorlib.dll
* https://github.com/xamarin/xamarin-macios/issues/4763: [RFC] Improve handling of filter clauses with LLVM/Bitcode
* https://bugzilla.xamarin.com/show_bug.cgi?id=58209: LLVM/bitcode can't handle filter clauses

* LLVM failure in mscorlib.dll is now fixed.

* Revert "LLVM failure in mscorlib.dll is now fixed."

This reverts commit ace3c930a9.

* [tests] Run mtouch tests inprocess.

Fixes a remoting exception:

    System.Runtime.Remoting.RemotingException: Cannot create channel sink to connect to URL fff8ce5c_3219_4dd0_941f_500dd49e02a5/94f23f2_4.rem. An appropriate channel has probably not been registered.

    Server stack trace:
      at System.Runtime.Remoting.RemotingServices.GetClientChannelSinkChain (System.String url, System.Object channelData, System.String& objectUri) [0x00019] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.RemotingServices.GetOrCreateClientIdentity (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType, System.Object& clientProxy) [0x0001d] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.RemotingServices.GetRemoteObject (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.RemotingServices.GetProxyForRemoteObject (System.Runtime.Remoting.ObjRef objref, System.Type classToProxy) [0x0001b] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef, System.Boolean fRefine) [0x0007a] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.ObjRef.GetRealObject (System.Runtime.Serialization.StreamingContext context) [0x0000f] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.ObjectManager.ResolveObjectReference (System.Runtime.Serialization.ObjectHolder holder) [0x00010] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.ObjectManager.DoFixups () [0x0007f] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize (System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Serialization.Formatters.Binary.__BinaryParser serParser, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00077] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Boolean isCrossAppDomain, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x000a2] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Boolean fCheck, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.DeserializeMethodResponse (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler, System.Runtime.Remoting.Messaging.IMethodCallMessage methodCallMessage) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
      at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage msg) [0x00083] in <dcf627861d9e44ce818b79d685496eeb>:0

    Exception rethrown at [0]:
      at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_remoting_wrapper(intptr,intptr)
      at (wrapper remoting-invoke) NUnit.Engine.Agents.RemoteTestAgent.Load()
      at NUnit.Engine.Runners.ProcessRunner.LoadPackage () [0x00040] in <28c9cb3cd2594f14ad436553a9b77f5d>:0
      at NUnit.Engine.Runners.AbstractTestRunner.Load () [0x00000] in <28c9cb3cd2594f14ad436553a9b77f5d>:0
      at NUnit.Engine.Runners.MasterTestRunner.LoadPackage () [0x0006b] in <28c9cb3cd2594f14ad436553a9b77f5d>:0
      at NUnit.Engine.Runners.MasterTestRunner..ctor (NUnit.Engine.IServiceLocator services, NUnit.Engine.TestPackage package) [0x0007a] in <28c9cb3cd2594f14ad436553a9b77f5d>:0
      at NUnit.Engine.TestEngine.GetRunner (NUnit.Engine.TestPackage package) [0x0001e] in <28c9cb3cd2594f14ad436553a9b77f5d>:0
      at NUnit.ConsoleRunner.ConsoleRunner.RunTests (NUnit.Engine.TestPackage package, NUnit.Engine.TestFilter filter) [0x00095] in <93782c327b3c4ab5aae551528dfe1cae>:0
      at NUnit.ConsoleRunner.ConsoleRunner.Execute () [0x000b6] in <93782c327b3c4ab5aae551528dfe1cae>:0
      at NUnit.ConsoleRunner.Program.Main (System.String[] args) [0x001b5] in <93782c327b3c4ab5aae551528dfe1cae>:0

* [xharness] Run mtouch tests in-process.

* [tests] Don't run the LLVM watchOS tests if we didn't build for device.

* [tests] Update NoLLVMFailuresInWatchOS known failures according to latest mono bump.
2019-01-08 15:17:21 +01:00
Marek Safar c6653167b9 Merge remote-tracking branch 'origin/master' into mono-2018-10 2019-01-07 14:41:25 +01:00
Manuel de la Pena ef78b1dbc3
[XHarness] Do not build the test assemblies for the iOS platforms. (#5270)
We now download the ios Mono sdk which means that there is no need for
us to build the test assemblies on iOS, WatchOS and tvOS BUT we need to
do so for the Mac tests.

The change includes:
  1. Use fo the downloaded test assemblies.
  2. Removal of the dependency of building them in the tests.
  3. Move back to using reflection for the project generation.
  4. Remove the cached project details added in the workaround.
2018-12-18 14:21:09 +01:00
Marek Safar aa6fefb1c9 Merge remote-tracking branch 'origin/master' into mono-2018-10 2018-12-17 15:28:08 +01:00
Chris Hamons d7c2a45ca9
Add 'NoBindingEmbedding' style binding project support (#5167)
- Existing binding projects embed the native libraries within the assembly as managed resource
- This does not scale well and has performance implications
- This PR creates a new property, NoBindingEmbedding which when true processes the building and consumption of binding projects differently.
- Existing binding projects are not affected, they will continue as is
- I've written a full XM test suite and ported a subset to iOS. Since iOS only supports checked in projects, and I didn't want to make the existing situation worse by adding more, I only wrote tests that could use the existing test projects.
    -When we complete some form of msbuild testing reform, we'll revisit these tests.
- Remove two files in MyiOSFrameworkBinding that are not used (we use copies elsewhere)
- Remove unnecessary sleep and fix broken touch command
- Output failing test log to console instead of test output
    - VSfM does not handle thousands of lines of test failure message well
- Add ability to generate binding projects with LinkWith
2018-12-12 09:55:57 -05:00
Manuel de la Pena ffae762db2
[XHarness] Add support for xunit and nunit tests on Mac OS X. (#5182)
This change adds support to execute the tests provided by mono as assemblies.This includes:

1. App generation to run the bcl tests on modern and full.
2. Needed workaround to delay the compilation of the assemblies until we have them from the SDK.
3. All failing tests are ignored.
2018-12-12 10:38:48 +01:00
Bernhard Urban 4061adc2a4 [interp] fix mixed mode in Release configuration (#5230)
* [mtouch] do not strip assemblies when interpreter is used

* [xharness] add release mixed-mode configuration

* [xharness] enable debug mixed-mode config for mscorlib

* [mtouch] add link to mono issue
2018-12-11 17:51:05 +01:00
Rolf Bjarne Kvinge 55837e3d80
[xharness] Handle Process.HasExited throwing exceptions. (#5239)
Apparently Process.HasExited may throw exceptions, so handle those gracefully
(by ignoring them completely):

    Unhandled Exception:
     System.AggregateException: One or more errors occurred. (No process is associated with this object.) ---> System.InvalidOperationException: No process is associated with this object.
       at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x00018] in <d012d9eca6d14975a47488863de2f4c6>:0
       at System.Diagnostics.Process.get_HasExited () [0x0000b] in <d012d9eca6d14975a47488863de2f4c6>:0
       at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.get_HasExited()
       at xharness.Process_Extensions+<>c__DisplayClass2_0.<RunAsync>b__2 () [0x00001] in <285dbdcf9e034cd496a3fef953fac640>:0
       at System.Threading.CancellationToken.ActionToActionObjShunt (System.Object obj) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationCallbackInfo.ExecutionContextCallback (System.Object obj) [0x00007] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationCallbackInfo.ExecuteCallback () [0x00024] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.CancellationCallbackCoreWork (System.Threading.CancellationCallbackCoreWorkArguments args) [0x00042] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers (System.Boolean throwOnFirstException) [0x000c0] in <96207d0baa204f48a53ad6be05f5ecba>:0
        --- End of inner exception stack trace ---
       at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers (System.Boolean throwOnFirstException) [0x00132] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.NotifyCancellation (System.Boolean throwOnFirstException) [0x0005f] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.Cancel (System.Boolean throwOnFirstException) [0x00006] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.Cancel () [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at xharness.AppRunner+<>c__DisplayClass73_0.<RunAsync>b__0 (System.Object v) [0x00029] in <285dbdcf9e034cd496a3fef953fac640>:0
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
     ---> (Inner Exception #0) System.InvalidOperationException: No process is associated with this object.
       at System.Diagnostics.Process.EnsureState (System.Diagnostics.Process+State state) [0x00018] in <d012d9eca6d14975a47488863de2f4c6>:0
       at System.Diagnostics.Process.get_HasExited () [0x0000b] in <d012d9eca6d14975a47488863de2f4c6>:0
       at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.get_HasExited()
       at xharness.Process_Extensions+<>c__DisplayClass2_0.<RunAsync>b__2 () [0x00001] in <285dbdcf9e034cd496a3fef953fac640>:0
       at System.Threading.CancellationToken.ActionToActionObjShunt (System.Object obj) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationCallbackInfo.ExecutionContextCallback (System.Object obj) [0x00007] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationCallbackInfo.ExecuteCallback () [0x00024] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.CancellationCallbackCoreWork (System.Threading.CancellationCallbackCoreWorkArguments args) [0x00042] in <96207d0baa204f48a53ad6be05f5ecba>:0
       at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers (System.Boolean throwOnFirstException) [0x000c0] in <96207d0baa204f48a53ad6be05f5ecba>:0 <---
2018-12-07 15:07:21 +01:00
Rolf Bjarne Kvinge 1cdfc65b38 Merge remote-tracking branch 'origin/master' into mono-2018-10 2018-12-07 08:25:46 +01:00
Rolf Bjarne Kvinge 544925738d
[xharness] Implement Process.WaitForExitAsync and use it instead of creating background threads. (#5207)
Using fewer threads is always good.
2018-11-30 16:49:03 +01:00
Rolf Bjarne Kvinge 8a81607279
[xharness] No need to spawn to kill, when we can just P/Invoke the corresponding function. (#5199)
* [xharness] No need to spawn to kill, when we can just P/Invoke the corresponding function.

* Revert accidental changes.
2018-11-29 19:36:04 +01:00
Rolf Bjarne Kvinge ae13240b20
[xharness] Don't recursively print diagnostics for processes when printing diagnostics times out in the first place. Fixes maccore#1163. (#5198)
Recursively printing diagnostics can leave us with _many_ lldb processes, each
pretty much hanging, and the system overloaded, which, in the worst case
scenario, would require a hard reboot.

Most commonly the "only" thing that happens is an OutOfMemoryException when
the OS eventually tells xharness NO to launching new processes.

Fixes https://github.com/xamarin/maccore/issues/1163.
2018-11-29 16:33:57 +01:00
Marek Safar 60d08b8559 Merge branch 'master' into mono-2018-10 2018-11-29 13:41:32 +01:00
Rolf Bjarne Kvinge 95a4b9a2a1
[xharness] Write intermediate html reports to disk when running in server mode too. (#5193)
That way the report is still available even if xharness dies.

Also improve report generation to write directly to a temporary file on disk,
instead of writing to memory and then writing to disk (improves memory usage).
2018-11-28 15:02:30 +01:00
Rolf Bjarne Kvinge 170711596d
[xharness] Create a timestamped log directory instead of timestamping every file inside it. (#5192)
Only for server mode right now, since otherwise it would break links for CI builds.
2018-11-28 11:59:01 +01:00
Rolf Bjarne Kvinge 8618db251c
[xharness] Show device/simulator loading in progress in the web UI. (#5186) 2018-11-27 17:02:39 +01:00
Rolf Bjarne Kvinge 943e7eafd5
[xharness] Add support for stopping queued tasks in the web UI. (#5185) 2018-11-27 14:59:44 +01:00
Manuel de la Pena 61b2038b3d
[Xharness] Add a workaround to not build the xunit tests when not needed. (#5156)
* [Xharness] Add a workaround to not build the xunit tests when not needed.

This is a workaround that does not use reflection to build the bcl test
projects. We need this until we have complete support of using mono as
an SDK.
2018-11-23 16:02:15 +01:00
Manuel de la Pena 3618cefc5a
[Harness] Reduce the noise in the make files. Fixes xamarin/maccore#1156 (#5154)
* [Harness] Reduce the noise in the make files.

The Makefile.cs code generates a lot of noise becuase it tries to build
a make rule for the new BCL tests, these rules do not work and can be
ignored.

Fixes issue: https://github.com/xamarin/maccore/issues/1156
2018-11-21 13:28:06 +01:00
Rolf Bjarne Kvinge f91e8fb811
Use a full path to xibuild. (#5140)
* Use a full path to xibuild.

Use a full path to xibuild everywhere, since it's easier than making sure PATH
is correct every time we want to invoke xibuild.

Also remove the xbuild-in-place script, it's not used anymore.

* Fix xibuild path lookup.

* [xammac_tests] Remove unneeded csproj changes.
2018-11-20 12:14:16 -05:00
Rolf Bjarne Kvinge 50bb4912e1
Revert "[xharness] Only build the BCL tests when we need them. (#5139)" (#5149)
This reverts commit 7277bbcd2b, it breaks building & running the new BCL tests.
2018-11-20 07:06:37 -05:00
Rolf Bjarne Kvinge 7277bbcd2b
[xharness] Only build the BCL tests when we need them. (#5139)
Only build the BCL tests when we need them, because we can't build them when
we're running the device tests (because we don't have a built source tree in
that case).

Since the test assemblies are required when generating the BCL projects, this
means we also delay creating the BCL projects until we need them.
2018-11-19 09:07:35 -05:00
Bernhard Urban f15233f3db [tests] enable msorlib with interpreter (#5122) 2018-11-19 07:18:12 -05:00
Ankit Jain f865694f86 Move tests to use new tool xibuild and thus fix msbuild tests (#5128)
* xibuild: New wrapper tool to run msbuild or managed executables

MSBuild supports fallback paths for projects imported using
`$(MSBuildExtensionsPath)`, but these must be specified explicitly in
the app.config of the main executable. There was a PR to allow use of
properties for this in the app.config, but that was not accepted
upstream.

This is required for being able to:

1. build projects with msbuild against the in-tree XI/XM build output
2. and to run nunit tests against the same.

For this we introduce a new tool, `xibuild`, based on XA's `xabuild`.
This supports the fallback paths to be specified via the environment variable
`MSBuildExtensionsPathFallbackPathsOverride`[1].
It essentially operates in 3 modes:

1. `xibuild -c /path/to/foo.exe`
	Generates /path/to/foo.exe.config with the fallback paths inserted into that.

2. `xibuild -- /v:diag /path/to/project.csproj`
	Runs msbuild with the arguments after `--` with a custom app.config based on
	`MSBuild.dll.config`, with the fallback paths correctly inserted.
	This is in a temporary file and the original config file is not touched.

3. `xibuild -t -- /path/to/managed_tool.exe args`
	Generates `/path/to/managed_tool.exe.config` based on `MSBuild.dll.config` with
	the fallback paths inserted, and runs `managed_tool.exe` with the arguments.
	The default is to overwrite the config file.
	But there is also a switch to merge it with an existing config file.

--
1. Value of the environment variable $MSBuildExtensionsPathFallbackPathsOverride
is prepended to any existing list of search paths in `MSBuild.dll.config`, IOW,
it takes precedence. So, the order of lookup becomes:

  - Value of the property `$(MSBuildExtensionsPath)`
  - Value of the environment variable `$MSBuildExtensionsPathFallbackPathsOverride`
  - /Library/Frameworks/Mono.framework/External/xbuild on macOS

* Integrate use of `xibuild` with the tests

Update all uses of `msbuild` and invocations of tools like nunit that
might depend on using the in-tree builds to use `xibuild`.

* xibuild: Move help descriptions to OptionSet itself.
2018-11-16 14:24:35 -05:00
Manuel de la Pena 505006952c
[Tests] Add a new iOS app to run the xunit and nunit tests (#4914)
Mono know provides a set of testing assemblies that contain the tests to be ran in each of the supported platforms. This commit adds the following:

1. Two different runners that can be used to execute NUnit and xUnit tests.
2. The necessary  glue to get xharness to run the new tests and report the results.
3. A new test that will ensure that if mono adds new tests, xharness will report failures if the tests are not run or not ignored.
2018-11-16 13:31:40 -05:00
Ludovic Henry 1c59076f82 Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-2018-10 2018-11-14 14:20:02 -05:00
Martin Baulig 2a553a003c Handle common test sources via templates. 2018-11-14 13:42:49 -05:00
Martin Baulig 6ff0ddd74c [xharness]: Add xharness support for mono-native. 2018-11-14 13:26:30 -05:00
Rolf Bjarne Kvinge ab2f931da6
[tests] Increase the timeout for 'Mac Binding Projects' from the default 5m to 15m. Fixes maccore#1125. (#5105)
Fixes https://github.com/xamarin/maccore/issues/1125.
2018-11-08 18:22:26 +01:00
Rolf Bjarne Kvinge fa440cf01c
[xharness] Make sure we don't run 'nuget restore' for tests-mac.sln multiple times in parallel. Fixes maccore#1122. (#5104)
Make sure we don't run 'nuget restore' for test-mac.sln multiple times in
parallel by creating a separate make target that runs 'nuget restore', and
making every build-mac-* target depend on that target.

Fixes https://github.com/xamarin/maccore/issues/1122.
2018-11-08 15:36:56 +01:00
Rolf Bjarne Kvinge 3835e1dafb
[tests] Point MSBuild to the right Xamarin.Mac location when building packaged Xamarin.Mac tests. Fixes maccore#1115. (#5090)
* [tests] Point MSBuild to the right Xamarin.Mac location when building packaged Xamarin.Mac tests. Fixes maccore#1115.

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

* [xharness] Ensure all makefile targets set the proper environment variables.
2018-11-07 09:34:16 +01:00
Rolf Bjarne Kvinge 27688e8d5b
[xharness] Fix the generation of the Mac makefile to export the right variables to use the locally build Xamarin.Mac. (#5087) 2018-11-06 15:06:58 +01:00
Bernhard Urban b9170ae434 [tests] enable monotouch-test with --interpreter=-mscorlib on Jenkins (#5051)
aka. mixed mode
2018-11-06 13:22:17 +01:00
Sebastien Pouliot 917214828d
[xharness] Log the environment variables in the execution logs (#5045)
While trying to debug an msbuild unit tests it was not possible to
successfully copy/paste the command from the execution log and
run it in a shell.

It's not that hard to run xharness and figure it out - but the
same can happen on bots (which could be harder).

So that little change prints out the host and xharness changes
to the environment variables to make copy/pasters life even
lazier :)
2018-10-26 13:34:08 -04:00
Bernhard Urban 9688c42e2d Bump mono and enable monotouch-test with interpreter (#5023)
* Bump Mono 2018-06

Commit list for mono/mono:

* mono/mono@c0fe724379 [aot] Reenable recursion checking when initing shared got entries (#11295)
* mono/mono@f55f7e53e3 [interp] use unsigned conversion for nuint (#11285)
* mono/mono@5986920bdb [2018-06] [arm64] Remove the limitation on the number of nullable arguments for dyncalls (#11266)
* mono/mono@665a308c39 [WinForms] Propagate the flags from DrawTextInternal to MeasureTextInternal (#11251)
* mono/mono@5ed4143b4f [2018-06] Crash Reporter V2 (#11162)
* mono/mono@f0db92c2b6 [interp] Implement interpreter entry trampolines on amd64 (#10978) (#11165)
* mono/mono@c1f1a7bfed [ci] Move OSX .pkg build to a separate bot pool
* mono/mono@d80ced607b [aot] Ensure shared got entries are initialized before loading methods (#11225)
* mono/mono@d07c626a74 [pkg] Add preinstall which removes existing Mono of the same version (#11209)
* mono/mono@cda3acc57c [sdks] futimens and futimes symbols are missing on anything earlier than 10.13 (#11174)
* mono/mono@226e91a064 Bump xunit-binaries

Diff: 2343f26706...c0fe724379

* [tests] enable monotouch-test with --interpreter on Jenkins
2018-10-24 15:24:22 -04:00
Rolf Bjarne Kvinge d899d4fb70
Remove bitrotted support for a separate mono submodule for watchOS support. (#5022)
Unce upon a time we used a separate mono submodule for watchOS support, to make
development of watchOS support easier (we referenced mono/master, to avoid
backporting fixes for watchOS support through various release branches in
mono).

This only worked until our watchOS support became stable, since then we had to
start using a stable version of mono for watchOS support.

This means that our build support for using a separate mono clone for watchOS
support is no longer needed; and in any case it's broken because of build
changes done later.
2018-10-22 16:14:26 +02:00
Rolf Bjarne Kvinge 250fd976a4
Merge pull request #4111 from radical/msbuild-port
[msbuild] Move from xbuild to msbuild
2018-10-15 16:55:53 +02:00
Rolf Bjarne Kvinge 904be25c25
[xharness] Generate a system variant of dont link, and run it using the oldest mono version we support in Jenkins. Fixes #4121. (#4968)
This is an addition to the tests we already run on older macOS bots (and as such will not execute on our PR bots).

Fixes https://github.com/xamarin/xamarin-macios/issues/4121.
2018-10-15 16:51:46 +02:00
Rolf Bjarne Kvinge 745c18cc73 Merge remote-tracking branch 'origin/master' into msbuild-port 2018-10-11 07:31:58 +02:00
Jo Shields 6f2ebedb74 Bump to mono:2018-06 (#4277)
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
https://github.com/mono/mono/pull/7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a0 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32af [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: 7d5f4b6136...7bcda192a0

* Revert 4bacab3d5c, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump to a VSfM version that can build XM Classic projects.
2018-10-10 11:02:28 -04:00