This script is a quick way to run the XHarness E2E tests. These test are located in tests/integration-tests and require the Arcade and Helix SDK. To run them, you need to invoke these through MSBuild which makes the process a bit cumbersome. This script should make things easier.
* Target .NET 6.0 only
* Adjust README
* Update dependencies from https://github.com/dotnet/arcade build 20210326.2
* Bump the .NET version in the bootstrap script
* Remove CLI version override
* Fix conditional blocks
This removes the SimulatorInstaller project and moves the file to CLI so that you can do:
```
xharness apple simulators list
```
When installing the simulators, it doesn't accept the same format e.g. `ios-simulator-64` of targets as the CLI, this will be a follow-up.
#478
Don't show PASS/SKIP messages by default in the console log, unless verbose logging is enabled in xharness.
We capture all output and store it in the wasm-console.log file in the xharness output directory instead.
Update to new Microsoft.Extensions.Logging version and enable single-line logging
This change introduces platform dependent `ProcessManager` implementations to avoid problems like in #273 (WASM can be run anywhere).
Some notes:
- `MacOSProcessManager` was moved and with it logging had to move as well.
- I couldn't utilize the `Process.Kill(entireProcessTree: true)` because Xamarin is dependent on `netstandard2.1` version of the library (they are on .NET Framework) and this overload doesn't exist, only the one without the param. So tree killing using the `kill` command as it was implemented for Xamarin has to stay as is.
- Logging was improved for cases when processes time out
- I tested on OSX, Windows and Linux that a process can be killed properly
Fixes: #273
A requirement for the WASM command where we need to pass arbitrary arguments to the engine/runner inside and also need to parse some the regular way.
Example:
```
xharness wasm test --enable-gc --assembly=WasmTestRunner.dll --assembly=System.Buffers.Tests.dll -- v8 --expose_wasm runtime.js
```
This will take everything after `--` and store it into `PassThroughArguments` property:
- `v8`
- `--expose_wasm`
- `runtime.js`
And then the rest will be parsed via Options in the Arguments class supplied for this:
```csharp
protected override OptionSet GetTestCommandOptions() => new OptionSet
{
{ "assembly=", v => Assemblies.Add(v) },
{ "enable-gc", _ => EnableGc = true },
};
```
Also contains unit tests for `XHarnessCommand` and `XHarnessCommandArguments`.
The tool is quite simple, yet the code was pretty much spaghetti somehow. I have rewritten it to follow the same Command/Argument structure as the CLI project and also changed the CLI to be the same as rest of dotnet so that now we have these commands:
- `install` - Installs given simulators
- `list` - Lists available simulators
- `find` - Finds whether given simulators are installed and outputs list of missing ones (returns 0 when none missing)
- `help`
I added the `help`:
```
> dotnet simulator-installer help install
usage: install [OPTIONS]
Installs given simulators
-s, --simulator=VALUE ID of the Simulator to install. Repeat multiple
times to define more
--force Install again even if already installed
--xcode=VALUE Path to where Xcode is located, e.g. /Application/
Xcode114.app. If not set, xcode-select is used
to determine the location
--verbosity, -v[=VALUE]
Verbosity level - defaults to 'Information' if not
specified. If passed without value, 'Debug' is
assumed (highest)
--help, -h
```
- Fixed the `--only-check`/`find` mode which got broken because of the Loggers
- Stopped requiring the `--xcode` parameter since we can use `xcode-select` from `ProcessManager`
- Enabled nullability for `ProcessManager`
Create a common library with useful classes to be shared between the
projects. At the moment with just move:
* Base implementation of the ProcessManager and IProccessManager
* ILog interface.
* StringUtilities used by the process manager.
Created the ProcessManager implementation for Mac OS X and a child class
that contains the specific mlaunch class since is very specific for the
iOS xharness case.
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>