-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: improve scripts for semi-manual testing
- Loading branch information
Showing
14 changed files
with
157 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Test Scripts | ||
============ | ||
|
||
The scripts in this folder are meant for running semi-manual tests. | ||
They deploy the operator and applications under monitoring - this part is automated via scripts. | ||
Whether the instrumentation was successful or not needs to be verified manually. | ||
This can also be tested in a fully automated way by the tests in `test/e2e`. |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
target_namespace=${1:-default} | ||
|
||
if [[ "${target_namespace}" == default ]]; then | ||
exit 0 | ||
fi | ||
|
||
if ! kubectl get ns ${target_namespace} &> /dev/null; then | ||
kubectl create ns ${target_namespace} | ||
fi |
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 |
---|---|---|
@@ -1,10 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
|
||
cd "$(dirname ${BASH_SOURCE})"/../.. | ||
|
||
kubectl delete -k config/samples || true | ||
target_namespace=${1:-default} | ||
|
||
kubectl delete -n ${target_namespace} -k config/samples || true | ||
make uninstall || true | ||
make undeploy || true | ||
test-resources/node.js/express/undeploy.sh | ||
test-resources/collector/undeploy.sh | ||
test-resources/node.js/express/undeploy.sh ${target_namespace} | ||
test-resources/collector/undeploy.sh ${target_namespace} |
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 |
---|---|---|
@@ -1,44 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})"/../.. | ||
|
||
echo Make sure cert-manager is deployed as well: | ||
echo test-resources/cert-manager/deploy.sh | ||
if ! kubectl get ns cert-manager &> /dev/null; then | ||
echo cert-manager namespace not found, deploying cert-manager | ||
test-resources/cert-manager/deploy.sh | ||
fi | ||
|
||
target_namespace=${1:-default} | ||
|
||
echo "STEP 1: creating target namespace (if necessary)" | ||
test-resources/bin/ensure-namespace-exists.sh ${target_namespace} | ||
|
||
echo STEP 1: remove old test resources | ||
test-resources/bin/test-cleanup.sh | ||
echo "STEP 2: remove old test resources" | ||
test-resources/bin/test-cleanup.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 2: deploy the collector | ||
test-resources/collector/deploy.sh | ||
echo "STEP 3: deploy the collector to namespace ${target_namespace}" | ||
test-resources/collector/deploy.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 3: rebuild the operator image | ||
echo "STEP 4: rebuild the operator image" | ||
make docker-build | ||
echo | ||
echo | ||
|
||
echo STEP 4: deploy application under monitoring | ||
test-resources/node.js/express/build-and-deploy.sh | ||
echo "STEP 5: deploy application under monitoring" | ||
test-resources/node.js/express/build-and-deploy.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 5: install the custom resource definition | ||
echo "STEP 6: install the custom resource definition" | ||
make install | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 6: deploy the Dash0 custom resource to the target namespace | ||
kubectl apply -k config/samples | ||
echo "STEP 7: deploy the Dash0 custom resource to namespace ${target_namespace}" | ||
kubectl apply -n ${target_namespace} -k config/samples | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 7: deploy the Dash0 operator | ||
make deploy | ||
echo "STEP 8: deploy the Dash0 operator" | ||
make deploy |
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 |
---|---|---|
@@ -1,44 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})"/../.. | ||
|
||
echo Make sure cert-manager is deployed as well: | ||
echo test-resources/cert-manager/deploy.sh | ||
if ! kubectl get ns cert-manager &> /dev/null; then | ||
echo cert-manager namespace not found, deploying cert-manager | ||
test-resources/cert-manager/deploy.sh | ||
fi | ||
|
||
target_namespace=${1:-default} | ||
|
||
echo "STEP 1: creating target namespace (if necessary)" | ||
test-resources/bin/ensure-namespace-exists.sh ${target_namespace} | ||
|
||
echo STEP 1: remove old test resources | ||
test-resources/bin/test-cleanup.sh | ||
echo "STEP 2: remove old test resources" | ||
test-resources/bin/test-cleanup.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 2: deploy the collector | ||
test-resources/collector/deploy.sh | ||
echo "STEP 3: deploy the collector to namespace ${target_namespace}" | ||
test-resources/collector/deploy.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 3: rebuild the operator image | ||
echo "STEP 4: rebuild the operator image" | ||
make docker-build | ||
echo | ||
echo | ||
|
||
echo STEP 4: deploy application under monitoring | ||
test-resources/node.js/express/build-and-deploy.sh | ||
echo "STEP 5: deploy application under monitoring" | ||
test-resources/node.js/express/build-and-deploy.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 5: install the custom resource definition | ||
echo "STEP 6: install the custom resource definition" | ||
make install | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 6: deploy the Dash0 operator | ||
echo "STEP 7: deploy the Dash0 operator" | ||
make deploy | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 7: deploy the Dash0 custom resource to the target namespace | ||
kubectl apply -k config/samples | ||
echo "STEP 8: deploy the Dash0 custom resource to namespace ${target_namespace}" | ||
kubectl apply -n ${target_namespace} -k config/samples |
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 |
---|---|---|
@@ -1,46 +1,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})"/../.. | ||
|
||
echo Make sure cert-manager is deployed as well: | ||
echo test-resources/cert-manager/deploy.sh | ||
if ! kubectl get ns cert-manager &> /dev/null; then | ||
echo cert-manager namespace not found, deploying cert-manager | ||
test-resources/cert-manager/deploy.sh | ||
fi | ||
|
||
target_namespace=${1:-default} | ||
|
||
echo "STEP 1: creating target namespace (if necessary)" | ||
test-resources/bin/ensure-namespace-exists.sh ${target_namespace} | ||
|
||
echo STEP 1: remove old test resources | ||
test-resources/bin/test-cleanup.sh | ||
echo "STEP 2: remove old test resources" | ||
test-resources/bin/test-cleanup.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 2: deploy the collector | ||
test-resources/collector/deploy.sh | ||
echo "STEP 3: deploy the collector to namespace ${target_namespace}" | ||
test-resources/collector/deploy.sh ${target_namespace} | ||
echo | ||
echo | ||
|
||
echo STEP 3: rebuild the operator image | ||
echo "STEP 4: rebuild the operator image" | ||
make docker-build | ||
echo | ||
echo | ||
|
||
echo STEP 4: install the custom resource definition | ||
echo "STEP 5: install the custom resource definition" | ||
make install | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 5: deploy the Dash0 operator | ||
echo "STEP 6: deploy the Dash0 operator" | ||
make deploy | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 6: deploy the Dash0 custom resource to the target namespace | ||
kubectl apply -k config/samples | ||
echo "STEP 7: deploy the Dash0 custom resource to namespace ${target_namespace}" | ||
kubectl apply -n ${target_namespace} -k config/samples | ||
echo | ||
echo | ||
|
||
sleep 5 | ||
|
||
echo STEP 7: deploy application under monitoring | ||
test-resources/node.js/express/build-and-deploy.sh | ||
echo "STEP 8: deploy application under monitoring" | ||
test-resources/node.js/express/build-and-deploy.sh ${target_namespace} |
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})" | ||
|
||
|
||
echo undeploying | ||
echo "removing any left-overs from previous cert-manager installations (if any)" | ||
./undeploy.sh | ||
|
||
echo deploying cert-manager | ||
echo "deploying cert-manager and waiting for it to become ready, this might take up to five minutes" | ||
helm install \ | ||
cert-manager jetstack/cert-manager \ | ||
--namespace cert-manager \ | ||
--create-namespace \ | ||
--version v1.14.5 \ | ||
--set installCRDs=true \ | ||
--timeout 10s | ||
--timeout 5m |
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})" | ||
|
||
helm uninstall dash0-opentelemetry-collector-daemonset --ignore-not-found | ||
target_namespace=${1:-default} | ||
|
||
helm uninstall dash0-opentelemetry-collector-daemonset --namespace ${target_namespace} --ignore-not-found |
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})" | ||
|
||
target_namespace=${1:-default} | ||
|
||
if [[ -z ${SKIP_DOCKER_BUILD:-} ]]; then | ||
docker build . -t dash0-operator-nodejs-20-express-test-app | ||
fi | ||
|
||
kubectl delete -f deploy.yaml || true | ||
kubectl apply -f deploy.yaml | ||
./undeploy.sh ${target_namespace} | ||
kubectl apply -n ${target_namespace} -f deploy.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
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: Copyright 2024 Dash0 Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -euo pipefail | ||
|
||
cd "$(dirname ${BASH_SOURCE})" | ||
|
||
kubectl delete -f deploy.yaml || true | ||
target_namespace=${1:-default} | ||
|
||
kubectl delete -n ${target_namespace} -f deploy.yaml || true |