Fix: Make the out flag print to one file using seperator (#1541)
* fix: make the out flag print to one file using seperator * fix: comment an unused function * fix: update test script * fix: update output k8s * fix: update the json output error condition * fix: update envvars interpolation tests * chore: update e2e tests to support yaml generation instead of JSON format * fix: update e2e tests according to ci environment * fix: apply PR changes
This commit is contained in:
@@ -100,13 +100,11 @@ function convert::match_output() {
|
||||
convert::run_cmd $cmd
|
||||
exit_status=$?
|
||||
if [ $exit_status -ne 0 ]; then FAIL_MSGS=$FAIL_MSGS"exit status: $exit_status\n"; return $exit_status; fi
|
||||
|
||||
match=$(jq --argfile a $TEMP_STDOUT --argfile b $expected_output -n 'def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b')
|
||||
$cmd > /tmp/test.json
|
||||
diff /tmp/test.json $expected_output > /tmp/diff
|
||||
rm /tmp/test.json
|
||||
if [ "$match" = true ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
|
||||
else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; cat /tmp/diff; rm /tmp/diff; return 1; fi
|
||||
match=$(diff <(yq -P 'sort_keys(....)' $expected_output) <(yq -P 'sort_keys(....)' $TEMP_STDOUT))
|
||||
echo "$match" > /tmp/diff
|
||||
if [ "$match" == "" ]; then SUCCESS_MSGS=$SUCCESS_MSGS"converted output matches\n"; return 0;
|
||||
else FAIL_MSGS=$FAIL_MSGS"converted output does not match\n"; cat /tmp/diff; rm /tmp/diff; return 1;
|
||||
fi
|
||||
}
|
||||
readonly -f convert::match_output
|
||||
|
||||
@@ -221,4 +219,4 @@ function convert::check_artifacts_generated() {
|
||||
convert::teardown
|
||||
return $exit_status
|
||||
}
|
||||
readonly -f convert::check_artifacts_generated
|
||||
readonly -f convert::check_artifacts_generated
|
||||
|
||||
Reference in New Issue
Block a user