Skip to content

Commit

Permalink
remove unset TEST_NAMESPACE
Browse files Browse the repository at this point in the history
Signed-off-by: ryanohnemus <[email protected]>
  • Loading branch information
ryanohnemus committed Feb 5, 2024
1 parent 0cb622f commit 4398fae
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
3 changes: 1 addition & 2 deletions tests/chunk-rollover/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

function teardown() {
Expand Down Expand Up @@ -68,7 +67,7 @@ DETIK_CLIENT_NAMESPACE="${TEST_NAMESPACE}"

COUNTER=0

kubectl wait pods -n "$TEST_NAMESPACE" -l app.kubernetes.io/name=fluent-bit --for condition=Ready --timeout=30s
kubectl wait pods -n "$TEST_NAMESPACE" -l app.kubernetes.io/name=fluent-bit --for condition=Ready --timeout=60s

while [ $COUNTER -lt $TOTAL_TIME ]; do
# Get the number of Fluent Bit DaemonSet pods that are not in the "Running" status
Expand Down
1 change: 0 additions & 1 deletion tests/elasticsearch/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

# These are required for bats-detik
Expand Down
1 change: 0 additions & 1 deletion tests/elasticsearch/compress.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

# These are required for bats-detik
Expand Down
1 change: 0 additions & 1 deletion tests/kubernetes-plugins/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

setup() {
Expand Down
1 change: 0 additions & 1 deletion tests/kubernetes-plugins/full.bats
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

setup() {
Expand Down
3 changes: 1 addition & 2 deletions tests/opensearch/basic.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function teardown_file() {
run kubectl delete namespace "$TEST_NAMESPACE"
rm -f ${HELM_VALUES_EXTRA_FILE}
fi
unset TEST_NAMESPACE
}

function teardown() {
Expand Down Expand Up @@ -79,7 +78,7 @@ DETIK_CLIENT_NAMESPACE="${TEST_NAMESPACE}"
try "at most 15 times every 2s " \
"to find 1 pods named 'fluent-bit' " \
"with 'status' being 'running'"

attempt=0
while true; do
run kubectl exec -q -n $TEST_NAMESPACE opensearch-cluster-master-0 -- curl --insecure -s -w "%{http_code}" https://admin:admin@localhost:9200/fluentbit/_search/ -o /dev/null
Expand Down
8 changes: 3 additions & 5 deletions tests/opensearch/hosted.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ load "$BATS_ASSERT_ROOT/load.bash"
load "$BATS_FILE_ROOT/load.bash"

setup_file() {
if [[ $HOSTED_OPENSEARCH_HOST == "localhost" ]]; then
skip "Skipping Hosted OpenSearch When 'HOSTED_OPENSEARCH_HOST=localhost'"
fi
export TEST_NAMESPACE=${TEST_NAMESPACE:-opensearch-hosted}
echo "recreating namespace $TEST_NAMESPACE"
run kubectl delete namespace "$TEST_NAMESPACE"
Expand All @@ -28,7 +31,6 @@ teardown_file() {
rm -f ${BATS_TEST_DIRNAME}/resources/helm/fluentbit-hosted.yaml
fi
fi
unset TEST_NAMESPACE
}

function teardown() {
Expand All @@ -45,10 +47,6 @@ DETIK_CLIENT_NAMESPACE="${TEST_NAMESPACE}"


@test "test fluent-bit forwards logs to AWS OpenSearch hosted service default index" {
if [[ $HOSTED_OPENSEARCH_HOST == "localhost" ]]; then
skip "Skipping Hosted OpenSearch When 'HOSTED_OPENSEARCH_HOST=localhost'"
fi

envsubst < "${BATS_TEST_DIRNAME}/resources/helm/fluentbit-hosted.yaml.tpl" > "${BATS_TEST_DIRNAME}/resources/helm/fluentbit-hosted.yaml"

helm upgrade --install --debug --create-namespace --namespace "$TEST_NAMESPACE" fluent-bit fluent/fluent-bit \
Expand Down

0 comments on commit 4398fae

Please sign in to comment.