-
Notifications
You must be signed in to change notification settings - Fork 36
Add events and metadata tests #102
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
Conversation
tests/v2/libraryTest/library_test.go
Outdated
func Test_ExecCommand(t *testing.T) { | ||
testContent := commonUtils.TestContent{} | ||
testContent.CommandTypes = []schema.CommandType{schema.ExecCommandType} | ||
testContent.AddEvents = commonUtils.GetBinaryDecision() |
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.
AddEvents
randomly set event values: https://github.com/devfile/api/blob/b08e48618403f7102592389e621531145bdfcbcc/test/v200/utils/common/events-utils.go#L35
looks like you cannot control to be only Exec
or Apply
or composite
command.
Should not be under test for each particular type of command.
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.
ok, I see what you mean. SetEventValues will create extra commands that will be outside the scope of the Exec testing, so I need to narrow this down to just the commands that Exec or composite Exec supports
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.
I think the easiest thing to do in this case is what you suggested; to remove events testing in these scenarios (otherwise I'd have to introduce new functions in the api utils). I added new events test cases similar to what's being done in api tests, so that should ensure sufficient coverage.
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.
lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kim-tsao, yangcao77 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?
What issues does this PR fix or reference?
devfile/api#502
Is your PR tested? Consider putting some instruction how to test your changes
This was tested locally. Output in generated yamls and test.log were verified