Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ DependsOnFixtureAttribute(Type dependencyFixture)
for parallel execution—causes the affected fixtures to be marked
**Failed** as invalid.

### Automatic Inclusion

A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail because the dependency is filtered out and never run. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail because the dependency is filtered out and never run. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.
A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.


This can produce unexpected results when combined with _test partitioning_ as it might be possible for a test dependency to be automatically included in multiple shards, effectively running the test twice.

## See Also

* [DependsOnTest Attribute](xref:attribute-dependsontest)
Expand Down
6 changes: 6 additions & 0 deletions docs/articles/nunit/writing-tests/attributes/dependsontest.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ See examples below.
4. Use `nameof(...)` where possible so dependency names stay aligned with test
method renames.

### Automatic Inclusion

A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail because the dependency is filtered out and never run. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail because the dependency is filtered out and never run. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.
A test run which filters out some tests may cause a dependency to be filtered out from a test which is intended to run. This can most commonly happen when developing in an IDE like Visual Studio and a test method is clicked on to "Run Test". This might always cause the target test to fail. To fix this, test dependencies are always included in a run when they are a dependency for a test also in the run.


This can produce unexpected results when combined with _test partitioning_ as it might be possible for a test dependency to be automatically included in multiple shards, effectively running the test twice.

## See Also

* [DependsOnFixture Attribute](xref:attribute-dependsonfixture)
Expand Down
Loading