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

165 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 61d3d399c8
[xharness] Don't try to parse inexistent or empty files. (#3306) 2018-01-26 07:39:05 +01:00
Rolf Bjarne Kvinge daf0700543
[xharness] No need to try to run (or even show) non-executable projects. (#3264) 2018-01-19 07:08:13 +01:00
Rolf Bjarne Kvinge 86a51076ed
[xharness] Adjust colors a bit. (#3263)
When determining the color for a collection of tests, first check if the
execution result is identical for all tests in the collection, in which case
just use the corresponding color for a single test.
2018-01-19 07:06:50 +01:00
Rolf Bjarne Kvinge 75e851fdda
[install-source] Add console runner from Nuget and fix xharness to restore nugets before attempting to build. (#3251)
xharness needs a solution in order to ask for a nuget restore, so make sure to
provide the path to the solution.

This fixes a build issue where the install source tests would fail to build
due to picking up the system's nunit.framework.dll because the nuget one
wasn't found/restored:

    MonoPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    XamarinSourcesPathManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    PathManclerFactoryTests.cs(8,3): error CS0619: 'TestFixtureAttribute' is obsolete: 'The NUnit framework shipped with Mono is deprecated and will be removed in a future release. It was based on NUnit 2.4 which is long outdated. Please move to the NUnit NuGet package or some other form of acquiring NUnit.'
    OpenTKManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(29,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(30,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(31,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(33,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(35,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(36,4): error CS0616: 'TestCase' is not an attribute class
    OpenTKManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(37,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(38,4): error CS0616: 'TestCase' is not an attribute class
    MonoPathManglerTest.cs(39,4): error CS0616: 'TestCase' is not an attribute class
    XamarinSourcesPathManglerTest.cs(47,4): error CS0616: 'TestCase' is not an attribute class
2018-01-18 16:58:56 +01:00
Rolf Bjarne Kvinge dee0fd984a
[xharness] Run monotouch-test both with and without the static registrar in the simulator. (#3236)
* [xharness] Run monotouch-test both with and without the static registrar in the simulator.

This way we catch (some) problems with the static registrar without having to run on device.

* [xharness] Add comments to explain extra test configurations.

* [xharness] Fix how projects are cloned.

Fix how projects are cloned so that xharness doesn't end up confused when
multiple test tasks share the same build task.

Previously xharness would iterate over all test tasks and modifying their
build tasks, now it will create the build tasks correctly in the first place.
2018-01-18 07:14:07 +01:00
Rolf Bjarne Kvinge d059dfce56
[xharness] Run mtouch and mmp tests when there are MSBuild changes. (#3209)
In particular the mmp tests build a lot of project files, which means they can
find issues whenever something in the MSBuild logic changes, so run them.

They would have caught https://github.com/xamarin/maccore/issues/612 for instance.
2018-01-12 17:05:54 +01:00
Jeffrey Stedfast 316948e5d0 [msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3168) 2018-01-08 14:29:52 -05:00
Sebastien Pouliot 8d854a0f3d
[xtro] Split results by framework and add an HTML report (#3093)
* Not every old annotations have been migrated (work in progress, to be completed in another PR);

* Sanitation of the data files (e.g. removal of dupes and fixed, by Apple, entries) is done, but not automated (also a work in progress)

Even then this is immediately useful, i.e. better merged before 15.6 gets branched.
2017-12-15 14:08:09 -05:00
Manuel de la Pena 8ed3f85c07
[Debugger] Allow to step into Xamarin code. (#1663)
* [Debugger] Allow to step into Xamarin code.

The tool now detects the different sources and mangles the path to
ensure that the correct paths are installed in the following location:

/Library/Frameworks/Xamarin.iOS/Versions/Current/src
/Library/Frameworks/Xamarin.Mac/Versions/Current/src

The tool will detect if the path map command was used in the mdb and pub files, will point to the correct source code and will copy it to the installation dir. 

Tests have been added that will be ran both by wrench and jenkins ensuring that changes in the manglers do not change it behaviour.
2017-12-05 14:13:59 +01:00
Jeffrey Stedfast 5645e3349a Revert "[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3007)"
This reverts commit 2d4256ef15.
2017-11-29 09:22:22 -05:00
Rolf Bjarne Kvinge 79f193709b
[xharness] Make it possible to select from the command line whether tests requiring system permissions should be executed or not. (#3053) 2017-11-28 19:16:46 +01:00
Rolf Bjarne Kvinge f9b4c93cf0
[xharness] Improve logging. (#3051)
Make the collection of logs (the `Logs` class) more capable by making it
disposable (which will dispose all contained logs) and give it a Directory
property to state where the logs should be stored. This makes it possible to
simplify a few repeated path calculations. It also allows us to easily dispose
the entire collection of logs when done with a test, as opposed to dispoing
the logs one by one.

Make LogFile more capable:

* Add support for writing byte arrays.
* Add support for logging after disposal: this will still write to the file,
  and not keep any files open after finished writing. This fixes a problem
  where writing to a log after it was disposed would crash xharness (which is
  not all that uncommon, given the async nature of how xharness runs tests).

This makes it possible to get rid of LogStream, and use LogFile instead.
2017-11-28 14:27:31 +01:00
Jeffrey Stedfast 2d4256ef15
[msbuild] Repack all iOS Task assemblies into Xamarin.iOS.Tasks.dll (#3007)
* [msbuild] Pack all iOS MSBuild Task assemblies into a single assembly

* Fixed the build

* Renamed ProcessArgumentBuilder to CommandLineArgumentBuilder

This is needed to prevent symbol conflicts with Xamarin.MacDev's
ProcessArgumentBuilder (which is functionally different from
Xamarin.MacDev.Tasks.Core's class of the same name).

* Fixed ILRepack logic for filtering dll's to repack

* Fixed building of Xamarin.iOS.Tasks.Tests now that X.iOS.Tasks.dll contains all symbols

* Updated Makefile now that only 1 iOS Task assembly needs to be distributed

* ILRepack Xamarin.Mac.Tasks as well

* Fixed up *.targets to specify The One Assembly To Rule Them All

* [xharness] Build MSBuild tests with MSBuild.

* Touch the ilrepack stamp file *after* invoking ILRepack, not before.

* Same for Xamarin.Mac.Tasks
2017-11-27 14:44:09 -05:00
Rolf Bjarne Kvinge 80ea066577
[xharness] Don't run the mmp regression tests in parallel with other tests. (#3046)
The mmp regression tests are already executed in parallel (using `make -j8` in
the Makefile), and they're quite CPU intensitive, which means that if xharness
runs other tests in addition to the these tests, then those other tests may
fail randomly.
2017-11-27 17:00:37 +01:00
Rolf Bjarne Kvinge 6aca49c97b
[xharness] Parse 'XML log' as NUnit result file as well. (#3045)
This makes xharness show mtouch/mmp test failures inline in the html report too.
2017-11-27 17:00:13 +01:00
Rolf Bjarne Kvinge 1880cd906e
[xharness] Run tests when something changes in tests/common. (#3044) 2017-11-27 16:59:35 +01:00
Rolf Bjarne Kvinge 29277e1ad2
[xharness] Don't keep files open when not needed anymore. (#3035)
Dispose logs (so that the corresponding files are closed) when we're done with
them, and also don't open a file log by default (usually we just want a
filename to pass to somebody else), but instead open the file if needed.

This should decrease the number of open file descriptors in xharness, which
sometimes become a problem when running many tests.
2017-11-24 07:38:17 +01:00
Rolf Bjarne Kvinge af389bda1f
[tests] Improve how test failures show up in the html report for Xamarin.Mac tests. (#3033)
* [tests] Add support for passing arguments to XM unit tests from the command line.

* [xharness] Get xml results for mac unit tests and parse it to show failures inline in the html report.
2017-11-23 19:16:02 +01:00
Rolf Bjarne Kvinge 1beff97cc0
[xharness] Bump timeout for mmp tests, since they can take longer when running in parallel with other tests. (#3031) 2017-11-23 16:40:57 +01:00
Rolf Bjarne Kvinge 3a28d950ab
[xharness] Report the exit code when thinking a test crashed. (#3028)
Usually an exit code of neither 0 nor 1 means a test run crashed (in
particular if the exit code is 130+), but this may not always be true, so
report the exit code as well so that a human can evaluate properly.
2017-11-23 07:29:46 +01:00
Rolf Bjarne Kvinge 83586f878d
[xharness] Make sure different flavors of XM tests don't build/run from the same path. (#3027)
Change [Intermediate]OutputPath of Xamarin.Mac test projects to include the
project flavor, so that they don't build into (and run from) the same location
(which leads to random and incorrect behavior for at least one of the
flavors).

Fixes https://github.com/xamarin/maccore/issues/584
2017-11-22 16:28:32 +01:00
Rolf Bjarne Kvinge 6d063afdb5
[tests] Run the tests on Wrench like we do on Jenkins. (#3026)
* [xharness] Add support for executing a command periodically.

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

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

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

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

* [xharness] Timestamp a few more logs.

* [xharness] Disable the @MonkeyWrench calls, since we're not uploading directly to wrench anymore.
2017-11-22 16:03:36 +01:00
Rolf Bjarne Kvinge efebe2b73b
[tests] Port the makefile-based generator tests to NUnit. (#3019)
* [tests][generator] Port bindas1048error to NUnit.

* [tests][generator] Port bindas1049error to NUnit.

* [tests][generator] Port bindas1050modelerror to NUnit.

* [tests][generator] Port bindas1050protocolerror to NUnit.

* [tests][generator] Port bug42855 to NUnit.

* [tests][generator] Port bug57070 to NUnit.

* [tests][generator] Port bug52570classinternal to NUnit.

* [tests][generator] Port bug52570methodinternal to NUnit.

* [tests][generator] Port bug52570allowstaticmembers to NUnit.

* [tests][generator] Port protocol-duplicate-abstract-error to NUnit.

* [tests][generator] Port protocol-duplicate-method-diff-length to NUnit.

* [tests][generator] Port protocol-duplicate-method-diff-out to NUnit.

* [tests][generator] Port protocol-duplicate-method-diff-type to NUnit.

* [tests][generator] Port protocol-duplicate-method-diff-return to NUnit.

* [tests][generator] Port warnaserror to NUnit.

* [tests][generator] Port nowarn to NUnit.

* [tests][generator] Add support for inspecting/asserting the generated content.

* [tests][generator] Port some Xamarin.Mac tests to NUnit.

Ported:

* bmac_smoke
* bmac-with-hyphen-in-name
* property-redefination-mac
* NSApplicationPublicEnsureMethods
* protocol-duplicate-abstract

* [tests][generator] Point bgen to our local installation.

* [tests][generator] Port the bug31788 test to a unit test.

* [generator] Make the 'bgen' helper target more complete.

* [tests][generator] Port non-custom iOS tests to unit tests.

* [tests][generator] Add new test.

* [tests][generator] Port the forum54078 test to a unit test.

* [tests][generator] Port the desk63279 test to a unit test.

* [tests][generator] Port the desk79124 test to a unit test.

* [tests][generator] Port the multiple-api-definitions tests to unit tests.

* [generator] Use mono code style.

* [tests][generator] Port the bug29493 test to a unit test.

* [tests][generator] Port the classNameCollision test to a unit test.

* [tests][generator] Port the bi1036 test to a unit test.

* [tests][generator] Port the bug37527 test to a unit test.

Also fix BI1112 and BI1113 to show up as errors in the console output (since
they're exceptions they're already treated as errors and would cause bgen to
fail).

* [tests][generator] Port the bug27986 test to a unit test.

* [tests][generator] Port the bug35176 test to a unit test.

* [tests][generator] Port the bi1046 test to a unit test.

* [tests][generator] Port the virtualwrap test to a unit test.

* [tests][generator] Port the bug42742 test to a unit test.

* [tests][generator] Port the noasyncinternalwrapper test to a unit test.

* [tests][generator] Port the noasyncwarningcs0219 test to a unit test.

* [tests][generator] Port the bug53076 test to a unit test.

* [tests][generator] Port the bug53076withmodel test to a unit test.

* [tests][generator] Port the fieldenumtests test to a unit test.

* [tests][generator] Port the smartenumwithframework test to a unit test.

* [tests][generator] Port the forcedtype test to a unit test.

* [tests][generator] Port the bug46292 test to a unit test.

* [tests][generator] Build tests with MSBuild.

There's no need to use xbuild for these tests.

* [tests][generator] Remove dead code.

* [xharness] Don't run the makefile-based generator tests anymore.

Since there aren't any makefile-based generator tests anymore, they've all
been ported to NUnit tests.

* [tests][generator] Make the bug39614 test do what it was supposed to do: make sure a namespace isn't required (but recommended).
2017-11-20 14:55:16 +01:00
Rolf Bjarne Kvinge 976eb7b51e
[xharness] Don't run BCL tests in parallel for Xamarin.Mac. (#3014) 2017-11-16 18:50:43 +01:00
Rolf Bjarne Kvinge 12d7cc87dd
[xharness] Increase timeouts for a few tests, since they may run slower when run in parallel. (#2968) 2017-11-07 16:12:37 +01:00
Rolf Bjarne Kvinge fa7c6fb8eb
[xharness] Try to use a fixed port for the html server (but fallback to random port if it fails). (#2967)
Just so that the URL doesn't change every time you launch the server.
2017-11-07 16:12:13 +01:00
Rolf Bjarne Kvinge 9e59425349
[xharness] Properly handle failure by mlaunch to wait for app exit. (#2946)
Detect MT1111 from mlaunch (which means mlaunch won't wait for the app to
exit), and instead use test run completion to determine test completion.

The main drawback is that if the test app crashes, it won't be detected (the
test run will time out, and reported as such), but it's still an improvement
over the current behavior (the tests may complete successfully, and still be
reported as timed out).

This also requires bumping maccore to get an updated mlaunch (one that reports
MT1111).
2017-11-02 12:46:18 +01:00
Chris Hamons 2510b805b2
Add XM Modern to BCL test suite (#2923) 2017-10-27 16:44:22 -05:00
Chris Hamons cdffea44b9 [macos] Fix guiunit error on clean builds by depending on correct copy (#2912)
* [macos] Fix guiunit error on clean builds by depending on correct copy

- From a clean build making a BCL test would error due to the non-mobile guiunit not being built
- This was because the Makefile-mac.inc target was incorrect
- This was because xharness assumed that non variation based targets were always Modern
- However, BCL tests are Full, not Modern

* Code review change

* Swap to var to reduce diff
2017-10-20 17:14:02 +02:00
Rolf Bjarne Kvinge 8d1ebd48e5 [xharness] Fix clearing simulator state. Fixes #60229 and #58951. (#2904)
Fix clearing the simulator state by properly finding the correct simulators
from tasks that will actually run, and not from potentially ignored/failed
tasks (which won't have necessarily simulators).

https://bugzilla.xamarin.com/show_bug.cgi?id=58951
https://bugzilla.xamarin.com/show_bug.cgi?id=60229
2017-10-19 17:50:35 +02:00
Rolf Bjarne Kvinge 28673d3e31 Add Objective Sharpie 3.4 as an optional dependency, and add support for running xtro tests on wrench+jenkins. (#2887)
This will add Objective Sharpie as an optional dependency, only enforced if
actually trying to run the xtro tests.

The wrench/jenkins tests will show up as green for now (since there are known
failures in the xtro tests that have to be addressed first).
2017-10-17 12:03:50 +02:00
Rolf Bjarne Kvinge 1ff9a548ec [xharness] Try to guess a failure reason by parsing the run log. (#2879)
This isn't meant to be accurate, just more helpful than not showing anything at all in the test summary.
2017-10-13 07:53:08 +02:00
Rolf Bjarne Kvinge 43f84f6ca7 [xharness] Improve device selection, taking wireless devices into account. (#2827)
* [xharness] Don't list unusable devices.

* [xharness] Show the list of candidate devices in the html report.

* [xharness] Prioritize devices depending on the interface speed.
2017-10-02 17:37:19 +02:00
Rolf Bjarne Kvinge f23bd79eff [xharness] Timestamp install logs. (#2825)
* [xharness] Simplify code a bit.

Logs are TextWriters by themselves, so no need to get a StreamWriter to pass
to API that takes TextWriter, when we can just pass the log instance itself.

This makes it possible to timestamp external process output (because
Log.Timestamp is honored instead of bypassed).

* [xharness] Timestamp install logs.

So that we get exact numbers of how long it takes to install on watch (and if
the watch installation stalls, or just times out because it takes too long).
2017-10-02 17:36:41 +02:00
Rolf Bjarne Kvinge cd542a0845 [generator] Remove non-IKVM code. (#2769) 2017-09-25 14:37:51 -04:00
Rolf Bjarne Kvinge fdaeb9f2d2 [xharness] Don't try to run 32-bit tests on devices that don't support 32-bits. (#2749) 2017-09-22 19:53:35 +02:00
Rolf Bjarne Kvinge bf6f4e9498 [xharness] There's no need to wait for simulators/devices to load. (#2748)
We construct every test case independent of whether a simulator or device is
available, which means we don't have to wait for simulators/devices to load
before creating test cases. Enumerating the available simulators/devices will
still block until loading is complete, but that only happens when we want to
run a test (after building it).

This makes the initial load much faster, since listing devices is becoming
slower now.
2017-09-22 18:06:21 +02:00
Rolf Bjarne Kvinge 0603fbad9e [xharness] Fix javascript to work in Safari 11. (#2755)
There seems to be two bugs:

1. Comparing identical styles returns false (although this may just be how javascript works).

2. Given the following:

    ar_obj.style.display = 'hide';
    new_obj.style.display = 'hide';
    ar_obj.style = new_obj.style;
    // now ar_obj.style.display == 'block'. HUH!?!

    I can't fathom how this is expected, but Chrome shows the same behavior. Yay javascript.

Fix this by not trying to assign identical styles, by comparing the css text
instead of the style objects.
2017-09-22 18:05:51 +02:00
Rolf Bjarne Kvinge 1ba523011a [xharness] Add support for manually reloading devices/simulators from the html UI. (#2753)
This is useful when forgetting to plug in a device before launching the web ui.
2017-09-22 18:04:55 +02:00
Rolf Bjarne Kvinge 71a17aa673 [xharness] Add support for generating only specific variations for iOS projects. Fixes #57529 (#2751)
And use it to skip watchOS tests for Mono.Security, since we don't ship Mono.Security.dll for watchOS.

https://bugzilla.xamarin.com/show_bug.cgi?id=57529
2017-09-22 18:04:32 +02:00
Sebastien Pouliot 05eb96d0a7 Merge branch 'xcode9' into xcode9-master-merge 2017-09-15 11:05:30 -04:00
Rolf Bjarne Kvinge 540044d9e9 [xharness] Add a missing IsServerMode check to generate correct html. (#2581) 2017-09-01 15:24:45 +02:00
Rolf Bjarne Kvinge fa98739e94 [xharness] Add support for writing a summary in markdown format. (#2563)
This is useful for VSTS, which allows for showing a file in markdown format on
the front page of a build.
2017-08-29 14:59:37 +02:00
Rolf Bjarne Kvinge 270910bdc1 [tests] Add makefile target to run xharness in web server mode. (#2477) 2017-08-11 15:28:49 -04:00
Rolf Bjarne Kvinge 34f75ef03d [xharness] It watchOS tests don't need to be clean anymore. Fixes #58348. (#2473)
https://bugzilla.xamarin.com/show_bug.cgi?id=58348
2017-08-10 08:52:12 -04:00
Rolf Bjarne Kvinge 1360d12993 [xharness] watchOS tests need to run in a clean environment. Works around #58348. (#2462)
https://bugzilla.xamarin.com/show_bug.cgi?id=58348
2017-08-10 08:05:47 +02:00
Rolf Bjarne Kvinge b5f769ab5c [xharness] Add support for hiding ignored tests in the html report. (#2465) 2017-08-10 07:23:41 +02:00
Rolf Bjarne Kvinge b47d6030e9 [xharness] Fix html according to W3's validator service. (#2464) 2017-08-10 07:23:16 +02:00
Rolf Bjarne Kvinge ea73f99112 [xharness] Load simulators and devices in parallel. (#2442)
This speeds the launch up a little bit.
2017-08-08 19:34:59 +02:00
Rolf Bjarne Kvinge f8a3a2f2a0 [xharness] Skipping tests is bad. (#2443)
Skipping tests happen when a device/simulator isn't found for a test, and
should not be ignored.
2017-08-08 19:34:44 +02:00