Cleanup logs after successful test runs (#40807)
- backport for #39038 - `cherry-pick` of 6958517c - update `AssemblyTestLog` to perform actual log directory cleanup - add `ReportTestFailure()` method for tests to report failures, disabling cleanup - add `IAcceptFailureReports` for `AspNetTestAssemblyRunner` to report failures to `AssemblyTestLog` - extend `AspNetTestAssemblyRunner` to optionally create fixture instances using `static ForAssembly(Assembly)` - add `AssemblyTestLogFixtureAttribute` to register `AssemblyTestLog` as an assembly fixture - use `AssemblyTestLogFixtureAttribute` in all test projects - disable log cleanup in three existing tests - add tests of new cleanup features - also cover a few existing methods - do cleanup before creating new logger - was deleting the just-created global.log file nits: - use `is [not] null` and `new()` more - move `AssemblyTestLogTests` to same namespace as `AssemblyTestLog`
显示
- src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs 1 个添加, 11 个删除src/Mvc/test/Mvc.FunctionalTests/ErrorPageTests.cs
- src/Testing/src/AssemblyTestLog.cs 55 个添加, 17 个删除src/Testing/src/AssemblyTestLog.cs
- src/Testing/src/AssemblyTestLogFixtureAttribute.cs 11 个添加, 0 个删除src/Testing/src/AssemblyTestLogFixtureAttribute.cs
- src/Testing/src/build/Microsoft.AspNetCore.Testing.props 3 个添加, 2 个删除src/Testing/src/build/Microsoft.AspNetCore.Testing.props
- src/Testing/src/xunit/AspNetTestAssemblyRunner.cs 43 个添加, 12 个删除src/Testing/src/xunit/AspNetTestAssemblyRunner.cs
- src/Testing/src/xunit/IAcceptFailureReports.cs 9 个添加, 0 个删除src/Testing/src/xunit/IAcceptFailureReports.cs
- src/Testing/test/AspNetTestAssemblyRunnerTest.cs 219 个添加, 0 个删除src/Testing/test/AspNetTestAssemblyRunnerTest.cs
- src/Testing/test/AssemblyTestLogTests.cs 214 个添加, 29 个删除src/Testing/test/AssemblyTestLogTests.cs
- src/Testing/test/TestableAspNetTestAssemblyRunner.cs 105 个添加, 0 个删除src/Testing/test/TestableAspNetTestAssemblyRunner.cs
- src/Testing/test/TestableAssembly.cs 95 个添加, 0 个删除src/Testing/test/TestableAssembly.cs
加载中
想要评论请 注册 或 登录