Skip to content

Commit 34610e8

Browse files
authored
Fix failing fn-eval test (#4156)
* 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]>
1 parent 72a151f commit 34610e8

File tree

6 files changed

+4
-21
lines changed

6 files changed

+4
-21
lines changed

e2e/testdata/fn-eval/invalid-fn-config-file/pkg/.expected/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ testType: eval
1616
exitCode: 1
1717
image: gcr.io/kpt-fn/set-namespace:v0.1.3
1818
fnConfig: ../../config.yaml
19-
stdErr: "wrong Node Kind for expected: MappingNode was ScalarNode: value: {I am not a valid config file}"
19+
stdErr: "wrong node kind: expected MappingNode but got ScalarNode: node contents:\nI am not a valid config file\n"

pkg/test/runner/util.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ func gitCommit(d, msg string) error {
7575
}
7676

7777
func gitDiff(d, commit1, commit2 string) (string, error) {
78-
stdout, stderr, err := runCommand(getCommand(d, "git", []string{"diff", commit1, commit2}))
78+
command := getCommand(d, "git", []string{"diff", commit1, commit2})
79+
command.Env = []string{"GIT_DIFF_OPTS="}
80+
stdout, stderr, err := runCommand(command)
7981
if err != nil {
8082
return "", fmt.Errorf("git diff error: %w, output: %s, stderr: %s", err, stdout, stderr)
8183
}

porch/controllers/go.mod

-10
This file was deleted.

porch/controllers/go.sum

Whitespace-only changes.

porch/go.mod

-9
This file was deleted.

porch/go.sum

Whitespace-only changes.

0 commit comments

Comments
 (0)