-
Notifications
You must be signed in to change notification settings - Fork 14
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
[RFR] Update dependency check #221
base: main
Are you sure you want to change the base?
Conversation
408232a
to
7c149f8
Compare
a1b321a
to
9ab8743
Compare
Signed-off-by: Nandini Chandra <[email protected]>
Signed-off-by: Nandini Chandra <[email protected]>
9ab8743
to
0be6135
Compare
I saw the need for such change after that Igor reported this regression bug: https://issues.redhat.com/browse/MTA-4169 |
Hi @aufi , Thanks for reviewing the PR. I noticed that when dependencies(or tags) are not specified for a test and when the API request response returns dependencies (or tags), the test still passes . The code changes address this scenario. I'd like to clarify that an analysis test will still pass when dependencies (or tags) are not specified in the test iff the API response request returns the dependency/tag count as zero. |
t.Errorf("\nDifferent dependency error. Got %+v\nExpected %+v.\n\n", got, expected) | ||
} | ||
// Check dependencies | ||
if (len(gotAnalysis.Dependencies) == 0 && len(tc.Analysis.Dependencies) == 0) { |
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.
if (len(gotAnalysis.Dependencies) == 0 && len(tc.Analysis.Dependencies) == 0) { | |
if tc.Analysis.Dependencies != nil { |
To make it possible not to check dependencies in one case and check an expected empty list in other case, please see my suggestion above |
The following scenario is currently not checked . This PR addresses the missing scenario -
When dependencies are not specified in the test and the API request response returns dependencies .
Before fix,
When dependencies are not specified in the test and the API request response returns dependencies , the test passed.
After fix,
When dependencies are not specified in the test and the API request response returns dependencies , the test fails.
Note: An analysis test will still pass when dependencies are not specified in the test and if the API response request returns an empty list for dependencies. The fix doesn't change this behavior.