-
Notifications
You must be signed in to change notification settings - Fork 80
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
Testsuite improvements #3555
Testsuite improvements #3555
Conversation
5de9253
to
8a1403a
Compare
8a1403a
to
b20da8b
Compare
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 these are great improvements. Just a couple of comments / questions more than changes request. I ran the suite several times, I had the exportRoutes
timeout in one of the runs, but could not replicate it again, so it may have been an intermittent test or something just hanging up on my end.
app/api/files/filesystem.ts
Outdated
uploadedDocuments: `${__dirname}/specs/uploads/`, | ||
attachments: `${__dirname}/specs/uploads/`, | ||
customUploads: `${__dirname}/specs/customUploads/`, | ||
customUploads: `${__dirname}/specs/uploads/`, | ||
temporalFiles: `${__dirname}/specs/uploads/`, |
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 this is potentially dangerous. Having all test paths be identical means that you could 'use' the wrong path or interchange the paths in the tests and they will pass nonetheless. I believe that was the intent of having 'customUploads' be a different path. Should we create a tech debt issue with this? Or do you think it is not worth it?
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.
@RafaPolit i have reverted the customUploads path, its now /specs/customUploads again, for the others i think the issue described still remains, we should create a tech debt.
@@ -26,8 +27,9 @@ describe('upload routes', () => { | |||
let req; | |||
let file; | |||
|
|||
const deleteAllFiles = cb => { | |||
const directory = `${__dirname}/uploads/`; | |||
const deleteAllFiles = async cb => { |
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.
There are more calls to deleteAllFiles
in this spec that are not being awaited. They have a done
inside that could cause the same effect, but maybe for consistency add the await on those calls? (currently lines 88 and 186)
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.
Good catch, the 2 calls are now properly awaited
app/api/files/filesystem.ts
Outdated
uploadedDocuments: `${__dirname}/specs/uploads/${subPath}`, | ||
attachments: `${__dirname}/specs/uploads/${subPath}`, | ||
customUploads: `${__dirname}/specs/uploads/${subPath}`, | ||
temporalFiles: `${__dirname}/specs/uploads/${subPath}`, |
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.
Same concern as above,! Maybe this solves it if we are using only one at a time in each test?
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.
this was not being used anymore actually, it has been removed now.
7df7ec9
to
d6a3528
Compare
LGTM |
fixes: #3561
PR checklist:
QA checklist: