-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support passing environment variables to iOS apps launched by xharness, and support separate install, run-test, and uninstall subcommands #493
Comments
@imhameed sure, this should be a piece of cake! I have some questions:
|
@imhameed can you also please provide me with a test application and some instructions on how you would like to run the tests using it so that I have a good picture of things should work? |
Great!
Sure. I don't have one handy right now but I'll send you something shortly. |
The extra arguments added after the `--` verbatim string are now also passed as environmental variables: ``` xharness apple test -a=some.app -o=o -t=ios-simulator-64 --set-env=bar=xyz -- --foo=bar ``` ends up as (mlaunch output): ``` Launching net.dot.System.Numerics.Vectors.Tests async on 'iOS 14.2 (18B79) - iPhone X' with: { arguments = ( "--foo=bar", foo3 ); environment = { NSUnbufferedIO = YES; "NUNIT_AUTOEXIT" = true; "NUNIT_ENABLE_XML_OUTPUT" = true; "NUNIT_HOSTNAME" = "127.0.0.1"; "NUNIT_HOSTPORT" = 53423; "NUNIT_XML_VERSION" = xUnit; "OS_ACTIVITY_DT_MODE" = YES; bar = xyz; }; } ``` Same for `apple run` and for MacCatalyst apps. Related to #493
Variables are not passed (#521 (comment)) |
Blocked, waiting for new mlaunch |
In order to introduce the new `install` / `run-test` / `uninstall` commands (#493), we need to separate installation from running the app which is currently happening via 1 mlaunch command for Simulators. We unify the approach for Simulators and devices and do the install separately. This will also help with diagnosis of issues when simulators freeze and we don't know at which stage. The code was refactored out of the `Command` classes into the `Orchestrator` classes so that it can be tested later too. We can also now test passing args to the `Commands` and how they get parsed.
@imhameed you can use XHarness 1.0.0-prerelease.21220.1 and newer to control how the app is installed used and uninstalled. I noticed one thing using the app you've sent me - the app should run the test and quit so that things work well. The commands that you want to use:
This will be faster as it won't reinstall the app at each run. This will then immensely speed up scenarios with real devices where these operations take more time. Please note that |
Closing as it is now implemented. |
I'm working on getting CoreCLR's runtime tests working with Mono on iOS devices. In dotnet/runtime#43954, I'm bundling multiple runtime test assemblies (with one entry point each) together into a single iOS app bundle, similar to what we currently do on Android. I'm passing the entry point assembly to run through an environment variable (unlike Android, which uses a command line argument): https://github.com/dotnet/runtime/pull/43954/files#diff-6cef647106df3b37e45599e150f97a7dc3678f2606723b1967dbda7d1f0a42b9R268-R273
I've verified that doing this works locally when launching runtime test assemblies (via their containing iOS app bundle) via mlaunch. To make this run for real on CI I'll need to do this with xharness.
xharness doesn't appear to have a way to add passthrough environment variables, although it does appear to support mlaunch's
--setenv
option internally:https://github.com/dotnet/xharness/blob/main/src/Microsoft.DotNet.XHarness.iOS.Shared/Execution/Arguments.cs#L199-L222
There was also a request in #397 to add separate install, run-test, and uninstall commands to xharness for Android. That will also be necessary for iOS, because a single iOS runtime test app bundle will contain multiple entry points.
The text was updated successfully, but these errors were encountered: