private MlaunchArguments GetCommonArguments( int verbosity, XmlResultJargon xmlResultJargon, string[]?skippedMethods, string[]?skippedTestClasses, ListenerTransport listenerTransport, int listenerPort, string listenerTmpFile) { var args = new MlaunchArguments(); for (var i = -1; i < verbosity; i++) { args.Add(new VerbosityArgument()); } // Environment variables var envVariables = GetEnvVariables(xmlResultJargon, skippedMethods, skippedTestClasses, listenerTransport, listenerPort, listenerTmpFile); args.AddRange(envVariables.Select(pair => new SetEnvVariableArgument(pair.Key, pair.Value))); // Arguments passed to the iOS app bundle args.AddRange(_appArguments.Select(arg => new SetAppArgumentArgument(arg))); return(args); }
private MlaunchArguments GetCommonArguments(int verbosity) { var args = new MlaunchArguments(); for (var i = -1; i < verbosity; i++) { args.Add(new VerbosityArgument()); } // Arguments passed to the iOS app bundle args.AddRange(_appArguments.Select(arg => new SetAppArgumentArgument(arg))); return(args); }
private MlaunchArguments GetCommonArguments(int verbosity) { var args = new MlaunchArguments { new SetAppArgumentArgument("-connection-mode"), new SetAppArgumentArgument("none"), // This will prevent the app from trying to connect to any IDEs // On macOS we can't edit the TCC database easily // (it requires adding the mac has to be using MDM: https://carlashley.com/2018/09/28/tcc-round-up/) // So by default ignore any tests that would pop up permission dialogs in CI. new SetEnvVariableArgument(EnviromentVariables.DisableSystemPermissionTests, 1), }; for (int i = -1; i < verbosity; i++) { args.Add(new VerbosityArgument()); } // Arguments passed to the iOS app bundle args.AddRange(_appArguments.Select(arg => new SetAppArgumentArgument(arg, true))); return(args); }
private MlaunchArguments GetCommonArguments( int verbosity, XmlResultJargon xmlResultJargon, string[]?skippedMethods, string[]?skippedTestClasses, ListenerTransport listenerTransport, int listenerPort, string listenerTmpFile) { var args = new MlaunchArguments { new SetAppArgumentArgument("-connection-mode"), new SetAppArgumentArgument("none"), // This will prevent the app from trying to connect to any IDEs new SetAppArgumentArgument("-autostart", true), new SetEnvVariableArgument(EnviromentVariables.AutoStart, true), new SetAppArgumentArgument("-autoexit", true), new SetEnvVariableArgument(EnviromentVariables.AutoExit, true), new SetAppArgumentArgument("-enablenetwork", true), new SetEnvVariableArgument(EnviromentVariables.EnableNetwork, true), // On macOS we can't edit the TCC database easily // (it requires adding the mac has to be using MDM: https://carlashley.com/2018/09/28/tcc-round-up/) // So by default ignore any tests that would pop up permission dialogs in CI. new SetEnvVariableArgument(EnviromentVariables.DisableSystemPermissionTests, 1), }; if (skippedMethods?.Any() ?? skippedTestClasses?.Any() ?? false) { // do not run all the tests, we are using filters args.Add(new SetEnvVariableArgument(EnviromentVariables.RunAllTestsByDefault, false)); // add the skipped test classes and methods if (skippedMethods != null && skippedMethods.Length > 0) { var skippedMethodsValue = string.Join(',', skippedMethods); args.Add(new SetEnvVariableArgument(EnviromentVariables.SkippedMethods, skippedMethodsValue)); } if (skippedTestClasses != null && skippedTestClasses !.Length > 0) { var skippedClassesValue = string.Join(',', skippedTestClasses); args.Add(new SetEnvVariableArgument(EnviromentVariables.SkippedClasses, skippedClassesValue)); } } for (int i = -1; i < verbosity; i++) { args.Add(new VerbosityArgument()); } // let the runner now via envars that we want to get a xml output, else the runner will default to plain text args.Add(new SetEnvVariableArgument(EnviromentVariables.EnableXmlOutput, true)); args.Add(new SetEnvVariableArgument(EnviromentVariables.XmlMode, "wrapped")); args.Add(new SetEnvVariableArgument(EnviromentVariables.XmlVersion, $"{xmlResultJargon}")); args.Add(new SetAppArgumentArgument($"-transport:{listenerTransport}", true)); args.Add(new SetEnvVariableArgument(EnviromentVariables.Transport, listenerTransport.ToString().ToUpper())); if (listenerTransport == ListenerTransport.File) { args.Add(new SetEnvVariableArgument(EnviromentVariables.LogFilePath, listenerTmpFile)); } args.Add(new SetAppArgumentArgument($"-hostport:{listenerPort}", true)); args.Add(new SetEnvVariableArgument(EnviromentVariables.HostPort, listenerPort)); // Arguments passed to the iOS app bundle args.AddRange(_appArguments.Select(arg => new SetAppArgumentArgument(arg, true))); return(args); }