-
Notifications
You must be signed in to change notification settings - Fork 17
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
Optimized test case execution time && Tests to verify the api endpoint. #58
base: main
Are you sure you want to change the base?
Conversation
@Ashrockzzz2003 @Abhinav-ark Can u review this? |
Will review soon @venkatesh21bit |
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.
Overall the optimization looks good. Nice work @venkatesh21bit.
Love the async
idea.
Please look into the changes suggested.
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 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 was thinking of an optimization that we could do, which I think will reduce the time.
We can precompute the SHA256 hash of templates and hardcode it as a const
. We can use this to compare in tests. This way, only once the SHA256 hash will be computed. Can you try this one?
You'll get 5 more bonus points.
const hashes
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.
It's bcoz of different directory structures it will generate different hashes Its good we go back to the way it was |
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.
LGTM
I'm still not convinced that template test imports are part of qse
.
@Abhinav-ark please take a look.
Do note that comparing to the latest test invocation from main
, speed has improved.
Previously it took 13s, now 7s Awesome @venkatesh21bit
@Ashrockzzz2003 what do u mean by 'template test imports are part of qse'. The test case for template is only the server.test file . The other tests inside the test dir are for the qse commands . |
Express and supertest are now part of package.json of the cli tool just for the sake of running tests. |
Fixes #27
What I did?
For Optimization:
I logged the time taken for computehash func and command execution func and found that it took more time for the command execution .
So I changed some synchronus func to async
It worked!!
A test file for the api endpoint is also added