Testing Platform overwriting/removing user console output
Open
@nohwnd is already working on this.
Since Jan 15, 2025.
area/mtp
area/terminal-reporter
- Dominant language
- C#
- Stars
- 1k
- Forks
- 312
- Avg merge
- 7h 46m
- Merged PRs (30d)
- 465
Description
Using TUnit, I created this simple test suite:
public class Tests
{
[Before(TestSession)]
public static async Task BeforeTestSession()
{
Console.WriteLine($"BeforeTestSession started at {DateTime.Now}");
await Task.Delay(TimeSpan.FromSeconds(5));
Console.WriteLine($"BeforeTestSession ended at {DateTime.Now}");
}
[Before(Assembly)]
public static async Task BeforeAssembly()
{
Console.WriteLine($"BeforeAssembly started at {DateTime.Now}");
await Task.Delay(TimeSpan.FromSeconds(5));
Console.WriteLine($"BeforeAssembly ended at {DateTime.Now}");
}
[Test]
public void Test1()
{
Console.WriteLine($"Executing Test at {DateTime.Now}");
}
}
If you just do a dotnet run on the CLI, you'll have to be quick, but when it starts to show "BeforeAssembly started", you'll see it render really quickly, but then it'll be removed and overwritten by the rendering of the [✓0/x0/↓0] ConsoleApp5.dll (net9.0|x64).
I guess this is related to the new interactive output and showing running tests etc. But overwriting user output means they may lose visibility of important information.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.