From e3a9128588ee4667d08857ce0eabec32c0d4b28f Mon Sep 17 00:00:00 2001 From: Gabriel Majeri Date: Thu, 21 Oct 2021 21:53:23 +0300 Subject: [PATCH] Remove "Shadow copying" section from integration testing guide (#23092) * Remove "Shadow copying" section from integration testing guide * Delete xunit.runner.json * Keep shadow copying section but mention when it's needed Co-authored-by: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> --- aspnetcore/test/integration-tests.md | 4 ++-- .../tests/RazorPagesProject.Tests/xunit.runner.json | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 aspnetcore/test/integration-tests/samples/3.x/IntegrationTestsSample/tests/RazorPagesProject.Tests/xunit.runner.json diff --git a/aspnetcore/test/integration-tests.md b/aspnetcore/test/integration-tests.md index 8fd8290ec7..139ce0a293 100644 --- a/aspnetcore/test/integration-tests.md +++ b/aspnetcore/test/integration-tests.md @@ -327,9 +327,9 @@ The `WebApplicationFactory` constructor infers the app [content root](xref:funda ## Disable shadow copying -Shadow copying causes the tests to execute in a different directory than the output directory. For tests to work properly, shadow copying must be disabled. The [sample app](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/test/integration-tests/samples) uses xUnit and disables shadow copying for xUnit by including an `xunit.runner.json` file with the correct configuration setting. For more information, see the [xUnit documentation](https://xunit.net/docs/configuration-files). +Shadow copying causes the tests to execute in a different directory than the output directory. If your tests rely on loading files relative to `Assembly.Location` and you encounter issues, you might have to disable shadow copying. -Add the `xunit.runner.json` file to root of the test project with the following content: +To disable shadow copying when using xUnit, create a `xunit.runner.json` file in your test project directory, with the [correct configuration setting](https://xunit.net/docs/configuration-files#shadowCopy): ```json { diff --git a/aspnetcore/test/integration-tests/samples/3.x/IntegrationTestsSample/tests/RazorPagesProject.Tests/xunit.runner.json b/aspnetcore/test/integration-tests/samples/3.x/IntegrationTestsSample/tests/RazorPagesProject.Tests/xunit.runner.json deleted file mode 100644 index 1c72a421ad..0000000000 --- a/aspnetcore/test/integration-tests/samples/3.x/IntegrationTestsSample/tests/RazorPagesProject.Tests/xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -}