Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

chore(tests): Add cloud ops data tests #932

Merged
merged 35 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
265d2cf
chore(tests): added extra tests for cloud ops resources
daniel-sanche May 25, 2022
164997d
made changes for broken tests
daniel-sanche May 25, 2022
744b7c9
sandboxctl test works in any directory
daniel-sanche May 25, 2022
0918ec4
removed extra line
daniel-sanche May 25, 2022
034c4f7
reorded tests
daniel-sanche May 25, 2022
e6daa58
added note to RELEASING.md
daniel-sanche May 25, 2022
ca22ca9
reverted project number code
daniel-sanche May 25, 2022
30dff49
use single list of services
daniel-sanche Jun 1, 2022
217e4f1
refactored SLO code into one place
daniel-sanche Jun 1, 2022
f7ca323
added sleep to recommendationservice test
daniel-sanche Jun 2, 2022
51ab5de
Merge branch 'develop' into add_tests
daniel-sanche Jun 2, 2022
6c96f55
increase timeout
daniel-sanche Jun 2, 2022
b52e75e
longer sleep
daniel-sanche Jun 2, 2022
d11d144
add --user to pip install in e2e tests
daniel-sanche Jun 2, 2022
c86bd7a
added missing comma
daniel-sanche Jun 2, 2022
8b894b8
Merge branch 'develop' into add_tests
daniel-sanche Jun 2, 2022
cc57cb8
Merge branch 'develop' into add_tests
daniel-sanche Jun 2, 2022
4bf8329
changed sre recipe test
daniel-sanche Jun 2, 2022
3c71a02
reverted
daniel-sanche Jun 3, 2022
84240bc
increate checkoutservice allowed latency
daniel-sanche Jun 3, 2022
e4946ae
fixed cleanup script
daniel-sanche Jun 3, 2022
9c90405
fixed variable names
daniel-sanche Jun 3, 2022
1f05782
reordered tests
daniel-sanche Jun 3, 2022
91b7d06
removed log based metrics dashboard
daniel-sanche Jun 3, 2022
cd8c63f
added retry logic for slo data retrival
daniel-sanche Jun 3, 2022
2f94e0b
added code to loadgen test to restart pods before starting
daniel-sanche Jun 3, 2022
9514858
Merge branch 'develop' into add_tests
daniel-sanche Jun 14, 2022
ba99ac9
montoring test changes for istio
daniel-sanche Jun 14, 2022
f631a50
Merge branch 'develop' into add_tests
daniel-sanche Jun 14, 2022
bd67a12
fixed gke hub deletion in clean up script
daniel-sanche Jun 14, 2022
e4b966f
removed pod restart
daniel-sanche Jun 14, 2022
e6a5e5f
Merge branch 'develop' into add_tests
daniel-sanche Jun 14, 2022
03c450d
changed retry logic
daniel-sanche Jun 14, 2022
4df8a66
adjusting test parameters
daniel-sanche Jun 14, 2022
d1a14dc
skip slo tests in CI
daniel-sanche Jun 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/e2e-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
Expand All @@ -124,7 +124,7 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/ratingservice/requirements.txt
python3 -m pip install --user -r tests/ratingservice/requirements.txt
# get service URL
RATING_SERVICE_URL="https://ratingservice-dot-$(gcloud app describe --format='value(defaultHostname)' --project=${{ env.PROJECT_ID }})"
# run test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
# change to previous release code state
cd ./release-code
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/requirements.txt
python3 -m pip install --user -r tests/requirements.txt
# authenticate cluster
CLUSTER_ZONE=$(gcloud container clusters list --filter="name:cloud-ops-sandbox" --project ${{ env.PROJECT_ID }} --format="value(zone)")
gcloud container clusters get-credentials cloud-ops-sandbox --zone "$CLUSTER_ZONE"
Expand All @@ -143,7 +143,7 @@ jobs:
run: |
set -x
# install dependencies
python3 -m pip install -r tests/ratingservice/requirements.txt
python3 -m pip install --user -r tests/ratingservice/requirements.txt
# get service URL
RATING_SERVICE_URL="https://ratingservice-dot-$(gcloud app describe --format='value(defaultHostname)' --project=${{ env.PROJECT_ID }})"
# run test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e_scripts/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ for INSTANCE_NAME in $(gcloud sql instances list --project=$PROJECT_ID --format=
done

# delete GKE hub clusters
for MEMBER_NAME in $(gcloud container fleet memberships list --format="value(NAME)"); do
for MEMBER_NAME in $(gcloud beta container hub memberships list --format="value(NAME)"); do
echo "deleting GKE hub membership $MEMBER_NAME"
gcloud beta container hub memberships delete $MEMBER_NAME --quiet
done
1 change: 1 addition & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ There are two artifacts that make up a Cloud Operations Sandbox release:
- a new git tag should have been pushed for the new release version
- updated container images (hipstershop services, loadgenerator, cloud shell container) should be pushed in the [`stackdriver-sandbox-230822` GCR repo](http://console.cloud.google.com/gcr/images/stackdriver-sandbox-230822)
1. Review the new release pull request.
- Hint: use `sandboxctl test` to run tests on a live, newly-created sandbox environment
- If any issues arise, delete the branch and tag, push new changes to develop, and start the release process again (see [Reverting Faulty Releases](#reverting-faulty-releases))
1. When the PR has been reviewed and thoroughly tested, merge it into main
- Don't squash; we want to keep the git history
Expand Down
21 changes: 21 additions & 0 deletions sre-recipes/sandboxctl
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,26 @@ def destroy():
destroy_command = "../terraform/destroy.sh"
utils.run_interactive_shell_command(destroy_command)

@cli.command()
@click.option('--skip-ratingservice', default=False, is_flag=True,
help="Don't test the ratingservice")
def test(skip_ratingservice):
"""Run tests to ensure environment is working as expected"""
os.chdir(os.path.abspath(sys.path[0]))
command = "../tests/run_tests.sh"
if skip_ratingservice:
command = f'SKIP_RATINGS_TEST=TRUE {command}'
os.setpgrp()
complete = False
try:
# run install.sh in a background shell
process = subprocess.Popen(command, bufsize=0, shell=True)
process.communicate()
complete = True
finally:
# kill background process if script is terminated
if not complete:
os.killpg(0, signal.SIGTERM)

if __name__ == "__main__":
cli()
2 changes: 1 addition & 1 deletion terraform/monitoring/03_services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ variable "istio_services" {
availability_goal = 0.9
availability_burn_rate = 2
latency_goal = 0.9
latency_threshold = 1000
latency_threshold = 2000
latency_burn_rate = 2
},
{
Expand Down
Loading