Skip to content

Commit

Permalink
Fix failing fn-eval test (#4156)
Browse files Browse the repository at this point in the history
* Fix failing fn-eval test

The format was changed in upstream kyaml/fn version in
kubernetes-sigs/kustomize#4727.

Signed-off-by: Fredrik Sommar <[email protected]>

* Run git diff without options in tests

I had issues running tests since it was using my custom settings for
`git diff`, resulting in mismatch when evaluating diffs.

I also had to prefix my commands with `env
DOCKER_DEFAULT_PLATFORM=linux/amd64` because I'm on Apple Silicon.
Otherwise, the warning output for platform mismatch also resulted in
false negatives.

Signed-off-by: Fredrik Sommar <[email protected]>

* Remove porch go.* files

Signed-off-by: Fredrik Sommar <[email protected]>

---------

Signed-off-by: Fredrik Sommar <[email protected]>
  • Loading branch information
fsommar authored May 28, 2024
1 parent 72a151f commit 34610e8
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ testType: eval
exitCode: 1
image: gcr.io/kpt-fn/set-namespace:v0.1.3
fnConfig: ../../config.yaml
stdErr: "wrong Node Kind for expected: MappingNode was ScalarNode: value: {I am not a valid config file}"
stdErr: "wrong node kind: expected MappingNode but got ScalarNode: node contents:\nI am not a valid config file\n"
4 changes: 3 additions & 1 deletion pkg/test/runner/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func gitCommit(d, msg string) error {
}

func gitDiff(d, commit1, commit2 string) (string, error) {
stdout, stderr, err := runCommand(getCommand(d, "git", []string{"diff", commit1, commit2}))
command := getCommand(d, "git", []string{"diff", commit1, commit2})
command.Env = []string{"GIT_DIFF_OPTS="}
stdout, stderr, err := runCommand(command)
if err != nil {
return "", fmt.Errorf("git diff error: %w, output: %s, stderr: %s", err, stdout, stderr)
}
Expand Down
10 changes: 0 additions & 10 deletions porch/controllers/go.mod

This file was deleted.

Empty file removed porch/controllers/go.sum
Empty file.
9 changes: 0 additions & 9 deletions porch/go.mod

This file was deleted.

Empty file removed porch/go.sum
Empty file.

0 comments on commit 34610e8

Please sign in to comment.