-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Job annotations #4600
Job annotations #4600
Conversation
* Update scale_jobs.go * Update CHANGELOG.md add annotations from scaledjob spec to job spec add new improvement to changelog Signed-off-by: Inbar <5904674+InbarRose@users.noreply.github.com>
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.
looking good! Could you add a unit test to validate the annotations?
Please, update docs as well 🙏
would be happy to add tests. |
You can use this test as example: https://github.com/kedacore/keda/blob/main/pkg/scaling/executor/scale_jobs_test.go#L202-L214 |
those are all using mocks to simulate the scaling decision. |
You don't need to generate the whole tests framework. There are other tests (I didn't link the correct one, sorry :( ) that mock the client to test only the executor: https://github.com/kedacore/keda/blob/main/pkg/scaling/executor/scale_jobs_test.go#L216-L287 You could do something similar, calling the client mock with an empty slice, implementing the Create function mock which just adds the new job to the slice, and checking the slice elements at the end of the call:
With this, you could check your code and you don't need to create the whole test framework, just adding the required mock functions is enough IMO |
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.
Agree with @JorTurFer, adding a test would be great.
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.
@InbarRose any update on this please? We are about to do a new release.
I haven't had time to add the tests. |
Implemented in: #5106 |
add annotations from scaledjob spec to job spec
add new improvement to changelog
Relates to #4594