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

fix unit tests for mercury #12116

Merged
merged 12 commits into from
Feb 22, 2024
Merged

fix unit tests for mercury #12116

merged 12 commits into from
Feb 22, 2024

Conversation

shileiwill
Copy link
Contributor

@shileiwill shileiwill commented Feb 21, 2024

AUTO-9078

Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

}

// All feeds faced no pipeline error
// If any feed request returned an error code, return the error code with empty values, else return the values
if !allFeedsReturnedValues {
return encoding.NoPipelineError, nil, errCode, false, 0 * time.Second, reqErr
return encoding.NoPipelineError, nil, errCode, false, 0 * time.Second, nil
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we dont need the reqErr here any more?

IIUC, this reqErr is from Mercury, and when errCode is not nil, we should expect a reqErr and return it together with the errCode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didnt change this one since I am not sure. All other comments should be resolved in the most recent commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

reqErr is the pipeline error, it is coupled with Pipeline execution state being NoPipelineError.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this particular line, reqErr should be always nil since allFeedsPipelineSuccess would be true when it comes here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, I misunderstood the reqErr. It is clear to me now.

c.mercuryConfig.SetPluginRetry(pluginRetryKey, 0, cache.DefaultExpiration)
hc := new(MockHttpClient)

for i := 0; i <= 3; i++ {
Copy link
Contributor Author

@shileiwill shileiwill Feb 21, 2024

Choose a reason for hiding this comment

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

I guess having this for loop is the same as having 3 feeds in Feeds (L630), please correct me otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes i think so, this particular test can be moved to the test table, but the other tests testing multiple feed combos are not easily placed into test table

@shileiwill shileiwill changed the title fix unit tests for v02_request.go fix unit tests for mercury Feb 22, 2024
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

@infiloop2 infiloop2 merged commit a53eaff into auto-9004-stream-err-handler Feb 22, 2024
112 of 115 checks passed
@infiloop2 infiloop2 deleted the unittests branch February 22, 2024 14:17
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