forked from kptdev/kpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add e2e tests to exercise formatting behavior (kptdev#1966)
* Add e2e tests to exercise formatting behavior * code review
- Loading branch information
1 parent
f043a73
commit 0122271
Showing
12 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
e2e/testdata/fn-render/format-on-success/.expected/diff.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
diff --git a/db/resources.yaml b/db/resources.yaml | ||
index e405a52..64ec0ee 100644 | ||
--- a/db/resources.yaml | ||
+++ b/db/resources.yaml | ||
@@ -15,5 +15,6 @@ apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: db | ||
+ namespace: staging | ||
spec: | ||
- replicas: 3 | ||
+ replicas: 3 | ||
diff --git a/resources.yaml b/resources.yaml | ||
index 71cb6e1..cb937aa 100644 | ||
--- a/resources.yaml | ||
+++ b/resources.yaml | ||
@@ -15,11 +15,12 @@ apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
+ namespace: staging | ||
spec: | ||
replicas: 3 | ||
selector: | ||
- matchLabels: | ||
- app: nginx | ||
+ matchLabels: | ||
+ app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
@@ -27,6 +28,6 @@ spec: | ||
spec: | ||
containers: | ||
- name: nginx | ||
+ image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
- image: nginx:1.14.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kpt.dev/v1alpha2 | ||
kind: Kptfile | ||
metadata: | ||
name: app-with-db | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn/set-namespace:unstable | ||
configMap: | ||
namespace: staging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kpt.dev/v1alpha2 | ||
kind: Kptfile | ||
metadata: | ||
name: db | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn/set-namespace:unstable | ||
configMap: | ||
namespace: db |
19 changes: 19 additions & 0 deletions
19
e2e/testdata/fn-render/format-on-success/db/resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2021 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. | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: db | ||
spec: | ||
replicas: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2021 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. | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: nginx | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- name: nginx | ||
ports: | ||
- containerPort: 80 | ||
image: nginx:1.14.2 |
16 changes: 16 additions & 0 deletions
16
e2e/testdata/fn-render/no-format-on-failure/.expected/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2021 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. | ||
|
||
exitCode: 1 | ||
stdErr: 'Error: unable to parse "Kptfile"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.expected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: kpt.dev/v1alpha2 | ||
kind: Kptfile | ||
metadata: | ||
name: app-with-db | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn/set-namespace:unstable | ||
configMap: | ||
namespace: | ||
hello: world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kpt.dev/v1alpha2 | ||
kind: Kptfile | ||
metadata: | ||
name: db | ||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn/set-namespace:unstable | ||
configMap: | ||
namespace: db |
19 changes: 19 additions & 0 deletions
19
e2e/testdata/fn-render/no-format-on-failure/db/resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2021 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. | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: db | ||
spec: | ||
replicas: 3 |
26 changes: 26 additions & 0 deletions
26
e2e/testdata/fn-render/no-format-on-failure/resources.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2021 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. | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-deployment | ||
spec: | ||
replicas: 3 | ||
--- | ||
apiVersion: custom.io/v1 | ||
kind: Custom | ||
metadata: | ||
name: custom | ||
spec: | ||
image: nginx:1.2.3 |