Enable write test outputs from test executor
- Dominant language
- C#
- Stars
- 729
- Forks
- 397
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 149
Description
- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain
Now it is not easy to output messages to test results from RemoteExecutor callback.
example of a current solution:
```C#
[Fact]
public void TestMethod()
{
var logFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
File.WriteAllText(logFilePath, "");
try
{
RemoteExecutor.Invoke((logFilePath) => {
File.AppendAllText(logFilePath, "Message to log");
}, logFilePath).Dispose();
}
catch {
throw;
}
finally{
_output.WriteLine(File.ReadAllText(logFilePath));
// delete temp file
}
}
```
Proposed:
```C#
[Fact]
public void TestMethod()
{
RemoteExecutor.Invoke((_output) => {
_output.WriteLine("Message to log");
}, _output).Dispose();
}
```
The disadvantage of this proposal is the number of Invoke method overloads.
Contributor guide
Assessment
This issue has not been assessed yet.