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

Add support for formatted start time in emailable-report.html #2459

Closed
4 of 7 tasks
bazzani opened this issue Jan 20, 2021 · 4 comments · Fixed by #2476
Closed
4 of 7 tasks

Add support for formatted start time in emailable-report.html #2459

bazzani opened this issue Jan 20, 2021 · 4 comments · Fixed by #2476

Comments

@bazzani
Copy link
Contributor

bazzani commented Jan 20, 2021

TestNG Version

7.1.1 for the sample below, but the master branch version can also have the new feature applied.

Expected behavior

When I run my TestNG tests using maven and the maven surefire plugin, I would like to be able to specify a formatted start datetime in the emailable-report.html file.

Actual behavior

The start datetime of a test is displayed in millisceonds from the epoch, which is not human readable.

Is the issue reproductible on runner?

  • Maven
  • Shell
  • Gradle
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Test case sample

  • run TestNG tests with maven and the maven-surefire-plugin, check the Start column in the emailable-report.html file
  • Screenshot attached...
    • image

Other

I have come up with a fix in my local dev environment to support this feature by adding a protected method to the EmailableReporter2 class which will return the formatted start datetime.

The method can then be overridden in a sub class to return the human readable String, which will be added to the report.

A Sample output would be

  • image
@krmahadevan
Copy link
Member

@bazzani - Would you like to raise a Pull Request for this ? We will be gladly be able to help you with reviewing it and getting it merged.

@bazzani bazzani changed the title Add support for formatted start time in emailabel-report.html Add support for formatted start time in emailable-report.html Jan 21, 2021
@bazzani
Copy link
Contributor Author

bazzani commented Jan 21, 2021

@bazzani - Would you like to raise a Pull Request for this ? We will be gladly be able to help you with reviewing it and getting it merged.

I certainly would @krmahadevan!

I have already forked this repo, and pushed an interim commit to a feature branch on my fork.
I will have another look at the code to see if adding any unit tests are prudent for this change, and then get back to you.

bazzani added a commit to bazzani/testng that referenced this issue Feb 5, 2021
The `EmailableReport2` class provides test start times which are in
milliseconds values from the epoch (01/01/1970):
- see `emailable-report.html`

This value is not very human readable, and this change adds a protected
method which can be overwritten in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`

Fixes testng-team#2459
bazzani added a commit to bazzani/testng that referenced this issue Feb 5, 2021
The `EmailableReport2` class provides test start times values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `emailable-report.html`
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overwritten in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`

Fixes testng-team#2459
bazzani added a commit to bazzani/testng that referenced this issue Feb 7, 2021
The `EmailableReport2` class provides test start time values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `emailable-report.html`
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overwritten in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`

Fixes testng-team#2459
bazzani added a commit to bazzani/testng that referenced this issue Feb 7, 2021
The `EmailableReport2` class provides test start time values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `emailable-report.html`
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overwritten in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`

Fixes testng-team#2459
bazzani added a commit to bazzani/testng that referenced this issue Feb 7, 2021
The `EmailableReport2` class provides test start time values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `test-output/emailable-report.html` for start time report usage
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overridden in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`)

Fixes testng-team#2459
bazzani added a commit to bazzani/testng that referenced this issue Feb 7, 2021
The `EmailableReport2` class provides test start time values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `test-output/emailable-report.html` for start time report usage
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overridden in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`)

Fixes testng-team#2459
krmahadevan pushed a commit that referenced this issue Feb 7, 2021
The `EmailableReport2` class provides test start time values which
are in millisecond value from the epoch (01/01/1970 00:00:00):
- sample value `1610359715103`
  - GMT : January 11, 2021 Monday 10: 08: 35.103
- see `test-output/emailable-report.html` for start time report usage
- see https://www.epochconverter.com/clock

This value is not very human readable, and this change adds a protected
method which can be overridden in sub classes to provide a more human
readable version of the test start time (e.g. `2021-01-01 12:34:56`)

Fixes #2459
@bazzani
Copy link
Contributor Author

bazzani commented Feb 10, 2021

@krmahadevan can i ask when my fix for this issue will be released?
aka when is the next release of testng due?

@krmahadevan
Copy link
Member

@bazzani - TestNG 7.4.0 has been released to Maven central.

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 a pull request may close this issue.

2 participants