8000 Adding test for pkg/chart/v2/util AsMap() by devfbe · Pull Request #11064 · helm/helm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding test for pkg/chart/v2/util AsMap() #11064

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devfbe
Copy link
@devfbe devfbe commented Jun 21, 2022

Update golangci-lint from to latest version:

Update golangci-lint from version 1.43.0 to the latest linter version 1.46.2.

This is the latest version of golangci-lint which finds new (small) errors in the source code. This linting issues have been fixed in this merge request, too.

Fixed linting issues:

Remove newline from error string in internal/test/test.go
and remove redundant nil / len(0) check from asMap() function
in pkg/chartutil/values.go. Guard this function by a unit test.

Special notes for your reviewer:
Only linting issues fixed, added unit tests for changed logic to ensure nothing breaks.

If applicable:

  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 21, 2022
@devfbe devfbe force-pushed the upgrade-linter-version branch from eec39a6 to c597c6e Compare June 21, 2022 10:33
update golangci-lint from version 1.43.0 to the
latest linter version 1.46.2.

Fixed linting issues:

Remove newline from error string in internal/test/test.go
and remove redundant nil / len(0) check from asMap() function
in pkg/chartutil/values.go. Guard this function by a unit test.

Signed-off-by: Felix Becker <git@felixbecker.name>
@devfbe devfbe force-pushed the upgrade-linter-version branch from c597c6e to 89d2d67 Compare June 21, 2022 14:06
Copy link
@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

LGTM

@hickeyma hickeyma added this to the 3.10.0 milestone Aug 29, 2022
Copy link
Contributor
@hickeyma hickeyma left a comment

Choose a reason for hiding this comment

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

@devfbe Do you mind pushing again to kick off CircleCI as uncle to restart it on my side?

@hickeyma
Copy link
Contributor

Ping @devfbe

@hickeyma hickeyma modified the milestones: 3.10.0, 3.10.1 Sep 23, 2022
@mattfarina mattfarina modified the milestones: 3.10.1, 3.10.2 Oct 12, 2022
@mattfarina mattfarina modified the milestones: 3.10.2, 3.10.3 Nov 10, 2022
@hickeyma hickeyma modified the milestones: 3.10.3, 8000 3.11.0 Dec 14, 2022
@mattfarina mattfarina modified the milestones: 3.11.0, 3.12.0 Jan 18, 2023
@joejulian joejulian modified the milestones: 3.12.0, 3.13.0 May 5, 2023
@mattfarina mattfarina modified the milestones: 3.13.0, 3.14.0 Sep 25, 2023
@mattfarina mattfarina modified the milestones: 3.14.0, 3.15.0 Mar 13, 2024
@mattfarina mattfarina modified the milestones: 3.15.0, 3.16.0 Jun 12, 2024
@scottrigby scottrigby modified the milestones: 3.16.0, 3.17.0 Sep 11, 2024
@scottrigby scottrigby modified the milestones: 3.17.0, 3.18.0 Jan 15, 2025
@scottrigby scottrigby added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 15, 2025
@scottrigby scottrigby modified the milestones: 3.18.0, 3.17.1 Jan 15, 2025
@mattfarina mattfarina modified the milestones: 3.17.1, 3.17.2 Feb 12, 2025
@scottrigby scottrigby modified the milestones: 3.17.2, 3.17.3 Mar 13, 2025
Copy link
Member
@scottrigby scottrigby left a comment

Choose a reason for hiding this comment

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

@devfbe this is quite an old one, and most of this PR is no longer applicable. However, TestAsMap() could still be added if you want to update this PR, or if someone else wants to take this on. I'll rename the PR accordingly.

10000
@@ -68,7 +68,7 @@ func (v Values) Table(name string) (Values, error) {
//
// It protects against nil map panics.
func (v Values) AsMap() map[string]interface{} {
if v == nil || len(v) == 0 {
if len(v) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

This code is already in main now

@@ -13,7 +13,7 @@ jobs:

environment:
GOCACHE: "/tmp/go/cache"
GOLANGCI_LINT_VERSION: "1.43.0"
GOLANGCI_LINT_VERSION: "1.46.2"
Copy link
Member

Choose a reason for hiding this comment

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

We have moved from CircleCI to GitHub actions. These upgrades are now handled by dependabot (example PR #30535)

@@ -25,6 +25,22 @@ import (
"helm.sh/helm/v3/pkg/chart"
)

func TestAsMap(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

One thing from this PR we do not have is a function like this to test AsMap(). This could still be added if you want to update this PR. The new file location is https://github.com/helm/helm/blob/main/pkg/chart/v2/util/values_test.go.

@@ -79,7 +79,7 @@ func compare(actual []byte, filename string) error {
}
expected = normalize(expected)
if !bytes.Equal(expected, actual) {
return errors.Errorf("does not match golden file %s\n\nWANT:\n'%s'\n\nGOT:\n'%s'\n", filename, expected, actual)
return errors.Errorf("does not match golden file %s\n\nWANT:\n'%s'\n\nGOT:\n'%s'", filename, expected, actual)
Copy link
Member

Choose a reason for hiding this comment

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

this change is already in main

@scottrigby scottrigby changed the title Update golangci-lint and fix linting issues Adding test for pkg/chart/v2/util AsMap() Mar 13, 2025
@mattfarina mattfarina modified the milestones: 3.17.3, 3.18.1 May 19, 2025
@mattfarina mattfarina modified the milestones: 3.18.1, 3.18.3 May 28, 2025
@mattfarina mattfarina modified the milestones: 3.18.3, 3.18.4 Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0