Skip to content

Commit

Permalink
fix(validator): tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimeph committed Dec 7, 2024
1 parent e066909 commit 8dbaa62
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-go@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: true

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: true
Expand All @@ -30,12 +30,11 @@ jobs:
- name: Run unit tests
run: go test ./... -v -race -coverprofile=coverage.txt -covermode=atomic

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
slug: jaimeph/helm-lint-kcl

lint:
name: Lint
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jaimeph/helm-lint-kcl

go 1.23.2
go 1.23

require (
github.com/spf13/cobra v1.8.1
Expand Down
12 changes: 6 additions & 6 deletions internal/logger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ func SetLevelDebug(active bool) {
}

func Infof(message string, args ...interface{}) {
fmt.Printf(" INFO "+message+"\n", args...)
fmt.Printf(message+"\n", args...)
}

func Info(message string) {
fmt.Println(" INFO " + message)
fmt.Println(message)
}

func Debugf(message string, args ...interface{}) {
if level >= LevelDebug {
fmt.Printf("DEBUG "+message+"\n", args...)
fmt.Printf(message+"\n", args...)
}
}

func Debug(message string) {
if level >= LevelDebug {
fmt.Println("DEBUG " + message)
fmt.Println(message)
}
}

func Errorf(message string, args ...interface{}) {
fmt.Printf("ERROR "+message+"\n", args...)
fmt.Printf(message+"\n", args...)
}

func Error(message string) {
fmt.Println("ERROR " + message)
fmt.Println(message)
}
4 changes: 2 additions & 2 deletions internal/validator/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func TestValidate(t *testing.T) {
}{
{
name: "valid input",
values: LoadFileToBytes("tests/test1.k"),
schemas: LoadFileToBytes("tests/test1.yaml"),
values: LoadFileToBytes("tests/test1.yaml"),
schemas: LoadFileToBytes("tests/test1.k"),
wantErr: false,
},
{
Expand Down
2 changes: 1 addition & 1 deletion internal/validator/tests/test1.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
podspec:
tests:
containers:
mycontainer:
enabled: false
image:
Expand Down

0 comments on commit 8dbaa62

Please sign in to comment.