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
28 changes: 27 additions & 1 deletion docs/docs/execution/retrying.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,30 @@ public class MyTestClass

}
}
```
```

## Global Retry Policy

In case you want to apply the retry logic to all tests in a project, you can add the attribute on the assembly level.

```csharp
[assembly: Retry(3)]
```

Or you can apply the retry policy on all the tests in a class like this:

```csharp
[Retry(3)]
public class MyTestClass
{
}
```

The more specific attribute will always override the more general one.
For example, the `[Retry(3)]` on a method will override the `[Retry(5)]` on the class,
which in turn will override the `[Retry(7)]` on the assembly.

So the order of precedence is:
1. Method
1. Class
1. Assembly
19 changes: 18 additions & 1 deletion docs/docs/parallelism/parallel-limiter.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,21 @@ public record MyParallelLimit : IParallelLimit
```

## Caveats
If a test uses `[DependsOn(nameof(OtherTest))]` and the other test has its own different parallel limit, this isn't guaranteed to be honoured.
If a test uses `[DependsOn(nameof(OtherTest))]` and the other test has its own different parallel limit, this isn't guaranteed to be honoured.

## Global Parallel Limit

In case you want to apply the Parallel Limit logic to all tests in a project, you can add the attribute on the assembly level.

```csharp
[assembly: ParallelLimiter<MyParallelLimit>]
```

The more specific attribute will always override the more general one.
For example, the `[ParallelLimiter<MethodParallelLimit>]` on a method will override the `[ParallelLimiter<ClassParallelLimit>]` on the class,
which in turn will override the `[ParallelLimiter<AssemblyParallelLimit>]` on the assembly.

So the order of precedence is:
1. Method
1. Class
1. Assembly