-
Couldn't load subscription status.
- Fork 287
Closed
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)
Milestone
Description
Describe the bug
When running unit test in an linux container, I have issues with the path in TestRunDirectory. it contains a .\ in the path. This makes some (not all) unit tests fail.
Steps To Reproduce
Run a unit test in a container. Check the TestRunDirectory variable.
Expected behavior
TestRunDirectory should be a valid unix path.
Actual behavior
I get a path like this /__w/90/Contoso.MyUnitTest/build/.\TestResults/Deploy_ 20251016T082547_935/
The .\ makes that some tests fail..
Additional context
My workaround:
[TestClass]
public class MyTest {
private static string? _testRunDirectory;
public TestContext TestContext { get; set; }
[ClassInitialize]
public static void InitTest(TestContext testCtx)
=> _testRunDirectory = testCtx.TestRunDirectory.Replace(".\\", "")
...
}Metadata
Metadata
Assignees
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)