Skip to content

Commit

Permalink
readme adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldigas committed Aug 27, 2020
1 parent 331d50e commit cc9bf60
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Reasonable Test Logs

Junit5 test execution listener that hides log events for passing tests.
Junit5 test execution listener that hides log events for "green" tests.

## Rationale

Have you ever faced with the logging noise during your project build?
Big chance you did, if your project uses some logging framework, like slf4j, and you write unit tests.
Have you ever faced with the logging noise during your project build? Maybe you had opportunity to download tens
megabytes of log to analyze issue just because some chatty package has enabled DEBUG logging "in case of something goes wrong"?
Big chance you did, if your project uses some logging framework (like slf4j), and you write unit tests.

The reason is simple - logs allow you to get extra information if something goes wrong,
so there is no much sense in muting logs during tests run. At the same time we need logs, as a source of information, if
test fails and here's come the problem - there is no out of the box integration between JUnit and logging system that
can discard all logged events when tests passes and send them to configured appenders if something goes wrong.
can discard all logged events when test passes and send them to configured appenders if something goes wrong.

This project aims to solve this problem providing the missing piece.
This project aims to solve this problem providing this missing piece.

## Usage

If your codebase uses supported frameworks (see prerequisites below), just add test dependency:
If your codebase uses supported frameworks (see prerequisites [below](#prerequisites)), just add test dependency:
```xml
<dependency>
<groupId>com.github.zeldigas</groupId>
Expand All @@ -31,17 +32,17 @@ If your codebase uses supported frameworks (see prerequisites below), just add t
### Prerequisites

#### Test engines
This project is JUnit5 only although if you have use JUnit5 as a base and have some JUnit4 tests executed via vintage
This project is JUnit5 only, although if you have use JUnit5 as a base and have some JUnit4 tests executed via vintage
engine, it will work as well.

#### Logging frameworks
Right now only logback is supported, although it should be possible to add support for other frameworks as well (e.g. log4j2)
in case of need and requests from community.
Right now only Logback is supported, although it should be possible to add support for other frameworks as well (e.g. log4j2)
in case of need and request from community.


## Examples

Check `example` directory for various test-samples. Simples way to run it, execute the following command from repo root:
Check `example` directory for various test-samples. The simplest way to run it -- execute the following command from repo root:
```
mvn clean package
```
Expand All @@ -58,6 +59,6 @@ implemented similar ideas using JUnit4 test extension mechanism.
While it works, I found it harder to use than I want, because you need to configure such places manually or setup "catch-all" extension
in build system (e.g. surefire params for junit5).

Anyway some techniques published on [github](https://github.com/nt-ca-aqe/testit-testutils/tree/master/testutils-logsuppressor-logback)
was useful.
Anyway, some techniques published on [github](https://github.com/nt-ca-aqe/testit-testutils/tree/master/testutils-logsuppressor-logback)
were useful.

0 comments on commit cc9bf60

Please sign in to comment.