Skip to content
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

feat: local provider scheduled command adapter unit test #1095

Closed

Conversation

hackykitty
Copy link

Description

Changes

Checks

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

@javiertoledo
Copy link
Member

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

Copy link
Member

@javiertoledo javiertoledo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gomarcopololead I left a few suggestions and ideas. Please take into account that some new commits have been added to main since you open this PR that might affect your code, so you might want to rebase it to make sure that tests still work. Thanks!

@hackykitty
Copy link
Author

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 hackykitty requested a review from javiertoledo June 6, 2022 16:48
@NickSeagull
Copy link
Member

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!

@hackykitty
Copy link
Author

hackykitty commented Jun 7, 2022

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

Copy link
Member

@javiertoledo javiertoledo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, your code looks good! I think that we could add a few more tests to check a wider range of scenarios, but that can be done in a new PR.

@boostercloud boostercloud locked and limited conversation to collaborators Jul 5, 2022
@boostercloud boostercloud unlocked this conversation Jul 5, 2022
@NickSeagull
Copy link
Member

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

@javiertoledo
Copy link
Member

I've moved the commits from this branch to a new PR on top of the current main, so closing this one #1361

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants