forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e3a054
commit 17b6f83
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
docs/core/testing/unit-testing-mstest-analyzers-MSTEST0001.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: "MSTEST0001: Explicitly enable or disable tests parallelization" | ||
description: "Learn about code analysis rule MSTEST0001: Explicitly enable or disable tests parallelization" | ||
ms.date: 12/20/2023 | ||
f1_keywords: | ||
- MSTEST0001 | ||
- UseParallelizeAttributeAnalyzer | ||
helpviewer_keywords: | ||
- UseParallelizeAttributeAnalyzer | ||
- MSTEST0001 | ||
author: evangelink | ||
ms.author: amauryleve | ||
dev_langs: | ||
- CSharp | ||
- VB | ||
--- | ||
# MSTEST0001: Explicitly enable or disable tests parallelization | ||
|
||
| Property | Value | | ||
|-------------------------------------|----------------------------------------------------| | ||
| **Rule ID** | MSTEST0001 | | ||
| **Title** | Explicitly enable or disable tests parallelization | | ||
| **Category** | Performance | | ||
| **Fix is breaking or non-breaking** | Non-breaking | | ||
| **Enabled by default** | Yes | | ||
| **Default severity** | Warning | | ||
|
||
## Cause | ||
|
||
The assembly is not marked with `[Parallelize]` or `[DoNotParallelize]` attribute. | ||
|
||
## Rule description | ||
|
||
By default, MSTest runs tests sequentially which can lead to severe performance limitations. It is recommended to enable assembly attribute `[Parallelize]` or if the assembly is known to not be parallelizable, to use explicitly the assembly level attribute `[DoNotParallelize]`. | ||
|
||
## How to fix violations | ||
|
||
To fix a violation of this rule, add `[assembly: Parallelize]` or `[assembly: DoNotParallelize]` attribute. | ||
|
||
## When to suppress warnings | ||
|
||
Do not suppress a warning from this rule. Many libraries can benefit from a massive performance boost when enabling parallelization. When the test application is designed in a way that prevents parallelization, having the attribute explicitly set helps new developers to understand the limitations of the library. |
15 changes: 15 additions & 0 deletions
15
docs/core/testing/unit-testing-mstest-analyzers-performance.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Performance rules (code analysis) | ||
description: Learn about code analysis performance rules. | ||
author: evangelink | ||
ms.author: amauryleve | ||
ms.date: 12/20/2023 | ||
--- | ||
|
||
# Performance rules | ||
|
||
Rules that support high-performance testing. | ||
|
||
Identifier | Name | Description | ||
-----------|------|------------ | ||
[MSTEST0001](unit-testing-mstest-analyzers-MSTEST0001.md) | UseParallelizeAttributeAnalyzer | By default, MSTest runs tests sequentially which can lead to severe performance limitations. It is recommended to enable assembly attribute `[Parallelize]` or if the assembly is known to not be parallelizable, to use explicitly the assembly level attribute `[DoNotParallelize]`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: MSTest code analysis | ||
description: Learn about the MSTest code analysis. | ||
author: evangelink | ||
ms.author: amauryleve | ||
ms.date: 12/20/2023 | ||
--- | ||
|
||
# MSTest code analysis | ||
|
||
*MSTest analysis* ("MSTESTxxxx") rules inspect your C# or Visual Basic code for security, performance, design and other issues. | ||
|
||
> [!TIP] | ||
> If you're using Visual Studio, many analyzer rules have associated *code fixes* that you can apply to correct the problem. Code fixes are shown in the light bulb icon menu. | ||
The rules are organized into categories such as performance usage... | ||
|
||
## Categories | ||
|
||
**[Performance rules](unit-testing-mstest-analyzers-performance.md)** | ||
|
||
Rules that support high-performance testing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters