Techniques for wrapping test programs (RunAs, etc.) in v2 and v3 #2910
Replies: 1 comment 1 reply
-
There's nothing built in to do this. (I assume this is somewhat related to your question about making your own stand alone executables for v2.)
Certainly, in v3 since the project is itself self-executable, you could run this executable in a different environment so long as you could find a reasonable way to capture the output of the results (for example, launching it to write the results to XML, if you can't observe the console output of the running app). It would be up to you to do the launch/capture the results. Since we don't have our cross process RPC done yet for v3, it's unclear how easy or difficult it might be to influence the actual launching of the process, but if that's a desired feature I'm open to suggestions on how to enable customization of the launch process. |
Beta Was this translation helpful? Give feedback.
-
I have an xUnit v2 test project that's launched in a different context than the test needs in order to execute successfully (via general-purpose infrastructure that launches everything as SYSTEM, to cover cases where that kind of access is needed, with the option to launch a child process as a user account as appropriate).
Is there a clean way to hook the protocol between the either the VSTS runner and the xUnit DLL, or within the xUnit DLL for test execution, so that it can delegate to another process that will run all the same tests as the current DLL, but in a different context (for example, under a different user account)?
With xUnit v3, I suspect/hope this will be really easy - just re-launch the same test exe in a different environment, preserve the command line arguments, and connect the console output/error (assuming that all communication with the test exe either is based on command-line parameters or via stdout/stderr). Is that an accurate understanding of how v3 would work here, or is the contract between a v3 exe and an outer harness still being defined?
Beta Was this translation helpful? Give feedback.
All reactions