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

65 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 69b95172b3
[xharness] Unify the list of test projects for .NET between iOS and macOS. (#12469)
* [xharness] Unify the list of test projects for .NET between iOS and macOS.

* [xharness] Don't enable all .NET tests if .NET is enabled.

Some tests (such as device tests) have additional checks that must be honored as well.

* [xharness] If a test is ignored, then it doesn't matter what the corresponding build task is doing.

A build task can be shared between multiple tests, and it can be building for
another (enabled) test. This happens for iOS 32-bits and 64-bits simulator:
the app is built once, but have two different tests running.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-09-06 15:23:41 +02:00
Rolf Bjarne Kvinge 4f5e2c507e
[tests] Move deletion of existing temporary directory to the background. (#12511)
Improve Cache.CreateTemporaryDirectory to move the deletion of the previous
root temporary directory to a background thread. In some cases this directory
can have a lot of files and directories, and deleting it synchronously can
cause a significant startup delay when running tests locally.
2021-08-23 16:45:06 +02:00
Rolf Bjarne Kvinge 8321879461
[xharness] Remove debug lock. (#12510)
This accidentally snuck in.
2021-08-23 15:45:02 +02:00
Rolf Bjarne Kvinge 706f18085d
[xharness] Show better error message (#12430) 2021-08-13 15:46:04 +02:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 7b286adb47
[tests] Add a .NET version of framework-test to our test list. (#12373) 2021-08-10 07:40:00 +02:00
Rolf Bjarne Kvinge 013054a48c
[tests] Add .NET version of the fsharp test. (#12359)
Partial fix for https://github.com/xamarin/xamarin-macios/issues/10217.
2021-08-06 09:29:30 +02:00
Rolf Bjarne Kvinge a91e34f01b
[xharness] Automatically inline Imports to a "shared.csproj" when cloning projects. Fixes #12316 and #12277. (#12322)
This way we process the shared.csproj that we use in our .NET test projects.
The main effect is that we'll clone any project references included in the
shared.csproj, which will fix #12316. On another hand, it means that we'll
add/remove defines in referenced projects, which fixes #12277.

It also allows us to put more code in the "shared.csproj" files.

Fixes https://github.com/xamarin/xamarin-macios/issues/12316.
Fixes https://github.com/xamarin/xamarin-macios/issues/12277.
2021-08-04 18:13:02 +02:00
Rolf Bjarne Kvinge 82b1331210 [xharness] Rewrite the 'RootTestsDirectory' property when cloning a project. 2021-07-20 15:54:48 +02:00
Rolf Bjarne Kvinge 18ab7db7c7
[xharness] Fix warning about unknown file wrt default inclusion. (#10438)
Fixes this warning when running xharness:

    Unknown file: fsharplibrary.fsproj (extension: .fsproj). There might be a default inclusion behavior for this file.
2021-01-18 07:28:39 +01:00
Přemek Vysoký 0fba63cdc7
[xharness] Remove Microsoft.DotNet.XHarness.iOS.Shared project and use NuGet instead (#9980) 2020-11-13 11:05:10 -05:00
Manuel de la Pena 7a2573a99b
[Harness] Move all common code to the shared lib. (#8389)
Moved all the code that can be shared with the CLI to the common
library. We neede some small changes, but mainly due to namespaces and a
forgotten interface implemenation (was already implemented, was missing
in the class).

This was fun :)
2020-04-17 18:14:55 -04:00
Manuel de la Pena e0b6ff480c
[Harness] Refactor TestProject to be moved to the common lib. (#8388)
Refactor TestProject so that we can move all the tasks to the common
assembly. We had to remove all the references from Harness, that
included the MonoNativeInfo.
2020-04-16 20:20:53 -04:00
Manuel de la Pena f891076bd8
[Harness] Move to create a more general TestTasks class to be reused. (#8286)
Some of the Jenkins test tasks are very useful and do A LOT of stuff. So
we try to generalize the base class, to later be able to share the most
usebul ones in the shared lib.

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-04-07 20:20:38 -04:00
Přemek Vysoký b14a055265
[Harness] Move code to a shared library (#8234)
- Code that will later be moved to the `dotnet/xharness` repo is first moved to an isolated project before it will be extracted to the new repo and NuGetified
- New project for the shared code and new test project for tests accompanying the moved code are created
- Only Factories are left behind that are used only by XHarness
2020-04-01 13:32:21 -04:00
Přemek Vysoký fbbd5ceede
[Harness] Move Timestamp and TTY utilities to Helpers (#8138)
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
2020-03-18 12:10:25 -04:00
Rolf Bjarne Kvinge f2063efefb
Revert "[Harness] Move utilities out from Harness.cs, refactor AppRunner fields (#8074)" (#8082)
* Revert "[Harness] Refactor simulators and devices listing. (#8064)"

This reverts commit e53b686ef6.

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

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

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

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

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

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

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

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

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

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

* Apply suggestions from code review

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

* Move out utils into a separate namespace

* Move Cache to the test project

* Fix namespaces after merge

* Remove unneeded code

* Move Target files

* Sort csproj

* Refactor Targets

* Rename Cache to TempDirectory

* Fix using

* Move ProjectFileExtensions

* Remove dead code

* Move Extensions

* Add empty StringUtilsTests

* Add StringUtils tests

* Revert refactorings

* Update tests/xharness/Utilities/StringUtils.cs

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

* Update tests/xharness/Utilities/StringUtils.cs

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

* Add better formatarguments test

* Update tests/xharness/Utilities/StringUtils.cs

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

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
Co-authored-by: Premek Vysoky <prvysoky@microsoft.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-03-10 13:12:33 +01:00
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 169cecfe93
[Harness] Refactor a little the code for logging to simplify testing. (#8021)
Move to use interfaces, that will let us later add tests that will
verify that all the correct logging is performed. As an example, added a
test for XmlResultParser that ensures that the failures are correctly
generated. The test uses Moq to pass the different paths to be used and
later be able to verify the wirtten xml.
2020-03-03 13:59:44 -05:00
Manuel de la Pena 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 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
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
Rolf Bjarne Kvinge 303aa0a649 Merge remote-tracking branch 'origin/xcode11' into master-xcode11 2019-09-13 18:35:18 +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 b5dc6201dd [xharness] Move *TestProject.BCLInfo and *TestProject.MonoNativeInfo to their base class. 2019-06-20 10:36:15 +02: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
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
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 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
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
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
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 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
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
Marek Safar 60d08b8559 Merge branch 'master' into mono-2018-10 2018-11-29 13:41:32 +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
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
Martin Baulig 6ff0ddd74c [xharness]: Add xharness support for mono-native. 2018-11-14 13:26:30 -05: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
Chris Hamons 183cb81583
Disable known failing device tests using xharness (#4884)
- Add the ability to have Build Only tests - https://github.com/xamarin/maccore/issues/1076
- Set mini and the extensions as build only
2018-10-03 08:33:30 -05:00
Rolf Bjarne Kvinge 7ddb263e7d
[xharness] Propagate custom defines to referenced projects as well. Fixes maccore #655. (#3615)
The ProtocolTest test is located in the bindings-test assembly, and it
requires certain conditional compilation defines to be set in order to behave
properly.

With this fix we correctly set these defines when cloning the bindings-test
project (in addition to when we set the defines for the main project, which is
either monotouch-test or linkall for this test).

Fixes https://github.com/xamarin/maccore/issues/655.
2018-02-28 21:55:26 +01:00
Rolf Bjarne Kvinge d973192c57
[xharness] All variants of GuiUnit projects must be special-cased. (#3602)
This fixes an issue where multiple copies of the GuiUnit project would have
the same output directory, causing random problems when building those
projects in parallel.
2018-02-27 10:28:42 +01:00
Rolf Bjarne Kvinge 0e66298a15
[xharness] Clone XM projects. (#3427)
* [tests][xammac] Fix a few path calculations to not be hardcoded.

* [xharness] Clone XM projects.

Cloning projects before building them will also clone project references,
which will make it possible to build multiple projects in parallel, when those
projects have common project references.

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

* [xharness] Fix XM project cloning

* Don't clone Classic projects (they're solutions, and xharness doesn't understand them).
* Clonee projects properly when cloning execution tasks.

* [xharness] GuiUnit needs specialized cloning.

The GuiUnit project uses relative paths to write to files outside the project
directory, which means that multiple GuiUnit project files may write to the
same location.

So special-case GuiUnit cloning to make those paths subdirectories of the
project's directory instead.

* [xharness] Process imported targets when cloning projects.

Also make the msbuild-mac's custom targets file independent of the location of
the project file by making all paths relative to the custom targets file.
2018-02-08 14:32:48 +01:00