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

1068 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c0bd03b09f
[xharness] The dotnet version of introspection/iOS 10.3 works fine now. (#9728) 2020-09-30 08:21:52 +02:00
Rolf Bjarne Kvinge 5c113d225d
[xharness] Only run xammac variations if macOS tests are included. (#9729)
This fixes a build error with a xammac test variation that is executed even if
the macOS build is disabled.
2020-09-30 08:21:24 +02:00
Rolf Bjarne Kvinge b111ce0e5c
[dotnet-linker] Add a CollectUnmarkedMembersStep that will keep linked away types around for the static registrar. (#9722)
The static registrar may need access to types that have been linked away, so
store unmarked types so that the static registrar can access them later.

This also makes all the monotouch-test variations green, so enable them all.

Fixes this monotouch-test when all optimizations are enabled:

    MonoTouchFixtures.ObjCRuntime.RegistrarTest
        [FAIL] TestProtocolRegistration :   UIApplicationDelegate/17669
            Expected: True
            But was:  False
                at MonoTouchFixtures.ObjCRuntime.RegistrarTest.TestProtocolRegistration() in xamarin-macios/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs:line 1350
2020-09-29 16:41:47 +02:00
Rolf Bjarne Kvinge 5aed65d45e
[xharness] Fix rendering human-readable results for parameterized tests. Fixes #9400. (#9704)
We weren't probably parsing nested test-suite elements in the xml, so
implement parsing of test-suite elements using recursion, which is easier and
less error-prone (and turns out to work fine too).

Also use TextReader/Writer instead of StreamReader/Writer in a few places.
This makes it easier to write tests, since TextReader/Writer can use in-memory
streams (no need to mess with temporary files).

Fixes https://github.com/xamarin/xamarin-macios/issues/9400.
2020-09-25 19:18:37 +02:00
Manuel de la Pena 764734d20a
[Main][Xcode12] Add support for Xcode 12 2020-09-25 12:58:29 -04:00
Rolf Bjarne Kvinge 5ced9ee978
[xharness] Use XmlReaderSettings to ignore stuff we don't care about when parsing xml. (#9703)
At the very least this makes stepping through code while debugging much
faster, since stepping through whitespace and comments is useless.
2020-09-25 18:17:47 +02:00
Rolf Bjarne Kvinge 3b38f2242e
[xharness] Fix typo in test case creating two identical test cases. (#9702) 2020-09-25 17:30:04 +02:00
Manuel de la Pena dcb0c93ab0 [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Rolf Bjarne Kvinge 39e3184f02
[src] Build the .NET version of our product assemblies using a .NET 5 BCL. (#9637)
* [src] Build the .NET version of our product assemblies using a .NET 5 BCL.

We're not shipping the .NET product assemblies in any stable release, so we
can use a preview version of the .NET 5 BCL.

Also:

* Add all the nuget feeds we need to the top-level NuGet.config, even for .NET
  5/6, there shouldn't be any conflicts with stable feeds since we use exact
  version numbers.

* Generate a top-level global5.json which is copied to every directory that
  needs a .NET 5 global.json (overriding the .NET 3.1 global.json in the root
  directory).

* Use the expected dotnet binary during our local build.

* [tests] Fix the bgen tests to use .NET 5.

* [xharness] Set the current directory to the project directory when running .NET tests.

This way we end up using the dotnet version that's configured in global.json for the tests.
2020-09-21 13:22:44 +02:00
Manuel de la Pena eb9b690fe0 Merge xcode12 into d16-8. 2020-09-18 17:51:52 -04:00
Rolf Bjarne Kvinge 1463967d00
[xharness] Skip the 'dont link / AssemblyBuildTarget: SDK framework (release)' variation by default for tvOS. Fixes #xamarin/maccore@2282. (#9659)
This test variation ends up being too big (1.5 GB), so it doesn't install
properly and the app crashes at startup.

So just skip it.

Fixes https://github.com/xamarin/maccore/issues/2282.
2020-09-18 09:08:32 +02:00
Alex Soto 8383b14382
[xcode12] Rename master to main (#9631)
* Fix links that point to master to point to main instead.
* Implement support in the sample tester for specifying the default branch for
  each sample repo.
* Fix various text / documentation to say 'main' instead of 'master.'
* Push to 'main' instead of 'master' in xamarin-macios-data.
* Fix xharness to make 'main' the special branch with regards to documentation tests as opposed to 'master'.
* Fix various CI to use 'main' instead of 'master'.

This is a backport of PR #9561
2020-09-15 07:09:29 -04:00
Rolf Bjarne Kvinge 4915566c46
[xharness] The linkall tests are green for .NET/Release now. (#9629) 2020-09-14 19:16:13 +02:00
Rolf Bjarne Kvinge 1a582ed59a
[tests] Ignore a few link sdk tests in .NET for now. (#9614)
There are easier fish to fry right now, so implementing the linker support for
these tests to pass (metadata reduction and code removal) can wait.

This makes the link sdk/Release variation green for .NET.

Ref: https://github.com/xamarin/xamarin-macios/issues/9612
Ref: https://github.com/xamarin/xamarin-macios/issues/9613
2020-09-10 16:01:19 +02:00
Rolf Bjarne Kvinge a2d50c7d19
[xharness] Add support for adding PropertyGroups if none are applicable when adding a property. (#9616)
Some .NET test projects (monotouch-test) require this to set properties for
some test variations, and .NET projects are quite minimal, making it likely
that they won't have a particular property that needs to be set/modified.

This makes it possible to execute the various monotouch-test variations for
.NET in xharness (some of the variations still fail though, so they're still
ignored by default).
2020-09-10 15:09:51 +02:00
Rolf Bjarne Kvinge eb5206f082
[dotnet-linker] Add OptimizeGeneratedCodeSubStep into the pipeline. (#9608)
Fixes these linkall tests:

    Linker.Shared.OptimizeGeneratedCodeTest
        [FAIL] IsARM64CallingConvention :   optimized: no ldsfld instruction
        Expected: 0
        But was:  1
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.IsARM64CallingConvention() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 527
    
    [FAIL] SetupBlockPerfTest :   At least 6x speedup
        Expected: greater than 6
        But was:  1.0876440665344851d
            at Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlockPerfTest() in /Users/rolf/work/maccore/main/xamarin-macios/tests/linker/BaseOptimizeGeneratedCodeTest.cs:line 120

And linkall is now green for .NET/Debug.
2020-09-10 08:30:45 +02:00
Rolf Bjarne Kvinge 941d65f016
[dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration. (#9599)
* [dotnet] Pass the Optimize flags from the extra bundler arguments to the linker configuration.

Also call Application.InitializeCommon to initialize the application instance. The
important part here is that InitializeCommon calls Optimizations.Initialize to compute
the default optimizations. It also calls Set*ExceptionMode and sets the default EnableCoopGC
value (so we don't need to call/set those anymore), and it does a few other initialization
tasks which we don't need yet, but eventually will.

And finally remember to parse the bundler arguments before using them in the dotnet
build logic. How did this not cause problems before? 🤦

* [tests] Set the verbosity using the additional args instead of an internal variable.

The internal _BundlerVerbosity variable is overwritten now (with the verbosity
value from the additional args).

* [xharness] Disable tvOS generation for the introspection/.NET test, it incorrect and needs fixing.
2020-09-09 14:52:46 +02:00
Rolf Bjarne Kvinge d2788511b6
[dotnet] Use net5.0-[ios|tvos|watchos|macos] TargetFrameworks. (#9532)
* [dotnet] Set TargetPlatformSupported when the right TargetPlatformIdentifier is used.

* [dotnet] Generate a list of valid OS versions for each platform, and add it to the SupportedTargetPlatform item group.

The generated files: https://gist.github.com/rolfbjarne/765c4e4b38b1b017380c9378d9666317

* [dotnet] Define and set the default platform version if it's not set in the TargetFramework variable.

* [dotnet] Switch to using the new-style TargetFramework values.

This includes bumping spouliot/Touch.Unit to get new-style TargetFramework values for Touch.Client.

* spouliot/Touch.Unit@89afaf7 [Touch.Client] Use the right TargetFrameworks for watchOS and macOS as well. (#92)
* spouliot/Touch.Unit@fd0e576 [Touch.Client] Use the right TargetFrameworks. (#91)
* spouliot/Touch.Unit@40f47db [Touch.Client] Add a macOS and watchOS version for .NET. (#90)
* spouliot/Touch.Unit@1d4b8c0 Add .gitignore for NuGet.config and global.json. (#89)
* spouliot/Touch.Unit@49441f3 Call `mlaunch` instead of `mtouch` (#88)
* spouliot/Touch.Unit@b157cf4 Fix a few markdown issues found by markdownlint. (#87)

Diff: d7f55a6167..89afaf7e05

* [dotnet] Document the script that generates the lists of the target platform versions a little bit better.

* [dotnet] Make the [Platform]SupportedTargetPlatform variables public.

This matches how Android and Windows do it:

* https://github.com/xamarin/xamarin-android/pull/5007
* 18ee4eac8b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.WindowsSupportedTargetPlatforms.props

* [xharness] Update the TargetFramework value when creating project variations.
2020-08-31 09:27:19 +02:00
Rolf Bjarne Kvinge 48090369db
[xharness] Enable the .NET tests when a file containing 'dotnet' is modified. (#9510)
* [xharness] Enable the .NET tests when a file containing 'dotnet' is modified.

This also required adding support for using regex as file names when selecting
which tests to run.

* Remove redundant dotnet prefix.

* [xharness] Rename variables to match usage.
2020-08-27 19:15:56 +02:00
Rolf Bjarne Kvinge e77a737c08
[xharness] Enable monotouch-test/.NET by default, but ignore all variations. (#9526)
* [xharness] Enable monotouch-test/.NET by default, but ignore all variations.

The default (Debug) configuration is green now, but the rest of the variations aren't yet.

* [tests] Ignore LocaleTest.InitRegionInfo in .NET because it needs globalization data.

Ref: https://github.com/xamarin/xamarin-macios/issues/8906

I can't reproduce locally, because it's ignored for me:

    [INCONCLUSIVE] InitRegionInfo : You can construct locale without countries
        at MonoTouchFixtures.Foundation.LocaleTest.InitRegionInfo() in [...]/xamarin-macios/tests/monotouch-test/Foundation/LocaleTest.cs:line 47

but this should fix this monotouch-test test failure (I'm guessing that 'IV'
stands for 'Invariant', which is all the current .NET version ships with):

    MonoTouchFixtures.Foundation.LocaleTest
        [FAIL] InitRegionInfo :   Name
            String lengths are both 2. Strings differ at index 0.
            Expected: "US"
            But was:  "IV"
            -----------^
                 :    at MonoTouchFixtures.Foundation.LocaleTest.InitRegionInfo() in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/monotouch-test/Foundation/LocaleTest.cs:line 49
2020-08-27 16:54:08 +02:00
Rolf Bjarne Kvinge a65ff94b4c
[xharness] Use the local 'ignore' variable instead of fetching 'test.TestProject.Ignore' for every test when generating test variations. (#9518) 2020-08-27 08:27:47 +02:00
Rolf Bjarne Kvinge 30b1a8acbd
[tests] Port link all to .NET (#9515)
* [tests] Port link all to .NET

* [tests] Exclude link all tests in .NET that reference OpenTK-1.0.dll

OpenTK-1.0.dll isn't supported yet.

* [tests] Exclude link all tests using API that isn't available anymore in .NET.
2020-08-27 08:07:50 +02:00
Rolf Bjarne Kvinge 09e3631cb1 [xharness] link sdk is now green on .NET!
At least the Debug configuration is, there's still a test failure in the Release
configuration, so skip that for now.
2020-08-26 10:05:21 +02:00
Rolf Bjarne Kvinge 809a12647f [tests] Port link sdk to .NET 2020-08-26 09:58:47 +02:00
Rolf Bjarne Kvinge ebbd1e6738 [xharness] don't link is now green on .NET! 2020-08-25 18:18:34 +02:00
Rolf Bjarne Kvinge 9eab011a4b
[tests] Port dont link to .NET (#9488)
There are a few test failures, so it's ignored by default in xharness for now.
2020-08-25 17:04:01 +02:00
Rolf Bjarne Kvinge ccdd577f9f
[xharness] Process '$(RootTestsDirectory)' before bailing due to any other variables when resolving paths in project files. (#9467)
While keeping '$(RootTestsDirectory)' as-is works fine when building the
project using MSBuild, xharness itself may end up encountering it (in
particular when listing referenced projects), and at that point will end up
confused. So just always resolve '$(RootTestsDirectory)' to the actual
directory to keep other parts of xharness happy.

Fixes this problem (as seen in PR #9460):

    Harness exception for 'interdependent-binding-projects': System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/external/Touch.Unit/Touch.Client/dotnet/iOS/Touch.Client-iOS.dotnet.csproj".
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0015e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:223
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:149
        at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.IO/FileStream.cs:86
        at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess)
        at Microsoft.DotNet.XHarness.iOS.Shared.Utilities.PListExtensions.LoadWithoutNetworkAccess (System.Xml.XmlDocument doc, System.String filename) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Utilities/PlistExtensions.cs:17
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x0010c] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:98
        at Microsoft.DotNet.XHarness.iOS.Shared.TestProject.CreateCopyAsync (Microsoft.DotNet.XHarness.iOS.Shared.Logging.ILog log, Microsoft.DotNet.XHarness.iOS.Shared.Execution.IProcessManager processManager, Microsoft.DotNet.XHarness.iOS.Shared.Tasks.ITestTask test, System.String rootDirectory, System.Collections.Generic.Dictionary`2[TKey,TValue] allProjectReferences) [0x00811] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/TestProject.cs:168
        at Microsoft.DotNet.XHarness.iOS.Shared.Tasks.TestTasks.RunInternalAsync () [0x00117] in /Users/builder/jenkins/workspace/xamarin-macios-pr-builder/tests/xharness/Microsoft.DotNet.XHarness.iOS.Shared/Tasks/TestTask.cs:274
2020-08-24 17:48:59 +02:00
Rolf Bjarne Kvinge 04866dd0b7 [xharness] Improve resolving paths in project files.
* Properties may contain a list of files, separated by semi-colon, so if we find
  any semi-colons, treat each entry as a separate path.

* Treat anything that starts with a variable as a full path, because either the
  variable is a full path, or it will be updated according to the new project location
  and resolve correctly.
2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge b2ad96ec40 [xharness] Add monotouch-test to the .NET lineup. 2020-08-21 18:47:33 +02:00
Rolf Bjarne Kvinge 64641f66e8 [xharness] Make it possible to make a project ignored by default from its initial definition.
Make it possible to make a project ignored by default from its initial definition,
and which takes precedence over any other selection criteria.

This way it's possible to make the .NET version of monotouch-test show up in the
web view, which makes it runnable locally (for testing), while at the same time it
will never be run on CI.
2020-08-21 18:47:33 +02:00
Manuel de la Pena dbaaa51786 [Harness] Use readers over paths. (#8534)
As issue https://github.com/xamarin/xamarin-macios/issues/8533 states,
not all loggers support the BullPath property, all of them do support
the GetReader one. We move the creation of the failures to use the
readers and reduce the chances of getting an exception.

fixes: https://github.com/xamarin/xamarin-macios/issues/8533
2020-08-20 21:35:03 -04:00
Rolf Bjarne Kvinge b0efe7356c [xharness] Don't replace existing files, instead add new files, when providing human-readable logs. (#9123)
This makes understanding what's going on much easier.
2020-08-20 21:32:57 -04:00
Rolf Bjarne Kvinge 1faa7447a5 [xharness] Don't try to write cleaned xml into the same file as the dirty xml was. (#9122) 2020-08-20 21:30:59 -04:00
Sebastien Pouliot d81c3dd517
[xharness] Make monotouch-test (all optimization) aware of IncludesiOS32 (#9401)
Only happens on internal Jenkins
ref: https://github.com/xamarin/maccore/issues/2284
2020-08-20 14:44:52 -04:00
Rolf Bjarne Kvinge 558af9612a [dotnet] Add support for consuming binding projects. (#9376)
* Port the interdependent-binding-projects test to .NET (it's the simplest
  test project we have with binding projects).
* Add a lot of the shared source code for mtouch/mmp to dotnet-linker, and
  make it compile. Most issues were fixed by adding a few stubbed out classes,
  since there are large chunks of the mtouch/mmp code we're not using yet, so
  stubbing out while things are being implemented works fine.
* Add a step in dotnet-linker for loading the linker output (the linked
  assemblies) into our bundler code.
* Add another step in dotnet-linker to extract native resources from binding
  libraries.
* Augment the build process to take into account the native resources we found
  in any binding libraries.
2020-08-20 08:35:12 +02:00
Rolf Bjarne Kvinge 695ca8d680 [xharness] Don't clone the same project multiple times when reached through different project references.
Problem:

1. interdependent-binding-project references binding-test and bindings-test2.
2. bindings-test2 references bindings-test.

This means bindings-test is reached through 2 projects: both
interdependent-binding-projects and bindings-test2, and previously we'd
process each of these references separately, effectively making two separate
clones of the bindings-test project.

Instead keep track of all referenced projects from the leaf project, and if we
encounter a project we've already cloned, use that directly.
2020-08-18 15:22:24 +02:00
Rolf Bjarne Kvinge 138ebc7288 [xharness] Bump timeout for the .NET tests.
More tests take longer to run!
2020-08-17 19:59:05 +02:00
Rolf Bjarne Kvinge ea30bc9cea [xharness] Make sure MSBUILD_EXE_PATH is not set when executing dotnet.
Something ends up confused, and dotnet hangs.
2020-08-17 11:09:06 +02:00
Přemek Vysoký b1f7bd44d9
[xharness] Do not mark DeviceLoaders as loaded when loading fails (#9367) 2020-08-17 08:27:48 +02:00
Rolf Bjarne Kvinge 9fddbbda58 [xharness] Enhance ResolveAllPaths to understand $(RootTestsDirectory).
This requires passing the root directory around in multiple places, since ResolveAllPaths
doesn't have access to the static class where we define the root directory.

Also call ResolveAllPaths in a few more places to ensure paths everywhere are resolved.
2020-08-14 18:33:29 +02:00
Rolf Bjarne Kvinge 5a5a53e1a9 [xharness] Add the .NET version of interdependent-binding-projects to our lineup 2020-08-14 18:33:28 +02:00
Rolf Bjarne Kvinge b28997fa8a
[xharness] Add support for getting the default AssemblyName for projects. (#9369)
In .NET projects there's a default value for most properties, which means that
there won't necessarily be an AssemblyName property in a csproj. We need to know the
AssemblyName, so calculate it from the csproj filename (which is how .NET does it).

This turned out slighly complicated, because we're pass an XmlDocument around,
and the XmlDocument doesn't know the file from where it was loaded, so we need
to keep that information separately.
2020-08-14 10:32:23 +02:00
Rolf Bjarne Kvinge d36853c8cd
[xharness] Add support for adding PropertyGroups for unknown platform/configuration values in a csproj. Fixes xamarin/maccore@2277. (#9347)
Fixes https://github.com/xamarin/maccore/issues/2277.
2020-08-12 10:35:18 +02:00
Rolf Bjarne Kvinge 200608ce77
[xharness] Look at the exact NUnit version an NUnit project is referencing to figure out how to run it in a makefile. (#9322) 2020-08-10 10:47:45 +02:00
Rolf Bjarne Kvinge f2b8dc3d48
[xharness] Make it possible to include .NET tests by setting a label. (#9298)
This also means that setting 'run-all-tests' enables the .NET tests, which
means they'll now start running on internal Jenkins (as was the intention from
the beginning).
2020-08-07 07:59:14 +02:00
Manuel de la Pena f147fe91cf
[Harness] Fix some typos. (#9303) 2020-08-06 17:37:57 -04:00
Manuel de la Pena 90bf04f608
Remove wrongly added dir. (#9301)
Someone (Manuel) uses an IDE that uses .idea to store user settings and
that got added by accident.
2020-08-06 16:35:26 -04:00
Manuel de la Pena 3348ad244c [Harness] Add support to create tunnels. (#8446)
* [Harness] Add support to create tunnels.

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

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

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

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

Rather than tryingt o find a hacky way to re-use the tunnel, lets KISS
and if we need to hack that, do it as an enhancement.
2020-08-05 18:54:43 -04:00
Manuel de la Pena 5616caa302 [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-08-05 18:52:39 -04:00
Manuel de la Pena d4af4e8ae5 [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-08-05 18:52:21 -04:00