Commit Graph
23 Commits
Author SHA1 Message Date
Jo Shields 26000448d2 Enable tests for MacCatalyst x64 (#51139) 2021-05-08 08:30:58 -04:00
Andy GockeandMichal Strehovský 7677f7dc71 Add option for building a test exe as single file (#42972)
* Add option for building a test exe as single file

* Remove left over test

* Add target to exclude references from single-file

* First attempt at adding a CI job

* Opt-in specific libraries for single-file testing support

Start with System.Collections as all tests pass.

* Config testing using single-file in build.cmd

* Change yml suffix name to SingleFile

* Windows_NT_x64 -> windows_x64

* Fix for helix queueing

* Respond to host rename

* Change TargetOS to check for windows

* chmod test exe on linux

* Direct singlefilehost to the locally built copy

* Adjust singlefilehost copy+call

* Add .exe suffix on Windows

* Move libraries after hosts build to allow for libs.test to depend on hosts build

* Split up host and libs packaging and tests

* Move host packaging

* Move pretest up

* Move packages up as well

* Reorder libs pretest and libs.packages

* Add isSingleFile build parameter to limit Linux Helix jobs

* Typo

* Change conditional check

* Fix yml

* Fix yml

* Fix neq

* Fix subsets

* Typo

* Fix

* Adjust assert

* Include code from Michal to skip failing test

* Remove empty ItemGroup

* Update src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs

Co-authored-by: Michal Strehovský <[email protected]>

* Update eng/testing/tests.singlefile.targets

Co-authored-by: Michal Strehovský <[email protected]>

* Apply suggestions from code review

Co-authored-by: Michal Strehovský <[email protected]>

* Use ProjectExclusions

* Update eng/testing/tests.singlefile.targets

Co-authored-by: Michal Strehovský <[email protected]>

* Revert changes

* Remove host build from tests

Co-authored-by: Michal Strehovský <[email protected]>
2021-03-31 18:34:05 +00:00
Jo Shields ded66fc97e Introduce iossimulator RIDs, and convert as needed (#49305)
Previously, we have had four iOS RIDs:

iOS-arm
iOS-arm64
iOS-x86
iOS-x64

Apple has never shipped an iOS device with an x86 or x64 processor. Instead, the x86/x64 RIDs have meant "iOS simulator with these arches" as opposed to "iOS with these arches". Amongst other things, that means building against a DIFFERENT SDK, iPhoneSimulator.platform vs iPhoneOS.platform

In the Apple Silicon future, the iOS simulator is now an ARM64 binary - so we need:

iOS-arm
iOS-arm64
iOS-arm64, but built against the simulator SDK not the device SDK
iOS-x86
iOS-x64
Clearly, there's a problem.

The solution is to move the simulators to a different RID, to avoid the overloading issue:

iOS-arm
iOS-arm64
iOSSimulator-arm64
iOSSimulator-x86
iOSSimulator-x64

This PR introduces the new entries in the RID graph, moves our existing iOS-x{86,64} to iOS-sim-x{86,64}, adds a new iOS-arm64.

The above also applies for tvOS, with a smaller set of OSes:

tvOS-arm64
tvOSSimulator-arm64
tvOSSimulator-x64

Ref: #48216
2021-03-19 12:24:10 -04:00
Ankit JainandMitchell Hwang 8c64e3073e [wasm] Add Wasm.Build tests, for testing wasm app builds (#47683)
* [wasm] Add Wasm.Build tests, for testing wasm app builds

These tests will build wasm test projects, as part of each test method,
and run them.

Other library tests are run with `xharness`, and the test assembly is run
under wasm.  But here we want to run them with xunit, outside wasm. So,
this has different requirements for the helix payload, eg, the sdk,
xunit console runner etc.

To make it work, a new Scenario - `BuildWasmApps` is added, which emits
it's archives in a `buildwasmapps/` folder, which makes it easy to pick
up for the helix test run.

The tests are added under `src/tests/BuildWasmApps/Wasm.Build.Tests`, but
they use `Directory.Build*` from `src/libraries`, similar to how
FunctionalTests do it.

Another use case of this kinda scenario are the wasm debugger tests,
in which the individual test methods launch wasm apps, and then debug
them. (TBD)

Tests:

- The initial set of tests are just proof-of-concept, and more will be
  added once this is merged.

Note: The individual tests build test projects, and then run them with
`xharness`, under `v8`, and Chrome.

* [wasm] Disable il stripping completely

This uses `mono-cil-strip` from a mono installation. And in it's current
form it can cause issues, so disabling it for now.

* Bump helix timeout for tests from 30m to 60m

* [wasm] Cleanup builing RunScriptCommand

.. this allows supporting other properties from xunit*targets, eg. to
run a particular test `$(XUnitMethodName)`, which adds `-method foobar`
to the command line.

* [wasm] Fix timeout string, 00:60:00 to 01:00:00

* [wasm] Fix path to build support dir

* cleanup

* [wasm] fix InvariantGlobalization test

* [wasm] cleanup Wasm.Build.Tests.csproj

* [wasm] Add `include_aot` param for the test data

* [wasm] Enable verbose output for xunit

Instead of writing all the output to stdout also, use `-verbose` which
gives output like:

```
      Wasm.Build.Tests.WasmBuildAppTest.InvariantGlobalization(config: "Debug", aot: False, invariantGlobalization: null) [STARTING]
  ============== wasm test =============
  ============== wasm test-browser =============
      Wasm.Build.Tests.WasmBuildAppTest.InvariantGlobalization(config: "Debug", aot: False, invariantGlobalization: null) [FINISHED] Time: 8.6357275s
```

We log the detailed output to files anyway.

* [wasm] fix tests

* [wasm] Really enable verbose output for xunit, this time

* [wasm] Update tests to track the xharness fix for expected-exit-code

* [wasm] Bump browser job's timeout from 120 to 180 mins

* Improve comment

Co-authored-by: Mitchell Hwang <[email protected]>

* Update eng/testing/tests.mobile.targets

Co-authored-by: Mitchell Hwang <[email protected]>

* Remove unrelated commit

Instead, this is moved to a different AOT PR.

Revert "[wasm] Disable il stripping completely"

This reverts commit 25c2340a636be7d8973c09b6808a20466fdcd296.

* Revert "Remove unrelated commit"

This is needed because `mono-cil-strip` isn't available on helix. And we
want to disable cil stripping anyway.

This reverts commit ead13ee3d9c6d53a22b3c3051542057373c77b31.

Co-authored-by: Mitchell Hwang <[email protected]>
2021-03-09 14:01:38 -05:00
1e6826a8ff [wasm] Standup EnableAgressiveTrimming for library tests (#46367)
* Trim wasm library tests

* Add SystemBuffers HelloTest and only test that

* Import linker from nuget to override sdk linker

* Remove redundant assembly inclusions

* Add WasmTestRunner referenced assemblies

* Add properties to reduce library size

* Updates

* Configure trimming for library tests

* Link assemblies except for test assembly

* Use another path to WasmTestRunner.dll

* Fix typo

* Setup correctly rooted assemblies

* Don't copy WasmTestRunner.dll from wrong patch when using linker

* Don't inflate publish output with packages which are not used for tests runs

* Fix xunit framework files copying to publish location to not overwrite
version copied as part of trimming publish

* Add linker descriptor for xunit code which linker cannot track

* Add tested assembly to the test payload closure

* One more method to preserve

* Preserving some xunit types to make sure we can actually discover the tests

* Put Wasm.targets import in the right spot

* Add a mode where we can run the regular system.buffers tests

* Dont link out Microsoft.DotNet.RemoteExecutor

* Move Microsoft.DotNet.RemoteExecutor inclusion to xml

* Consolidate ConfigureTrimming itemgroups

* Build PrepareForWasmBuildApp before WasmBuildApp

* Remove manual import of WasmTestRunner assemblies

* Remove temporary HelloTest from System.Buffers

* Added flag to not aggressively link by default

* Revert import and build order changes

* Condition trimming related changes on EnableAggressiveTrimming

* Revert "Don't copy WasmTestRunner.dll from wrong patch when using linker" as MainAssembly is back to $(PublishDir)\WasmTestRunner.dll
This reverts commit 79dc240f4c99f61af1a7e4c98d299be25f8f854e.

* Add comment to note temporary RemoteExecutor assembly inclusion

* Move props from general tests to mobile tests

* Revert "Condition trimming related changes on EnableAggressiveTrimming"

This reverts commit a97fb56eeb47522a4af1e7e47acd3595cf48271e.

* Broaden trimming options for all mobile targets

* Enable PublishTrimmed regardless of OS when aggressively trimming

* Move trimming specific property to ConfigureTrimming

* Import NuGet linker in mobile tests by default

* Add file description

* Add detail to ILLink XML descriptor file

* Reformat ConfigureTrimming target tag

* Fix typo

Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Steve Pfister <[email protected]>
Co-authored-by: Marek Safar <[email protected]>
2021-01-04 16:21:55 -05:00
Alexander Köplinger d447b8e28f Fix wrong XHARNESS_CLI_COMMAND in wasm README and simplify scripts (#46294)
* Fix wrong XHARNESS_CLI_COMMAND in wasm README

The variable is actually `XHARNESS_CLI_PATH`. Also added it to the AppleRunnerTemplate.sh script since it was missing there.

* Add note about usage for Android/AppleRunnerTemplate.sh scripts

Also simplify the iOS/Android scripts a bit.
2020-12-22 01:28:25 +01:00
Viktor Hofer c9682e515b Remove NETStandard2.2 versions and product dependency (#43304)
* Remove NetStandard2.2 versions and product dependency
2020-11-30 23:35:12 +01:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Viktor Hofer 49fe9460fc Fix double-writes in test projects (#39778)
* Fix double-writes in test projects
2020-07-22 20:15:17 +02:00
Jo Shields a9263454b0 Run wasm tests on Helix (#37752)
Build Wasm for testing via Helix. A bunch of test suites are disabled on Wasm here, and will be re-enabled as we get the up and running.
2020-06-25 14:30:13 -04:00
Viktor Hofer c392d84ba6 Update xunit.runner.visualstudio (#37317)
* Update xunit.runner.visualstudio

Updating the xunit VS runner to honor default filters specified in a runsettings file. This will filter out ActiveIssue / failing tests in VS Test Explorer.
2020-06-04 22:05:48 +02:00
Viktor Hofer 9b5805f9da Remove TargetFramework reads in eng/testing (#35954) 2020-05-07 22:43:49 +02:00
Stephen Toub 0383079f5c Disable preEnumerateTheories for running tests (#35837) 2020-05-05 16:58:29 +00:00
Anirudh Agnihotry 0ac72ac366 Remove TargetsNet* from the runtime repo (#35589)
* feedbacl from previous time

* remove TargetsNet* from ItemGroup

* removing targetFramework from .targets
2020-05-04 17:12:23 +02:00
Viktor Hofer 200b197559 Enable dotnet test in libraries (#35285)
* Enable dotnet test

* Update docs

* Use vstest in F5 scenarios

* Make dotnet test without framework switch work

* Code cleanup

* Only run code coverage conditionally

* Fix F5 condition for netcoreapp

* Downgrade sdk to check for helix submission failures

* Fix wrong conditions

* Add blame data collector
2020-05-04 11:57:51 +02:00
Viktor Hofer 7eaa8b1ff7 Stop passing in auto-discovered xunit traits (#35237)
* Stop passing in auto-discovered xunit traits

With https://github.com/dotnet/arcade/pull/5314, framework and platform
traits don't need to be passed in manually anymore. Also removing the
obsolete vstest.runner.json as it isn't needed for VSTest.
2020-04-22 14:43:31 +02:00
Jan Kotas 19c7f5a704 Rename ArchGroup -> TargetArchitecture (#34260)
Most places use TargetArchitecture already. These two properties seems to be always set to the same value.
2020-03-29 17:20:20 -07:00
Viktor Hofer 4a55b463e7 Make VSTest runner work and enable html log (#33915)
The VSTest runner is now supposed to work with the /p:TestRunner=vstest
switch. Currently this is an opt-in but the desire is to get rid of
xunit.console completely and just use VSTest.
2020-03-26 14:36:40 +01:00
Viktor Hofer 5ae8360d12 Fix test property evaluation on netfx vertical (#1715)
When running on netfx vertical there's a chance that the `XunitConsoleNetCore21AppPath` property which is defined in https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.XUnitConsoleRunner/src/build/Microsoft.DotNet.XUnitConsoleRunner.props#L4 isn't available because the packages isn't restored / imported. Guarding against that by checking if the property is set.
2020-01-14 20:05:57 +01:00
Viktor Hofer c2d89a824a Remove usage of TargetGroup where possible (#899)
In non-infra related paths we don't need to check on TargetGroup anymore
and can instead use the well-known TargetFramework property.
2019-12-16 19:36:55 +01:00
Anirudh Agnihotry 3b9abae5aa Removing "netcoreapp" and "netfx" TargetGroup (#457)
* netcoreapp -> netcoreapp5.0 in .sln files

* netcoreapp; -> netcoreapp5.0;  , netcoreapp- to netcoreapp5.0-

* netcoreapp- -> netcoreapp5.0 in .csproj

* 'netcoreapp -> 'netcoreapp5.0 in .csproj

* done with libraries sub folder

* missed semicolon

* minor changes

* netcoreapp -> netcoreapp5.0 in some extra files

* vNext target variable in configurations.props

* netcoreapp => netcoreapp5/0 in some other .props file

* netcoreapp -> vnext in .csproj

* making the netcorepap framework switch work

* fixing sendToHelix and linux build

* TargetFrameworkVNext -> netcoreappCurrent

* case correct netcoreappcurrent

* fixing send to helix zip path

* netfx -> net472 in .sln

* netfx; -> net472; in .props

* netfx- -> net472- in .props

* netfx - -> net472- in .csproj

* 'netfx-> 'net472 in .csproj

* netfx -> net472 manual change

* fixing ci build for netfx

* Not trying to change the global property

* Fixing build failure due to master changes in net https tests

* adding documentaiton and fixing filtering

* netcoreapp -> netcore5.0 in py file

* changing the path to use netcoreapp5.0 version

* feedback and override corefx path corrected in installers

* remaing netcoreapp5.0 changes done

* netcoreapp-> netcoreapp5.0 after live builds

* net472 -> netframeworkcurrent
2019-12-14 12:22:29 -08:00
Viktor Hofer 859926f4c3 Change ArchiveTest reads to FixArchiveTests (#511)
With 1d5de1533a, the ArchiveTest property
was removed. This fixes the remaining places where the old property is
still read. Additionally this introduces a new property `IgnoreForCI`
which is consistent with the xunit trait to skip the whole assembly for
CI testing.
2019-12-04 19:58:24 +01:00
Viktor Hofer 1d5de1533a Libraries testing (#178)
* Add Libraries Testing framework package as inline

The existing package Microsoft.DotNet.CoreFxTesting lived in Arcade
because of no infrastructure being available to compile local tasks in
the repository. As the runtime repository now offers that we can inline
the testing framework.

* Hardcode configuration for installer.tasks

* Update ReportGenerator global tool version

* Add vstest support

* Update binary serialization blobs
2019-11-21 23:13:26 +01:00