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

feat(report): allow override of report timestamp dir structure #103

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dwbruhn
Copy link
Collaborator

@dwbruhn dwbruhn commented Sep 18, 2020

Add output.pathTimestampFormat config option to allow overriding of timestamp folder structure. (I'd like to put the year first, myself.)

@grawk Appreciate any pointers on adding tests!

@dwbruhn dwbruhn requested a review from grawk September 18, 2020 21:35
@dwbruhn dwbruhn force-pushed the pathTimestampFormat branch 3 times, most recently from beb628c to 24d01fe Compare September 18, 2020 22:17
Copy link
Member

@grawk grawk left a comment

Choose a reason for hiding this comment

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

Would recommend a test where you supply a bad value for this configuration and validate the error handling.

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

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

Since this is a user supplied configuration, we may want to wrap this in a try/catch or otherwise figure out how to handle the case where the value provided is invalid.

Choose a reason for hiding this comment

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

I'm also interested in what issues arise if we pass in a "valid" but unexpected value like foo. Will we run into errors if multiple tests/runs try to write to the same folder?

Perhaps we don't have to handle all these cases and users will be able determine the errors are due to their custom config value 🤷‍♂️

Copy link

@skratchdot skratchdot left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -82,7 +82,7 @@
"yargs": "^15.0.1"
},
"devDependencies": {
"chromedriver": "^83.0.0",
"chromedriver": "^85.0.1",

Choose a reason for hiding this comment

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

we can change this to:

"chromedriver": "latest",

so we don't have to keep updating this value

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.

3 participants