forked from LaconicNetwork/kompose
fix: update part of e2e tests
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
This commit is contained in:
@@ -100,7 +100,7 @@ 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=$(diff <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $expected_output) <(yq ea '[.] | sort_by(.metadata.name) | .[] | splitDoc' $TEMP_STDOUT))
|
||||
match=$(diff <(yq -P 'sort_keys(..)' -o=props $expected_output) <(yq -P 'sort_keys(..)' -o=props $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;
|
||||
|
||||
@@ -250,7 +250,7 @@ convert::expect_success_and_warning "$k8s_cmd" "$k8s_output"
|
||||
convert::expect_success_and_warning "$os_cmd" "$os_output"
|
||||
|
||||
# Test support for compose.yaml file
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/compose-file-support/docker-compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/compose-file-support/compose.yaml convert --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/compose-file-support/output-k8s.yaml"
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output"
|
||||
|
||||
@@ -273,11 +273,6 @@ k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/network-policies/docker-c
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/network-policies/output-k8s.yaml"
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output"
|
||||
|
||||
# Test support for custom build and push images
|
||||
k8s_cmd="kompose -f $KOMPOSE_ROOT/script/test/fixtures/custom-build-push/docker-compose.yaml convert --build-command 'docker build -t ahmedgrati/kompose-test ./script/test/fixtures/custom-build-push' --push-command 'docker push ahmedgrati/kompose-test' --stdout --with-kompose-annotation=false"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/custom-build-push/output-k8s.yaml"
|
||||
convert::expect_success "$k8s_cmd" "$k8s_output"
|
||||
|
||||
# Test support for namespace generation
|
||||
k8s_cmd="kompose -f ./script/test/fixtures/namespace/docker-compose.yaml convert --stdout --with-kompose-annotation=false -n web"
|
||||
k8s_output="$KOMPOSE_ROOT/script/test/fixtures/namespace/output-k8s.yaml"
|
||||
|
||||
Reference in New Issue
Block a user