Skip to content

Configure finest log level for tests to improve code coverage for log…#155

Merged
kaklakariada merged 3 commits into
developfrom
test-finest-loglevel
Jul 14, 2018
Merged

Configure finest log level for tests to improve code coverage for log…#155
kaklakariada merged 3 commits into
developfrom
test-finest-loglevel

Conversation

@kaklakariada

Copy link
Copy Markdown
Contributor

… messages

@kaklakariada
kaklakariada requested a review from redcatbear July 1, 2018 19:05
@codecov

codecov Bot commented Jul 1, 2018

Copy link
Copy Markdown

Codecov Report

Merging #155 into develop will increase coverage by 0.2%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             develop     #155     +/-   ##
============================================
+ Coverage      93.72%   93.93%   +0.2%     
- Complexity       958      981     +23     
============================================
  Files            105      105             
  Lines           2695     2704      +9     
  Branches         225      226      +1     
============================================
+ Hits            2526     2540     +14     
+ Misses           113      108      -5     
  Partials          56       56
Impacted Files Coverage Δ Complexity Δ
.../itsallcode/openfasttrace/report/ReportFormat.java 100% <0%> (ø) 10% <0%> (+3%) ⬆️
...code/openfasttrace/cli/CommandLineInterpreter.java 89.77% <0%> (+1.13%) 34% <0%> (+1%) ⬆️
.../openfasttrace/core/xml/ContentHandlerAdapter.java 93.54% <0%> (+3.22%) 10% <0%> (+2%) ⬆️
...sttrace/importer/RegexMatchingImporterFactory.java 73.07% <0%> (+7.69%) 8% <0%> (+2%) ⬆️
...de/openfasttrace/importer/markdown/Transition.java 100% <0%> (+9.09%) 6% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de885f7...12d9540. Read the comment docs.

kaklakariada added a commit that referenced this pull request Jul 7, 2018
kaklakariada added a commit that referenced this pull request Jul 7, 2018
@kaklakariada
kaklakariada requested a review from p1pp5l3r July 7, 2018 09:30

@redcatbear redcatbear left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with editorial changes.

import org.junit.rules.TestRule;

/**
* This junit {@link TestRule} sets a temporary log level and a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"JUnit"

* This junit {@link TestRule} sets a temporary log level and a
* {@link NoOpLoggingHandler} during tests and restores the original state after
* the test. This allows you to run the tests with all log messages but without
* the overhead of spamming the log.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Override
public void publish(final LogRecord record)
{
// empty

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"left empty on purpose".

# #L%
###
handlers = java.util.logging.ConsoleHandler
handlers = java.util.logging.ConsoleHandler org.itsallcode.openfasttrace.testutil.log.NoOpLoggingHandler

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⭐ ⭐ ⭐ ⭐ ⭐

@kaklakariada
kaklakariada merged commit 9c09bb1 into develop Jul 14, 2018
@kaklakariada
kaklakariada deleted the test-finest-loglevel branch July 14, 2018 10:21
@redcatbear redcatbear mentioned this pull request Oct 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants