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

unit tests #848

Merged
merged 2 commits into from
Jan 11, 2024
Merged

unit tests #848

merged 2 commits into from
Jan 11, 2024

Conversation

jhsinger-klotho
Copy link
Contributor

using mocks to add unit tests

Standard checks

  • Unit tests: Any special considerations?
  • Docs: Do we need to update any docs, internal or public?
  • Backwards compatibility: Will this break existing apps? If so, what would be the extra work required to keep them working?

Copy link
Contributor

@gordon-klotho gordon-klotho left a comment

Choose a reason for hiding this comment

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

Overall, 👍 nice

Makefile Outdated
Comment on lines 34 to 35
mocks:
mockgen -source=./pkg/engine2/operational_rule/operational_rule.go --destination=./pkg/engine2/operational_eval/operational_rule_mock_test.go --package=operational_eval
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be in a go generate

ctrl := gomock.NewController(t)
opctx := NewMockOpRuleHandler(ctrl)
opctx.EXPECT().HandlePropertyRule(*rule).Return(nil).Times(1)
if err := tt.args.v.evaluateResourceOperational(tt.args.res, opctx); (err != nil) != tt.wantErr {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use assert for standardization

@jhsinger-klotho jhsinger-klotho merged commit 5c11790 into main Jan 11, 2024
@jhsinger-klotho jhsinger-klotho deleted the unit_test branch January 11, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants