Code Monkey home page Code Monkey logo

xharness's Introduction

XHarness

This repo contains the code to build the XHarness dotnet tool and a TestRunner library that makes running unit tests in mobile platforms easier.

What is XHarness

XHarness is primarily a command line tool that enables running xUnit like tests on Android, Apple iOS / tvOS / WatchOS / xrOS / Mac Catalyst, WASI and desktop browsers (WASM). It can

  • locate devices/emulators
  • install a given application, run it and collect results uninstalling it after,
  • perform the operations above as part of one command or separately if need be,
  • handle application crashes by collecting crash dumps (symbolicate),
  • use different types of connection modes (network, USB cable),
  • output test results in various different formats from text to xUnit/NUnit XML
  • install Apple Simulator runtimes (different versions of iOS, tvOS...).

System requirements

The tool requires .NET 6 or later to be run. It is packaged as a dotnet tool command and can be installed using the dotnet tool CLI.

  • The Apple scenarios require you to run the tool on MacOS with full Xcode installation
  • Android scenarios are supported on Linux, macOS and Windows systems
  • Browsers scenarios are supported on Linux systems

Try the tool out quickly

If you want to test the tool quickly, following script will install the required .NET SDK and the XHarness tool locally in the current folder.

# Using bash on Linux/MacOS
curl -L https://aka.ms/get-xharness | bash -
# Using PowerShell on Windows
iex ((New-Object System.Net.WebClient).DownloadString('https://aka.ms/get-xharness-ps1'))

You can delete the folder after you're done, nothing is installed in your system.

Installation and usage

To install the latest version of the tool run (in bash):

dotnet tool install Microsoft.DotNet.XHarness.CLI                                                   \
    --global                                                                                        \
    --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json \
    --version "9.0.0-prerelease*"

Or run (in PowerShell):

