Skip to content

Commit

Permalink
feat(report): allow override of report timestamp dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dwbruhn committed Sep 18, 2020
1 parent 0e4cd65 commit 24d01fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ directory/filename settings for those reporters, as nemo will take care of that
Recommended to set this as `path:report`, which will create a `report` directory beneath your base directory. See `Reporting` below.
### `output.pathTimestampFormat <optional>`
This setting overrides the timestamp format of the report directory structure. The default is `MM-DD-YYYY/HH-mm-ss`, which creates nested directories like "09-18-2020/14-09-57" for the test run which occurred on September 18, 2020 at 2:09:57pm in your local time zone.
Setting `pathTimestampFormat` to `YYYY-MM-DD_HH-mm-s`, for example, creates a single directory for each test run using a modified ISO 8601 format (such as "2020-09-18_14-09-57").
The possible formats are provided by [Moment.js](https://momentjs.com/docs/#/displaying/format/).
### `output.storage <optional>`
You can provide an influxdb endpoint and store test results in it. E.g.
Expand Down Expand Up @@ -194,7 +202,7 @@ any environment variables you want in the test process.
### `base.zeroExitCode`
-if set to true, nemo will always exit with zero code
-if set to true, nemo will always exit with zero code
-if set to false, or don't set any value, the exitCode is Math.min(output.totals.fail, 255);


Expand Down
3 changes: 2 additions & 1 deletion lib/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const reportDir = function reportDir(cb) {
log('reportDir: output:reports not defined');
return cb(null, this);
}
let tsDirName = moment().format('MM-DD-YYYY/HH-mm-ss');
const pathTimestampFormat = this.config.get('output:pathTimestampFormat') || 'MM-DD-YYYY/HH-mm-ss';
let tsDirName = moment().format(pathTimestampFormat);
let fullReportPath = `${reportOutput}/${tsDirName}`;
this.config.set('output:reports', fullReportPath);
log(`reportDir: ${fullReportPath}`);
Expand Down

0 comments on commit 24d01fe

Please sign in to comment.