Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopwatch extension (#38 / #182) #182

Merged
merged 44 commits into from
Dec 7, 2020
Merged

Conversation

Bukama
Copy link
Member

@Bukama Bukama commented Mar 11, 2020

Implementing a stopwatch extension as discussed in #38 and #99.

Suggested commit message

Implement the stopwatch extension (#38 / #182)

This simple stopwatch extension measures the elapsed time of 
each test (which is executed with the extension) and publishes
the the result as a ReportEntry.

closes: #38
PR: #182

closes #38

I hereby agree to the terms of the JUnit Pioneer Contributor License Agreement.

@Bukama
Copy link
Member Author

Bukama commented Mar 11, 2020

Don't understand why the Travis fails. I merged current master into the branch, run applySpotlessJava and a successfull build, commited and created the Pull Request.

@Michael1993
Copy link
Member

Michael1993 commented Mar 11, 2020

Seen in the Travis log (I hope this works). It seems you are missing a package-info.java file?

Seems fair, you did add a new package.

long elapsedTime = currentTimeMillis() - launchTime;

String message = String.format("%s '%s' took %d ms.", unit.name(), context.getDisplayName(), elapsedTime);
context.publishReportEntry("stopwatch", message);
Copy link
Member

Choose a reason for hiding this comment

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

I'm sorry to bother you with this but wouldn't this get overwritten if I run two test files with the @Stopwatch annotation?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fairly new to the TestReporter as is, so I really am just asking for information.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure as I used the TestReporter for the first time, but as I understand it the context is for each test case. But I'm not sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sormuras Can you enlighten us?

@Bukama
Copy link
Member Author

Bukama commented Mar 12, 2020

Seen in the Travis log (I hope this works). It seems you are missing a package-info.java file?

Seems fair, you did add a new package.

Thanks, never created such a file - but there's always the first time. Run spotless again, several files were changed. Commitet and pushed them. Let's see what Travis makes out of it

@Bukama Bukama changed the title [WIP]Stopwatch extension (#83) Stopwatch extension (#83) Mar 18, 2020
@Bukama
Copy link
Member Author

Bukama commented Mar 18, 2020

Removed the [WIP]. Found a note from Marc how I may write a report. As I would need this also for the @Issue extension (yeah it comes slowly closer ;) ) I'll open a own PR for that, so this is not getting to large and can be merged (if reviewers are okay with that)

@Bukama
Copy link
Member Author

Bukama commented Mar 27, 2020

Why did never mentioned that I'm lacking documentation. I mean - ME?!?

@Bukama
Copy link
Member Author

Bukama commented Jul 20, 2020

Suggested commit message

Implement the stopwatch extension (#83 / #182)

This simple stopwatch extension measures the elapsed time of 
each test (which is executed with the extension) and publishes
the the result as a ReportEntry.

closes: #38 
PR: #182

@Bukama Bukama requested a review from Michael1993 July 20, 2020 13:18
# Conflicts:
#	src/main/java/org/junitpioneer/jupiter/package-info.java
# Conflicts:
#	docs/docs-nav.yml
@sonarcloud
Copy link

sonarcloud bot commented Aug 8, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Oct 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@Bukama Bukama changed the title Stopwatch extension (#83) Stopwatch extension (#83 / #182) Oct 12, 2020
@Bukama Bukama changed the title Stopwatch extension (#83 / #182) Stopwatch extension (#38 / #182) Oct 30, 2020
Copy link
Member

@Michael1993 Michael1993 left a comment

Choose a reason for hiding this comment

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

Aside from minor things, I think this is good. Nicely done!

Please merge the master branch into your branch.

docs/stopwatch.adoc Outdated Show resolved Hide resolved
docs/docs-nav.yml Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Dec 6, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@Michael1993 Michael1993 left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

@Michael1993 Michael1993 merged commit 925b2bc into junit-pioneer:master Dec 7, 2020
@Bukama Bukama deleted the stopwatch branch December 7, 2020 19:11
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.

Move StopwatchExtension to pioneer
3 participants