dotnet tool install Microsoft.DotNet.XHarness.CLI                                                   `
    --global                                                                                        `
    --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json `
    --version "9.0.0-prerelease*"

You can get a specific version from the dotnet-eng feed where it is published. So far, we are in preview so omitting the version will fail to locate a stable version of the tool and fail the installation so a specific version has to be supplied.

To run the tool, use the xharness command. The tool returns one of the exit codes listed here (ExitCode.cs). The tool always expects the platform (android/apple/browser) followed by a command. To get an up-to-date set of commands, please run xharness help.

Applications run via the apple test command require a TestRunner inside of the iOS/tvOS app bundle to work properly. The apple run command, on the other hand, doesn't expect the TestRunner and only runs the application and tries to detect the exit code. Detection of exit code might not work across different iOS versions reliably.

* See the Test Runners section.

Example:

xharness android state

To list all the possible commands, use the help command:

xharness help

To get help for a specific command or sub-command, run:

xharness help apple
xharness help apple test

Other settings

There are other settings which can be controlled via environmental variables and are primarily meant for build pipeline scenarios:

  • XHARNESS_DISABLE_COLORED_OUTPUT - disable colored logging so that control characters are not making the logs hard to read
  • XHARNESS_LOG_WITH_TIMESTAMPS - enable timestamps for logging
  • XHARNESS_LOG_TEST_START - log test start messages, useful to diagnose when tests are hanging. Currently only works for WebAssembly
  • XHARNESS_MLAUNCH_PATH - local path to the mlaunch binary when developing XHarness (when not using as .NET tool)

Arcade/Helix integration

In case your repository is onboarded into Arcade you can use the Arcade Helix SDK to run XHarness jobs over Helix. More on how to do that is described here.

Examples

To run an iOS/tvOS app bundle on a 64bit iPhone Simulator:

xharness apple test           \
    --app=/path/to/an.app     \
    --output-directory=out    \
    --target=ios-simulator-64

or the same can be achieved via the shorthand versions of the same options:

xharness apple test -a=/path/to/an.app -o=out -t=ios-simulator-64

The out dir will then contain log files such as these:

iPhone X (iOS 13.3) - created by xharness.log   # logs from the Simulator
test-Simulator_iOS64.log                        # logs from the tool itself
test-ios-simulator-64-20200430_025916.xml       # test results in XML format

Example for Android apk:

xharness android test                                    \
    --output-directory=out                               \
    --package-name=net.dot.System.Numerics.Vectors.Tests \
    --app=/path/to/test.apk

Output directory will have a file with dump from logcat and a file with tests results.

Test Runners

The repository also contains several TestRunners which are libraries that can be bundled inside of the application and execute the tests. The TestRunner detects and executes unit tests inside of the application. It also connects to XHarness over TCP connection from within the running app bundle and reports test run results/state.

There is a library Microsoft.DotNet.XHarness.DefaultAndroidEntryPoint.Xunit that provides default logic for Android test app entry point. It is possible to use DefaultAndroidEntryPoint from there for the test app by providing only test result path and test assemblies. Other parameters can be overrided as well if needed.

Currently we support Xunit and NUnit test assemblies but the Microsoft.DotNet.XHarness.Tests.Runners supports implementation of custom runner too.

Development instructions

When working on XHarness, there are couple of neat hacks that can improve the inner loop. The repository can either be built using regular .NET, assuming you have new enough version:

dotnet build XHarness.sln

or you can use the build scripts build.sh or Build.cmd in repository root which will install the correct .NET SDK into the .dotnet folder. You can then use

./.dotnet/dotnet build XHarness.sln

You can also use Visual Studio 2019+ and just F5 the Microsoft.DotNet.XHarness.CLI project.

ADB, mlaunch

In order for XHarness to work, you will need ADB (for Android) and mlaunch (for anything Apple). These are executables that go with the packaged .NET xharness tool.

The easiest way to get these at the moment for development purposes is to build the CLI project and they will be downloaded.

dotnet build src/Microsoft.DotNet.XHarness.CLI/Microsoft.DotNet.XHarness.CLI.csproj

You can then find these dependencies in artifacts/obj/Microsoft.DotNet.XHarness.CLI/.

For iOS flows, you can further store the path to mlaunch to an environmental variable XHARNESS_MLAUNCH_PATH

export XHARNESS_MLAUNCH_PATH='[xharness root]/artifacts/obj/Microsoft.DotNet.XHarness.CLI/mlaunch/bin/mlaunch'

and you won't have to specify the --mlaunch argument.

Running E2E tests

In case you want to test your changes in XHarness, you can run E2E tests located in /tests/integration-tests. These usually download some pre-built application and send it to our "test cloud" called Helix together with an XHarness version built from your sources. There, XHarness executes the app on a device/simulator.

To run the E2E tests, you can find a script in tools/ that will build everything and create the cloud job for you:

./tools/run-e2e-test.sh Apple/Simulator.Tests.proj

Troubleshooting

Some XHarness commands only work in some scenarios and it's good to know what to expect from the tool. Some Android/Apple versions also require some workarounds and those are also good to know about.

My Apple unit tests are not running

For the apple test command, XHarness expects the application to contain a TestRunner which is a library you can find in this repository. This library executes unit tests similarly how you would execute them on other platforms. However, the TestRunner from this repository contains more mechanisms that help to work around some issues (mostly in Apple platforms).

The way it works is that XHarness usually sets some environmental variables for the application and the TestRunner recognizes them and acts upon them.

The workarounds we talk about are for example some TCP connections between the app and XHarness so that we can stream back the test results.

For these reasons, the test command won't just work with any app. For those scenarios, use the apple run commands.

iOS/tvOS device runs are timing out

For some iOS/tvOS, we have problems detecting when the application exits on the real device (simulators work fine). The workaround we went with lies in sharing a random string with the application using an environmental variable RUN_END_TAG and expecting the app to output this string at the end of its run.

To turn this workaround on, run XHarness with --signal-app-end and make sure your application logs the string it reads from the env variable. Using the TestRunner from this repository will automatically give you this functionality.

Contribution

We welcome contributions! Please follow the Code of Conduct.

Filing issues

This repo should contain issues that are tied to the XHarness command line tool and the TestRunners.

For other issues, please use the following repos:

  • For .NET runtime and Base Class Library issues, file in the dotnet/runtime repo
  • For overall .NET SDK issues, file in the dotnet/sdk repo

License

.NET (including the xharness repo) is licensed under the MIT license.

xharness's People

Contributors

akoeplinger avatar bruno-garcia avatar dalexsoto avatar directhex avatar dotnet-bot avatar dotnet-maestro[bot] avatar garath avatar ilonatommy avatar ivanpovazan avatar jonfortescue avatar lambdageek avatar lewing avatar mandel-macaque avatar maraf avatar mattgal avatar mattleibow avatar maximlipnin avatar microsoft-github-operations[bot] avatar microsoftopensource avatar mkhamoyan avatar pavelsavara avatar premun avatar radekdoulik avatar radical avatar rmarinho avatar rolfbjarne avatar safern avatar steveisok avatar tkapin avatar viktorhofer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xharness's Issues

ADB is duplicated in the CLI NuGet package

The folder structure looks like this:

...
|
├── content
│   ├── AdbWinApi.dll
│   ├── AdbWinUsbApi.dll
│   └── adb.exe
├── contentFiles
│   └── any
│       └── netcoreapp3.1
│           ├── AdbWinApi.dll
│           ├── AdbWinUsbApi.dll
│           └── adb.exe
...

Enable nullable references

We can consider turning on nullable references which would totally make sense at least for the CLI project where we really care for arguments to be set properly. Other projects could follow.
For iOS.Shared it might be a problem to enable it for the whole project at once since it's quite large but we can definitely try it and see. It would also make sense there because we really care about proper flow of arguments from the CLI to mlaunch and similar.

`dotnet tool install` uses machine cache and doesn't install newest bits

I am seeing following behavior:

  1. I have the Azure DevOps pipeline with E2E integration tests for XHarness.
  2. In one step, I produce a debug version of the NuGet package with my tool that I want to test in the next step. The tool has always the same version 1.0.0-ci since it is not being published anywhere.
  3. In the next job on our OSX machine (we have 4 currently), I download this NuGet as a build artifact file and install the tool locally by doing:
dotnet new tool-manifest
dotnet tool install --version 1.0.0-ci --add-source [dir] [name of the app]
  1. The tool installs correctly, but after using it, I find out it is some old cached version installed by older build previously. It cached 1.0.0 before and uses that one.
  • I tried --no-cache but no change for this command
  • I am definitely sure I use the latest NuGet package because of other files inside (the helix job payload for example that does the install)
  • I opened this dotnet/sdk#11484 to ask

There are 2 ways to resolve this (I think):

  1. Produce a new version numbers on each build and install that specific version
  2. Remove the CLI from the cache using nuget locals all -List

Create README.md for the repository

What should be included

  • Usage (can CLI docs be generated from code?)
  • How to build, run
  • What is coming out of this repo - the tool, the shared lib for xamarin

Figure out verbosity setting

  • In iOS part of XHarness and also in mlaunch, verbosity is set via -v option that can be provided multiple times and an int verbosity level is set and used.
    The way it is being passed around is also a bit unfortunate because it is handed over in method args/ctors even though it's a quite static property of the program run.

  • In the CLI we have now ILogger which has Debug/Information/Warning. I am not sure what is the mechanism to set that but I assume there will be one soon.

Proposal

  1. It would be nice to have some static global place with verbosity setting for the run that we can access from within the iOS code (or if that's too ugly, we can have it in ICommandArguments)
  2. It would be nice to have it in a way that both ILogger and mlaunch understand it

Throw error on Windows/Linux.

The ios verb cannot work on Windows, makes no sense. Throw an error when a user tries to execute any of the ios verbs on windows or linux.

Generate XML test results in xUnit format by default

xUnit is the basic framework used by mono, lets move to always use xUnit and let other projects specify the desired output. This means adding a new option to the test command that will allow to specify the xml jargon to use.

Log messages do not add the device name.

When executing on device the following logs are written in stdout:

info: test[0]
      Starting test for ios-device..
info: test[0]
      Installing application 'MonoTouchTest' on ios-device
info: test[0]
      Application 'MonoTouchTest' was installed successfully on device 'mandel (XR iPhone)'
info: test[0]
      Starting application 'MonoTouchTest' on  on device '{deviceName}'

A string interpolation is missing.

App stdout leaks to XHarness stderr

Part of the stdout that is the app writing and is received in XHarness through the TCP listener is displayed in stdout of XHarness. Only stuff logged through ILogger should be displayed.

Actual:

info: test[0]
      Starting test for ios-simulator-64..
info: test[0]
      Starting application 'System.Numerics.Vectors.Tests' on ios-simulator-64
2020-04-28 03:44:30.671603-0700 System.Numerics.Vectors.Tests[40307:10721880] assembly_preload_hook: System.Private.CoreLib (null) /Users/prvysoky/Library/Developer/CoreSimulator/Devices/1CE4848E-D84A-4600-84AA-3F04A42F2046/data/Containers/Bundle/Application/F91EA8BA-4A19-4EEB-880B-107D5DFE3471/System.Numerics.Vectors.Tests.app
2020-04-28 03:44:30.697425-0700 System.Numerics.Vectors.Tests[40307:10721880] assembly_preload_hook: AppleTestRunner.dll (null) /Users/prvysoky/Library/Developer/CoreSimulator/Devices/1CE4848E-D84A-4600-84AA-3F04A42F2046/data/Containers/Bundle/Application/F91EA8BA-4A19-4EEB-880B-107D5DFE3471/System.Numerics.Vectors.Tests.app
...

Expected:

info: test[0]
      Starting test for ios-simulator-64..
info: test[0]
      Starting application 'System.Numerics.Vectors.Tests' on ios-simulator-64

Should we capture logs from all simulators?

We are capturing logs from all simulators and I don't understand why.
I also haven't seen more than log in the results so it hasn't happened but also not sure why to do it for all of them instead of for one only:

foreach (var sim in simulators)
{
// Upload the system log
_mainLog.WriteLine("System log for the '{1}' simulator is: {0}", sim.SystemLog, sim.Name);
bool isCompanion = sim != simulator;
var logDescription = isCompanion ? LogType.CompanionSystemLog.ToString() : LogType.SystemLog.ToString();
var log = _captureLogFactory.Create(
Path.Combine(_logs.Directory, sim.Name + ".log"),
sim.SystemLog,
true,
logDescription);
log.StartCapture();
_logs.Add(log);
systemLogs.Add(log);
}

Maybe this will start making problems for parallel runs but we don't do those..

This code was copied from Xamarin

Do not generate the human readable html by default

The parsing of the xml to a human readable version is done for the xamarin/xamarin-macios team. This does not make any sense in the terms of the xharness tool as a CLI, set it to not be generated by default and let the xamarin/xamarin-macios set it.

App completes successfully but XHarness tool fails

Egor has built me an app from these tests:

    public class DummyTests
    {
        [Fact]
        public void PassingTest()
        {
            Assert.Equal(1, 1);
        }

        [Fact]
        public void FailingTest()
        {
            Assert.Equal(1, 2);
        }

        [Fact(Skip = "Skipped reason")]
        public void SkippedTest()
        {
            Assert.Equal(1, 1);
        }
    }

The app runs fine, it terminates but we fail to parse the results:

Could not parse xml result file: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at Microsoft.DotNet.XHarness.iOS.Shared.XmlResultParser.ParseNUnitXml(StreamReader stream, StreamWriter writer) in /Users/prvysoky/Desktop/xharness/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResultParser.cs:line 188
   at Microsoft.DotNet.XHarness.iOS.Shared.XmlResultParser.GenerateHumanReadableResults(String source, String destination, XmlResultJargon xmlType) in /Users/prvysoky/Desktop/xharness/src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResultParser.cs:line 370
   at Microsoft.DotNet.XHarness.iOS.Shared.TestReporter.ParseResultFile(AppBundleInformation appInfo, String test_log_path, Boolean timed_out) in /Users/prvysoky/Desktop/xharness/src/Microsoft.DotNet.XHarness.iOS.Shared/TestReporter.cs:line 374
File data is:
##########
01:02:43.8921440 [Local Date/Time:     04/27/2020 01:02:43]
[Remote Address:       127.0.0.1:52126]
<?xml version="1.0" encoding="utf-8"?>
<test-results name="Test results" errors="0" inconclusive="0" ignored="0" invalid="0" not-run="0" date="2020-04-27" time="01:02:45" total="3" failures="1" skipped="1">
  <environment os-version="unknown" platform="unknown" cwd="unknown" machine-name="unknown" user="unknown" user-domain="unknown" nunit-version="xUnit.net 2.4.1.0" clr-version="64-bit .NET  [collection-per-class, non-parallel]" />
  <culture-info current-culture="unknown" current-uiculture="unknown" />
  <test-suite type="Assemblies" name="xUnit.net Tests" executed="True" success="False" result="Failure" time="0.594">
    <results>
      <test-suite type="Assembly" executed="True" name="System.Numerics.Vectors.Tests.dll" result="Failure" success="False" time="0.594">
        <results>
          <test-suite type="TestCollection" executed="True" name="Test collection for DummyTestProject.DummyTests" result="Failure" success="False" time="0.191">
            <results>
              <test-case name="DummyTestProject.DummyTests.SkippedTest" executed="False" result="Skipped" time="0">
                <reason>
                  <message>Skipped reason</message>
                </reason>
              </test-case>
              <test-case name="DummyTestProject.DummyTests.FailingTest" executed="True" result="Failure" success="False" time="0.1253504">
                <failure>
                  <message>Assert.Equal() Failure\nExpected: 1\nActual:   2</message>
                  <stack-trace>   at DummyTestProject.DummyTests.FailingTest() in /Users/egorbo/prj/runtime-3/src/libraries/System.Numerics.Vectors/tests/Vector2Tests.cs:line 16
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in /Users/egorbo/prj/runtime-3/src/mono/netcore/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.cs:line 359</stack-trace>
                </failure>
              </test-case>
              <test-case name="DummyTestProject.DummyTests.PassingTest" executed="True" result="Success" success="True" time="0.0657749" />
            </results>
          </test-suite>
        </results>
      </test-suite>
    </results>
  </test-suite>
</test-results>

The header makes it an invalid XML:

01:02:43.8921440 [Local Date/Time:     04/27/2020 01:02:43]
[Remote Address:       127.0.0.1:52126]

Also number of tests ran doesn't correlate with the code:

System.Numerics.Vectors.Tests[35220:10197811] Tests run: 3 Passed: 1 Inconclusive: 0 Failed: 1 Ignored: 0

The skipped test is mentioned in the logs though:

System.Numerics.Vectors.Tests[35220:10196063]   [IGNORED] DummyTestProject.DummyTests.SkippedTest

Problems to be solved

  • Remove invalid header from results XML - #93
  • Result XML is called nunit-test-ios-simulator-64-20200427_010223.xml - there's no nunit involved #102
  • XHarness hangs after failing to parse the XML and only the timeout kills it later - it should quit immediately - #102
  • Skipped test is not accounted for - #97
  • Output of the app is printed on the console of the XHarness tool and shouldn't be - #108

Xunit should respect `[ActiveIssue]` attribute

Provide events per test start and test end

Provide an event in the runners that will notify client.

  • Start event: Should contain the full name of the test that started.
  • Completed event: Should contain the full name of the test that completed and the result.

iOS application installation fails

I tried with an app bundled by XHarness as well with Egor's.

I get an error from mlaunch:

03:25:57.4053340 Xamarin.Hosting: Installing com.xamarin.bcltests.mscorlib Part 1.app/ with Bundle Identifier com.xamarin.bcltests.mscorlib Part 1 on 'iOS 13.3 (17C45) - iPhone X'...
03:26:02.2710690 Xamarin.Hosting: Device 'iOS 13.3 (17C45) - iPhone X' booted.
03:26:02.2807020 error HE0046: Failed to install the app 'com.xamarin.bcltests.mscorlib Part 1' on the device 'iOS 13.3 (17C45) - iPhone X': Failed to install the requested application
03:26:02.2881230   at Xamarin.Hosting.Services.InstallApplicationInSimulator (Xamarin.Hosting.Bindings.SimDevice device, Xamarin.Hosting.AppBundle app_bundle, System.Boolean fix_weak_system_library_references, System.Boolean skip_watch_app_install) [0x00112] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Hosting/Services.cs:769
03:26:02.2881660   at Xamarin.Hosting.Services.InstallApplicationInSimulatorAsync (Xamarin.Hosting.SimulatorInstallConfig config) [0x001de] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Hosting/Services.cs:958
03:26:02.2881790   at Xamarin.Launcher.Driver.LaunchSimulatorAsync () [0x0022c] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:774
03:26:02.2882340   at Xamarin.Utils.NSRunLoopExtensions.RunUntilTaskCompletion[T] (Foundation.NSRunLoop this, System.Threading.Tasks.Task`1[TResult] task) [0x00082] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Utils/Extensions.cs:35
03:26:02.2882490   at Xamarin.Launcher.Driver.Main2 (System.String[] args) [0x00b13] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:448
03:26:02.2882580   at Xamarin.Launcher.Driver.Main (System.String[] args) [0x0006d] in /Users/builder/jenkins/workspace/xamarin-macios/maccore/tools/mlaunch/Xamarin.Hosting/Xamarin.Launcher/Main.cs:148

Create API in SdkVersions.cs to inject different versions

Context
In https://github.com/xamarin/xamarin-macios/ there is a file Make.config which holds definitions for versions of dependencies listed in the SdkVersions.cs file. On build time they produce this C# file and consume it in the XHarness project.

Problem
We have hardcoded this file when moving to this repo but when xamarin-macios consumes the NuGet from this repo back, the versions in the NuGet and in their Make.config might go out of sync.

Goal
We need to give xamarin-macios a way to inject these into our SDK without the need to have to bump the versions here and then consume the new package through some API so that we don't change the functionality. Some static setter that needs to be called in the beginning is more than fine.

refactor common command functionality

Follow-up from #7

There's lots of small refactorings we could do, may as well wait until we have things working for a little while first as some features may become "vestigial".

Remove empty logs

Currently we are producing always 2 empty files. We should take a look at the end and omit them from Helix.

stdout and stderr are empty:

"Files": [
    {
        "FileName": "run-Simulator_iOS64.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/run-Simulator_iOS64.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "stdout-20200428_121721.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/stdout-20200428_121721.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "iPhone X (iOS 13.3) - created by xharness.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/iPhone%20X%20%28iOS%2013.3%29%20-%20created%20by%20xharness.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "simulator-list-20200428_121717.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/simulator-list-20200428_121717.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "stderr-20200428_121721.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/stderr-20200428_121721.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "vsts-nunit-launch-20200428_122024.xml",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/vsts-nunit-launch-20200428_122024.xml?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    },
    {
        "FileName": "console.5beebe56.log",
        "Uri": "https://helixre107v0xd6tv7v8isja.blob.core.windows.net/dotnet-xharness-refs-heads-prvysoky-e2e-testsaf14813ff5234d5ca1/WorkItem/console.5beebe56.log?sv=2019-02-02&se=2020-05-08T16%3A16%3A59Z&sr=c&sp=rl&sig=YjjnDSSOONYI0d1Uai8valxWyEQ2q9Sq5q18VYKje2Q%3D"
    }
],

Paths are created with quotes.

Executing the following:

dotnet artifacts/bin/Microsoft.DotNet.XHarness.CLI/Debug/netcoreapp3.1/Microsoft.DotNet.XHarness.CLI.dll ios test  --working-directory=“workdir” --output-directory=“outdir” --app=/Users/mandel/Xamarin/xamarin-macios/master/xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test177/bin/iPhone/Debug64-unified/monotouchtest.app --targets=ios-device --mlaunch="/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch" -v

The created dirs contain quotes.

“workdir”
“outdir”

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.