-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Updated to print out number of archived files #7465 #11175
Conversation
jtpetty
commented
Aug 21, 2019
- Number is capped to a small number to prevent spamming the console
- Added initial L0 test suite for ArchiveFiles
- Number is capped to a small number to prevent spamming the console - Added initial L0 test suite for ArchiveFiles
Tasks/ArchiveFilesV2/Tests/L0.ts
Outdated
|
||
tl.setResourcePath(path.join( __dirname, '..', 'task.json')); | ||
cases.forEach(function(numberOfFiles) { | ||
it('plan for ' + numberOfFiles + ' files', (done: MochaDone) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the description more informative? Hard to deduce from the description what this is testing.
Can we add a screenshot here of what the output looks like? |
Need to update minor version in task.json and task.loc.json. |
console.log(line); | ||
}); | ||
|
||
tl.debug('Listing all ' + files.length + ' files to archive:'); | ||
for (var i = 0; i < files.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are already iterating and debugging the files here can we combine the two into this one method and just check if we are below the max number of files we want to always print and console.log? Then print the "more files" message if files.length > maxNumberOfLinesToLog
?
Then the iterating and printing is all together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i probably over complicated it by trying to encapsulate the output into a testable method and did not want to inadvertently mess up the debug output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep it as its own method, just change the plan.push
calls to console.log
statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I understand what you are suggesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nevermind. I was suggesting pushing the logging into the function and not returning an object, realize now that we lose the testability with that approach. I'm fine with it as is.
Tasks/ArchiveFilesV2/task.json
Outdated
@@ -18,8 +18,8 @@ | |||
"demands": [], | |||
"version": { | |||
"Major": 2, | |||
"Minor": 151, | |||
"Patch": 2 | |||
"Minor": 152, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention that people use is to make it the number of the sprint the change is made it. I am not sure I entirely agree but that's how it's done :)
console.log(line); | ||
}); | ||
|
||
tl.debug('Listing all ' + files.length + ' files to archive:'); | ||
for (var i = 0; i < files.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can keep it as its own method, just change the plan.push
calls to console.log
statements