Skip to content

Commit fdb00bd

Browse files
authored
Merge pull request #62
Increased the `TryAtSoftware.CleanTests` package version to 1.0.0
2 parents e2c6454 + 86f9a7a commit fdb00bd

File tree

4 files changed

+30
-4
lines changed

4 files changed

+30
-4
lines changed

README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,29 @@ Example:
8888
[assembly: TryAtSoftware.CleanTests.Core.Attributes.ConfigureCleanTestsFramework(UtilitiesPresentations = CleanTestMetadataPresentations.InTraits, GenericTypeMappingPresentations = CleanTestMetadataPresentations.InTraits | CleanTestMetadataPresentations.InTestCaseName, MaxDegreeOfParallelism = 3)]
8989
```
9090

91+
Moreover, the execution behavior of `clean tests` can be finely controlled by utilizing the `ExecutionConfigurationOverride` attribute.
92+
This attribute allows you to apply overrides either for all test methods within a given class, or for individual test methods.
93+
Currently, the only parameter that can be controlled is the `MaxDegreeOfParallelism` (however, it is worth noting that this will be enhanced in future releases).
94+
95+
There are many scenarios for which this opportunity would be beneficial:
96+
- If we need to use multiple threads within a single test case, it is often useful to reduce the max degree of parallelism.
97+
98+
Example:
99+
```C#
100+
[CleanFact]
101+
[ExecutionConfigurationOverride(MaxDegreeOfParallelism = 1)]
102+
public async Task OperationShouldSucceeedInParallel()
103+
{
104+
const int parallelTasksCount = 1_000;
105+
var tasks = new Task[parallelTasksCount];
106+
107+
for (int i = 0; i < parallelTasksCount; i++) tasks[i] = ExecuteOperation();
108+
109+
await Task.WhenAll(tasks);
110+
AssertState();
111+
}
112+
```
113+
91114
#### Metadata presentation
92115

93116
The enum `CleanTestMetadataPresentations` offers three options used for additional configuration over the `clean tests` execution framework:
@@ -209,4 +232,8 @@ public void WriteShouldSucceed()
209232
IWriter writer = this.GetService<IWriter>();
210233
writer.Write("Some text");
211234
}
212-
```
235+
```
236+
237+
# Helpful Links
238+
239+
For additional information on troubleshooting, migration guides, answers to Frequently asked questions (FAQ), and more, you can refer to the [Wiki pages](https://github.com/TryAtSoftware/CleanTests/wiki) of this project.

Tests/TryAtSoftware.CleanTests.UnitTests/Constants/UnitTestConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public static class UnitTestConstants
44
{
5-
public const int Timeout = 2000;
5+
public const int Timeout = 3000;
66
}

TryAtSoftware.CleanTests.Core/Attributes/ExecutionConfigurationOverrideAttribute.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
namespace TryAtSoftware.CleanTests.Core.Attributes;
22

33
using System;
4-
using TryAtSoftware.CleanTests.Core.Enums;
54
using TryAtSoftware.CleanTests.Core.Internal;
65

76
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)]

TryAtSoftware.CleanTests.Core/TryAtSoftware.CleanTests.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<SonarQubeTestProject>false</SonarQubeTestProject>
99

1010
<PackageId>TryAtSoftware.CleanTests</PackageId>
11-
<Version>1.0.0-alpha.14</Version>
11+
<Version>1.0.0</Version>
1212
<Authors>Tony Troeff</Authors>
1313
<RepositoryUrl>https://github.com/TryAtSoftware/CleanTests</RepositoryUrl>
1414
<PackageLicenseExpression>MIT</PackageLicenseExpression>

0 commit comments

Comments
 (0)