Skip to content

Commit

Permalink
attach ginkgo label filter to logs that are shipped
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Aug 29, 2024
1 parent 8d3d37f commit 3442328
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions hack/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ helm_install_shippers() {
Set E2E_RUN_REF $e2e_run_ref
Set E2E_RUN_ID $e2e_run_id
Set E2E_RUN_ATTEMPT $e2e_run_attempt
Set GINKGO_LABEL_FILTER $ginkgo_label_filter
EOF
)

Expand Down
5 changes: 3 additions & 2 deletions hack/run-e2e-using-kind-dummy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ source ./hack/functions.sh

trap "cleanup_kind_cluster" EXIT

declare -r ginkgo_nodes=${GINKGO_NODES:-12}
declare -r ginkgo_nodes=${GINKGO_NODES:-6}
declare -r docker=$(which docker)
declare -r humio_e2e_license=${HUMIO_E2E_LICENSE}
declare -r e2e_run_ref=${GITHUB_REF:-outside-github-$(hostname)}
declare -r e2e_run_id=${GITHUB_RUN_ID:-none}
declare -r e2e_run_attempt=${GITHUB_RUN_ATTEMPT:-none}
declare -r ginkgo_label_filter=dummy
declare -r humio_hostname=${E2E_LOGS_HUMIO_HOSTNAME:-none}
declare -r humio_ingest_token=${E2E_LOGS_HUMIO_INGEST_TOKEN:-none}
declare -r docker_username=${DOCKER_USERNAME:-none}
Expand Down Expand Up @@ -44,6 +45,6 @@ wait_for_pod -l app.kubernetes.io/name=cainjector
wait_for_pod -l app.kubernetes.io/name=webhook

$kubectl create -k config/crd/
$kubectl run test-pod --env="HUMIO_E2E_LICENSE=$humio_e2e_license" --env="E2E_LOGS_HUMIO_HOSTNAME=$humio_hostname" --env="E2E_LOGS_HUMIO_INGEST_TOKEN=$humio_ingest_token" --env="E2E_RUN_ID=$e2e_run_id" --env="GINKGO_NODES=$ginkgo_nodes" --env="DOCKER_USERNAME=$docker_username" --env="DOCKER_PASSWORD=$docker_password" --restart=Never --image=testcontainer --image-pull-policy=Never -- sleep 86400
$kubectl run test-pod --env="HUMIO_E2E_LICENSE=$humio_e2e_license" --env="GINKGO_NODES=$ginkgo_nodes" --env="DOCKER_USERNAME=$docker_username" --env="DOCKER_PASSWORD=$docker_password" --restart=Never --image=testcontainer --image-pull-policy=Never -- sleep 86400
while [[ $($kubectl get pods test-pod -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" ; $kubectl describe pod test-pod ; sleep 1 ; done
$kubectl exec test-pod -- hack/run-e2e-within-kind-test-pod-dummy.sh
3 changes: 2 additions & 1 deletion hack/run-e2e-using-kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ declare -r humio_e2e_license=${HUMIO_E2E_LICENSE}
declare -r e2e_run_ref=${GITHUB_REF:-outside-github-$(hostname)}
declare -r e2e_run_id=${GITHUB_RUN_ID:-none}
declare -r e2e_run_attempt=${GITHUB_RUN_ATTEMPT:-none}
declare -r ginkgo_label_filter=real
declare -r humio_hostname=${E2E_LOGS_HUMIO_HOSTNAME:-none}
declare -r humio_ingest_token=${E2E_LOGS_HUMIO_INGEST_TOKEN:-none}
declare -r docker_username=${DOCKER_USERNAME:-none}
Expand Down Expand Up @@ -48,6 +49,6 @@ wait_for_pod -l app.kubernetes.io/name=cainjector
wait_for_pod -l app.kubernetes.io/name=webhook

$kubectl create -k config/crd/
$kubectl run test-pod --env="HUMIO_E2E_LICENSE=$humio_e2e_license" --env="E2E_LOGS_HUMIO_HOSTNAME=$humio_hostname" --env="E2E_LOGS_HUMIO_INGEST_TOKEN=$humio_ingest_token" --env="E2E_RUN_ID=$e2e_run_id" --env="GINKGO_NODES=$ginkgo_nodes" --env="DOCKER_USERNAME=$docker_username" --env="DOCKER_PASSWORD=$docker_password" --env="HUMIO_OPERATOR_DEFAULT_HUMIO_CORE_IMAGE=$humio_operator_default_humio_core_image" --restart=Never --image=testcontainer --image-pull-policy=Never -- sleep 86400
$kubectl run test-pod --env="HUMIO_E2E_LICENSE=$humio_e2e_license" --env="GINKGO_NODES=$ginkgo_nodes" --env="DOCKER_USERNAME=$docker_username" --env="DOCKER_PASSWORD=$docker_password" --env="HUMIO_OPERATOR_DEFAULT_HUMIO_CORE_IMAGE=$humio_operator_default_humio_core_image" --restart=Never --image=testcontainer --image-pull-policy=Never -- sleep 86400
while [[ $($kubectl get pods test-pod -o 'jsonpath={..status.conditions[?(@.type=="Ready")].status}') != "True" ]]; do echo "waiting for pod" ; $kubectl describe pod test-pod ; sleep 1 ; done
$kubectl exec test-pod -- hack/run-e2e-within-kind-test-pod.sh
2 changes: 1 addition & 1 deletion hack/run-e2e-within-kind-test-pod-dummy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -x -o pipefail
source hack/functions.sh

# We skip the helpers package as those tests assumes the environment variable USE_CERT_MANAGER is not set.
USE_CERTMANAGER=true TEST_USE_EXISTING_CLUSTER=true DUMMY_LOGSCALE_IMAGE=true ginkgo --label-filter=dummy -timeout 20m -nodes=$GINKGO_NODES --no-color --skip-package helpers -race -v ./controllers/suite/... -covermode=count -coverprofile cover.out -progress | tee /proc/1/fd/1
USE_CERTMANAGER=true TEST_USE_EXISTING_CLUSTER=true DUMMY_LOGSCALE_IMAGE=true ginkgo --label-filter=dummy -timeout 1h -nodes=$GINKGO_NODES --no-color --skip-package helpers -race -v ./controllers/suite/... -covermode=count -coverprofile cover.out -progress | tee /proc/1/fd/1

0 comments on commit 3442328

Please sign in to comment.