-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add templates for recipe test files, and update Contribution.md.
* Add template and instruction for new recipe test in test/README.md. * Update Contribution.md and README.md for newly created recipes.
- Loading branch information
Showing
6 changed files
with
140 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 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. | ||
|
||
set -o errexit; | ||
set -o nounset; | ||
set -o pipefail; | ||
set -o xtrace; | ||
|
||
source ./test/helper.sh | ||
# TODO: Fill in your test name here. | ||
# test_name="TEST_NAME" | ||
context=$(get_context "${test_name}") | ||
|
||
if [[ ! -z "${context}" ]]; then | ||
# TODO: Delete the k8s resources. | ||
# Use `|| true` to make sure the command won't failed due to resources not exist. | ||
kubectl --context "${context}" delete -f YOUR_YAML.yaml -n "${test_name}" || true | ||
kubectl --context "${context}" delete namespace "${test_name}" || true | ||
fi | ||
|
||
# TODO: Delete any additional resources created during setup. | ||
# gcloud ... | ||
|
||
cleanup_gke_basic "${test_name}" "${ZONE}" "${REGION}" |
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,33 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 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. | ||
|
||
set -o errexit; | ||
set -o nounset; | ||
set -o pipefail; | ||
set -o xtrace; | ||
|
||
source ./test/helper.sh | ||
# TODO: Fill in your test name here. | ||
# test_name="TEST_NAME" | ||
context=$(get_context "${test_name}") | ||
|
||
if [[ -z "${context}" ]]; then | ||
exit 1 | ||
fi | ||
|
||
# TODO: Validate traffic here. | ||
vip=... | ||
check_http_status "${vip}" ... ... |
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,36 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2023 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. | ||
|
||
set -o errexit; | ||
set -o nounset; | ||
set -o pipefail; | ||
set -o xtrace; | ||
|
||
source ./test/helper.sh | ||
# TODO: Fill in your test name here. | ||
# test_name="TEST_NAME" | ||
# TODO: You can use setup_gke_basic for common test setup, or define your own test setup. | ||
# setup_gke_basic "${test_name}" "${ZONE}" "${REGION}" | ||
context=$(get_context "${test_name}") | ||
|
||
if [[ -z "${context}" ]]; then | ||
exit 1 | ||
fi | ||
|
||
kubectl --context "${context}" create namespace "${test_name}" | ||
# TODO: Add any addition setup if needed(gcloud, kubectl, etc.), and deploy the k8s resources. | ||
# gcloud ... | ||
# kubectl --context "${context}" apply -f YOUR_YAML.yaml -n "${test_name}" |