Skip to content

Build test #251

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

Merged
merged 7 commits into from
Apr 3, 2025
Merged

Build test #251

merged 7 commits into from
Apr 3, 2025

Conversation

KaushikiAnand
Copy link
Contributor

  • I have added unit test coverage and linting to the ci.yml workflow. For more background, refer the https://hashicorp.atlassian.net/browse/IND-2338

  • The unit test coverage change was done to help understand the defects early in lifecycle and come up with a good solution for it. The linting was done to ensure that the codebase is consistent and maintainable and helps in improving the code quality and reducing errors.

@KaushikiAnand KaushikiAnand requested review from a team as code owners February 25, 2025 07:02

- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.22
Copy link

Choose a reason for hiding this comment

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

Suggestion: You can change the name of the file to *-1.22.yaml

client.go Outdated
@@ -670,7 +670,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
var doErr, respErr, checkErr, prepareErr error

for i := 0; ; i++ {
doErr, respErr, prepareErr = nil, nil, nil
//doErr, respErr, prepareErr = nil, nil, nil
Copy link

Choose a reason for hiding this comment

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

Question: Why did we need to comment out this statement ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was coming as an unused linter issue

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 commented out this statement as a part of unused linter issue.
Should I disable it like I did in previous prs?

errors <- err
return
}
}()
Copy link

Choose a reason for hiding this comment

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

Question: Was this added as a fix for lint check ?

Also, we should check if there were any errors added to errors and see if the test needs to fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this was added as a part of lint fix.

Choose a reason for hiding this comment

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

Can you check on the second part in the above comment ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

go func() {
for err := range errors {
log.Println("Received error:", err)
}
}()
on adding this I saw that error. was being passed to the errors channel, and the test is designed to fail.

@KaushikiAnand KaushikiAnand requested a review from a user March 19, 2025 08:01
errors <- err
return
}
}()

Choose a reason for hiding this comment

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

Can you check on the second part in the above comment ?

- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: 1.22

Choose a reason for hiding this comment

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

Suggestion: Both the workflows look the same to me, can you use matrix in workflow to make it a single file ?

@KaushikiAnand KaushikiAnand merged commit a881d6c into main Apr 3, 2025
5 checks passed
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