Skip to content

Commit

Permalink
Updated the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcin Grzejszczak committed Mar 10, 2015
1 parent 1fb88bf commit dc0db98
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ testprofiler {
/**
* Section to describe what should happen if tests exceed max threshold
* for more options please check the {@link TestProfilerPluginExtension}
* or for usage check {@link com.blogspot.toomuchcoding.testprofiler.TestExecutionResultSavingTestListenerSpec}
*/
ifTestsExceedMaxThreshold {
breakBuild()
Expand All @@ -136,6 +134,68 @@ testprofiler {
```

### Actions if build exceeds max threshold

#### Display default warning message

If provided as follows then the build will display a default warning message if the test execution time exceeds the provided max one

```
testprofiler {
buildBreaker {
Integer maxTestThreshold = 30_000
ifTestsExceedMaxThreshold {
breakBuild()
}
}
}
}
```

#### Display custom warning message

If provided as follows then the build will display a custom warning message if the test execution time exceeds the provided max one

```
testprofiler {
buildBreaker {
Integer maxTestThreshold = 30_000
ifTestsExceedMaxThreshold {
breakBuild { TestDescriptor testDescriptor, TestExecutionResult testExecutionResult ->
"return some string with [$testDescriptor] and [$testExecutionResult] that will be logged"
}
}
}
}
}
```

#### Perform custom logic

If provided as follows then the custom logic will be executed if the test execution time exceeds the provided max one

```
testprofiler {
buildBreaker {
Integer maxTestThreshold = 30_000
ifTestsExceedMaxThreshold {
act { com.blogspot.toomuchcoding.testprofiler.LoggerProxy,
TestDescriptor testDescriptor,
TestExecutionResult testExecutionResult ->
// do whatever you want to...
}
}
}
}
}
```

## Deprecated (up till version 0.0.4)

### How to add it
Expand Down

0 comments on commit dc0db98

Please sign in to comment.