Skip to content

Commit

Permalink
Updates continue-on-error e2e test case (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
seans3 committed Feb 8, 2021
1 parent 34bc5a8 commit 998d233
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 10 deletions.
22 changes: 12 additions & 10 deletions e2e/live/end-to-end-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,18 @@ assertPodExists "pod-c" "test-namespace"
assertPodExists "pod-d" "test-namespace"
printResult

# Test 19: Basic kpt live destroy
# Test 19: kpt live apply continue-on-error
echo "Testing continue-on-error"
echo "kpt live apply e2e/live/testdata/continue-on-error"
${BIN_DIR}/kpt live apply e2e/live/testdata/continue-on-error > $OUTPUT_DIR/status
assertCMInventory "test-namespace" "2"
assertContains "pod/pod-a created"
assertContains "pod/pod-B failed"
assertPodExists "pod-a" "test-namespace"
assertPodNotExists "pod-B" "test-namespace"
printResult

# Test 20: Basic kpt live destroy
# "test-case-1b" directory is "test-case-1a" directory with "pod-a" removed and "pod-d" added.
echo "Testing basic destroy"
echo "kpt live destroy e2e/live/testdata/test-case-1b"
Expand All @@ -871,15 +882,6 @@ assertPodNotExists "pod-c" "test-namespace"
assertPodNotExists "pod-d" "test-namespace"
printResult

# Test 20: kpt live apply continue-on-error
echo "Testing continue-on-error"
echo "kpt live apply e2e/live/testdata/continue-on-error"
${BIN_DIR}/kpt live apply e2e/live/testdata/continue-on-error > $OUTPUT_DIR/status
assertCMInventory "test-namespace" "1"
assertPodExists "pod-a" "test-namespace"
assertPodNotExists "pod-B" "test-namespace"
printResult

# Clean-up the k8s cluster
echo "Cleaning up cluster"
kind delete cluster
Expand Down
14 changes: 14 additions & 0 deletions e2e/live/testdata/continue-on-error/inventory-template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: auto-generated. Some fields should NOT be modified.
# Date: 2021-01-15 15:23:11 PST
#
Expand Down
14 changes: 14 additions & 0 deletions e2e/live/testdata/continue-on-error/pod-a.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This pod description should be valid and is expected to successfully deploy

apiVersion: v1
Expand Down
14 changes: 14 additions & 0 deletions e2e/live/testdata/continue-on-error/pod-b.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This pod definition has errors and will fail to deploy

apiVersion: v1
Expand Down

0 comments on commit 998d233

Please sign in to comment.