booster
booster copied to clipboard
feat: local provider scheduled command adapter unit test
Description
Changes
Checks
- [ ] Project Builds
- [ ] Project passes tests and checks
- [ ] Updated documentation accordingly
Hi @gomarcopololead, thanks for the Pull Request, could you please add a brief description of what you did and why to help us better understand your change? Thanks!! Also feel free to join our Discord channel and ask any questions there: https://discord.gg/bDY8MKx
Hi @javiertoledo
This PR is for framework-provider-local scheduled-adapter unit test and framework-provider-local-infrastructure scheduler unit test.
To test scheduled-adapter rawScheduledInputToEnvelope function, it tests if the function calls logger.debug and throws an exception for empty typeName, and finally check if it returns expected envelope result.
To test scheduler configureScheduler function, it tests if the createCronExpression function returns expected cron schedule format from buildScheduledCommandInfo function.
And finally it mocked sinon-clock time for 3 seconds to check if a mocked triggerScheduleCommand function called 3 times.
Overall this test helps to make sure schedule command works correctly at local-provider environment.
Hey, thanks for the submission! 😄
One question, any reason that we created only the local provider's tests and not for the rest of the providers? Or the issue was just about the local provider? I have no context, so that's why I'm asking 😅
Thanks again!
@javiertoledo I've implemented your request changes and idea.
Hey @NickSeagull Yes, it is only for local-provider schedule command unit test. And I think the other provider schedule command unit tests are done.
Hey @gomarcopololead looks like the unit tests are failing, can you run ./scripts/check-all-the-things.sh in the root of the repo?
I've moved the commits from this branch to a new PR on top of the current main, so closing this one https://github.com/boostercloud/booster/pull/1361