Skip to content

Commit

Permalink
test: fix change detection in integration tests (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebradil authored Apr 20, 2024
1 parent 2520648 commit 419318e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ tasks:
cmds:
- |
export PATH="{{.ROOT_DIR}}/bin:$PATH"
go test -failfast -race ./...
go test -failfast -race ./... {{.CLI_ARGS}}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ directories:
contents:
- path: .
directory:
name: render-test
path: ../charts/render-test-chart
8 changes: 4 additions & 4 deletions internal/integration/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ func findRepos(t *testing.T, basefolder string) []testRepo {

func checkCleanGit(t *testing.T) bool {
t.Helper()
changes, err := myks.GetChangedFilesGit("")
changedFiles, err := myks.GetChangedFilesGit("")
if err != nil {
t.Fatalf("Checking git failed: %s", err)
}
regex, _ := regexp.Compile("examples/.*/rendered/.*")
for _, change := range changes {
if regex.MatchString(change) {
t.Logf("Found changed files in rendered output: %v", changes)
for file := range changedFiles {
if regex.MatchString(file) {
t.Logf("Found changed files in rendered output: %v", file)
t.Errorf("Unexpected changes in git status")
return false
}
Expand Down

0 comments on commit 419318e

Please sign in to comment.