From 394be5c65aeddf7654f03afbae725cee0c9db0cd Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Thu, 27 Jan 2022 12:47:06 +1100 Subject: [PATCH] Debug github build --- acceptance_tests/empty.sh | 2 +- pkg/yqlib/operators_test.go | 8 +++++++- scripts/test.sh | 2 +- test.sh | 20 -------------------- 4 files changed, 9 insertions(+), 23 deletions(-) delete mode 100755 test.sh diff --git a/acceptance_tests/empty.sh b/acceptance_tests/empty.sh index 7ffb813f..69cd8172 100755 --- a/acceptance_tests/empty.sh +++ b/acceptance_tests/empty.sh @@ -8,7 +8,7 @@ EOL } testEmptyEval() { - X=$(./yq e test.yml) + X=$(./yq e test.yml -v) expected=$(cat test.yml) assertEquals 0 $? assertEquals "$expected" "$X" diff --git a/pkg/yqlib/operators_test.go b/pkg/yqlib/operators_test.go index cc697cf0..b43fba82 100644 --- a/pkg/yqlib/operators_test.go +++ b/pkg/yqlib/operators_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/mikefarah/yq/v4/test" + "gopkg.in/op/go-logging.v1" yaml "gopkg.in/yaml.v3" ) @@ -26,6 +27,12 @@ type expressionScenario struct { dontFormatInputForDoc bool // dont format input doc for documentation generation } +func TestMain(m *testing.M) { + logging.SetLevel(logging.ERROR, "") + code := m.Run() + os.Exit(code) +} + func NewSimpleYamlPrinter(writer io.Writer, outputFormat PrinterOutputFormat, unwrapScalar bool, colorsEnabled bool, indent int, printDocSeparators bool) Printer { return NewPrinter(NewYamlEncoder(indent, colorsEnabled, printDocSeparators, unwrapScalar), NewSinglePrinterWriter(writer)) } @@ -46,7 +53,6 @@ func readDocumentWithLeadingContent(content string, fakefilename string, fakeFil func testScenario(t *testing.T, s *expressionScenario) { var err error - node, err := NewExpressionParser().ParseExpression(s.expression) if err != nil { t.Error(fmt.Errorf("Error parsing expression %v of %v: %w", s.expression, s.description, err)) diff --git a/scripts/test.sh b/scripts/test.sh index 2ea6262d..a18392cd 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,3 +1,3 @@ #!/bin/bash -go test -v $(go list ./... | grep -v -E 'examples' | grep -v -E 'test') +go test $(go list ./... | grep -v -E 'examples' | grep -v -E 'test') diff --git a/test.sh b/test.sh deleted file mode 100755 index c4c1e3f5..00000000 --- a/test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# load array into a bash array -# need to output each entry as a single line -# readarray identityMappings < <(./yq e -o=j -I=0 '.identitymappings[]' test.yml ) - -# for identityMapping in "${identityMappings[@]}"; do -# # identity mapping is a yaml snippet representing a single entry -# roleArn=$(echo "$identityMapping" | yq e '.arn' -) -# echo "roleArn: $roleArn" -# done - - - - -while IFS=$'\t' read -r roleArn group user _; do - echo "Role: $roleArn" - echo "Group: $group" - echo "User: $user" -done < <(yq -j read test.yaml \ - | jq -r '.identitymappings[] | [.arn, .group, .user] | @tsv') \ No newline at end of file