-
Notifications
You must be signed in to change notification settings - Fork 1
add e2e tests: label based routing works #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
102d249
feat(otel col conf gen): add logging/debug
OverOrion 57fa7d5
fix(otel col conf gen): routing statement quoting
OverOrion c53d165
refactor(otel col conf gen): move debugging exporter to routing root
OverOrion 9ec226f
feat(otel col conf gen): add note regarding crio parser
OverOrion 9a58936
feat(test): add e2e test
OverOrion a80ae41
fix(test): simplify e2e test
OverOrion ea2ed60
docs(examples): rename another-subscription to subscription-2 for eas…
OverOrion 81f5d49
feat(test): use docs/example for e2e test
OverOrion 6595583
feat(e2e): simplify script
OverOrion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
File renamed without changes.
This file contains hidden or 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,74 @@ | ||
| #!/bin/env bash | ||
|
|
||
| set -eou pipefail | ||
|
|
||
| create_if_does_not_exist() { | ||
| local resource_type=$1 | ||
| local resource_name=$2 | ||
| kubectl create "${resource_type}" "${resource_name}" --dry-run=client -o yaml | kubectl apply -f- | ||
| } | ||
|
|
||
| KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME_E2E:-so-e2e} | ||
| # Backup current kubernetes context | ||
| CURRENT_K8S_CTX=$(kubectl config view | grep "current" | cut -f 2 -d : | xargs) | ||
|
|
||
| # Prepare env | ||
| kind create cluster --name "${KIND_CLUSTER_NAME}" --wait 5m | ||
| kubectl config set-context kind-"${KIND_CLUSTER_NAME}" | ||
|
|
||
| # Install prerequisites | ||
|
|
||
| helm upgrade \ | ||
| --install \ | ||
| --repo https://charts.jetstack.io \ | ||
| cert-manager cert-manager \ | ||
| --namespace cert-manager \ | ||
| --create-namespace \ | ||
| --version v1.13.3 \ | ||
| --set installCRDs=true \ | ||
| --wait | ||
|
|
||
| kubectl apply -f https://github.com/open-telemetry/opentelemetry-operator/releases/latest/download/opentelemetry-operator.yaml --wait | ||
| echo "Wait until otel operator pod is in ready state..." | ||
| kubectl wait --namespace opentelemetry-operator-system --for=condition=available deployment/opentelemetry-operator-controller-manager --timeout=300s | ||
|
|
||
| # Create subscription operator resources | ||
| (cd .. && make manifests generate install) | ||
|
|
||
| # Use example | ||
| kubectl apply -f ../docs/examples/simple-demo | ||
|
|
||
|
|
||
| (cd .. && timeout 5m make run &) | ||
|
|
||
| # Create log-generator | ||
| helm install --wait --create-namespace --namespace example-tenant-ns --generate-name oci://ghcr.io/kube-logging/helm-charts/log-generator | ||
|
|
||
|
|
||
| # Check for received messages - subscription-sample | ||
| while | ||
| echo "Checking for subscription-sample-1 in deployments/receiver-collector logs" | ||
| kubectl logs --namespace example-tenant-ns deployments/receiver-collector | grep -q "subscription-sample-1" | ||
|
|
||
| [[ $? -ne 0 ]] | ||
| do true; done | ||
|
|
||
| # Check for received messages - subscription-sample-2 | ||
| while | ||
| echo "Checking for subscription-sample-2 in deployments/receiver-collector logs" | ||
| kubectl logs --namespace example-tenant-ns deployments/receiver-collector | grep -q "subscription-sample-2" | ||
|
|
||
| [[ $? -ne 0 ]] | ||
| do true; done | ||
|
|
||
| echo "E2E test: PASSED" | ||
|
|
||
|
|
||
| # Check if cluster should be removed, ctx restored | ||
| if [[ -z "${NO_KIND_CLEANUP}" ]]; then | ||
| kind delete cluster --name "${KIND_CLUSTER_NAME}" | ||
| fi | ||
|
|
||
| if [[ "${CURRENT_K8S_CTX}" != "" ]]; then | ||
| kubectl config get-contexts -o name | grep -q "${CURRENT_K8S_CTX}" && kubectl config set-context "${CURRENT_K8S_CTX}" | ||
| fi | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.