booster icon indicating copy to clipboard operation
booster copied to clipboard

feat: local provider scheduled command adapter unit test

Open hackykitty opened this issue 3 years ago • 5 comments

Description

Changes

Checks

  • [ ] Project Builds
  • [ ] Project passes tests and checks
  • [ ] Updated documentation accordingly

hackykitty avatar Jun 03 '22 16:06 hackykitty

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

javiertoledo avatar Jun 06 '22 15:06 javiertoledo

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.

hackykitty avatar Jun 06 '22 16:06 hackykitty

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!

NickSeagull avatar Jun 07 '22 09:06 NickSeagull

@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.

hackykitty avatar Jun 07 '22 11:06 hackykitty

Hey @gomarcopololead looks like the unit tests are failing, can you run ./scripts/check-all-the-things.sh in the root of the repo?

NickSeagull avatar Jul 05 '22 10:07 NickSeagull

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

javiertoledo avatar Feb 28 '23 17:02 javiertoledo