Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs
17 changes: 15 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
FROM ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.158.0 AS telemetrygen

FROM golang:1.21.1-bookworm

WORKDIR /tests

COPY . .

RUN go test -c \
COPY --from=telemetrygen /telemetrygen /usr/local/bin/telemetrygen

RUN go test ./tests/integration/clients/... \
&& go test -c -o quest.test ./tests/integration \
&& apt install wget \
&& wget https://github.com/grafana/k6/releases/download/v0.46.0/k6-v0.46.0-linux-amd64.deb \
&& apt install -f ./k6-v0.46.0-linux-amd64.deb \
&& apt update \
&& apt install -y jq \
&& wget https://github.com/mingrammer/flog/releases/download/v0.4.3/flog_0.4.3_linux_amd64.tar.gz \
&& tar -xvf flog_0.4.3_linux_amd64.tar.gz \
&& cp flog /usr/local/bin
&& cp flog /usr/local/bin \
&& pb_release_url=$(wget -qO- --server-response https://github.com/parseablehq/pb/releases/latest 2>&1 | awk '/^ Location: / { url=$2 } END { sub(/\r$/, "", url); print url }') \
&& pb_version=${pb_release_url##*/v} \
&& wget https://github.com/parseablehq/pb/releases/download/v${pb_version}/pb_${pb_version}_linux_amd64.tar.gz \
&& wget https://github.com/parseablehq/pb/releases/download/v${pb_version}/pb_${pb_version}_checksums.txt \
&& grep "pb_${pb_version}_linux_amd64.tar.gz" pb_${pb_version}_checksums.txt | sha256sum -c - \
&& tar -xzf pb_${pb_version}_linux_amd64.tar.gz pb \
&& install -m 0755 pb /usr/local/bin/pb \
&& pb --help > /dev/null

ENTRYPOINT ["./main.sh"]
36 changes: 34 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,43 @@ minio_bucket=${11}
ingestor_endpoint=${12}
ingestor_username=${13}
ingestor_password=${14}
edition=${QUEST_EDITION:-oss}
stream_name=$(head /dev/urandom | tr -dc a-z | head -c10)

case "$edition" in
oss|enterprise) ;;
*)
echo "invalid QUEST_EDITION: $edition" >&2
exit 1
;;
esac

configure_pb () {
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-/tmp/quest-pb-config}"
pb profile add quest "$endpoint" "$username" "$password" -o json \
&& pb profile default quest -o json
}

run () {
./quest.test -test.v -mode="$mode" -query-url="$endpoint" -stream="$stream_name" -query-user="$username" -query-pass="$password" -minio-url="$minio_url" -minio-user="$minio_access_key" -minio-pass="$minio_secret_key" -minio-bucket="$minio_bucket" -ingestor-url="$ingestor_endpoint" -ingestor-user="$ingestor_username" -ingestor-pass="$ingestor_password"
return $?
echo "Running $edition integration tests"

load_tests='^(TestLoadStreamBatchWithK6_StaticSchema|TestLoadStreamBatchWithK6|TestLoadStreamBatchWithCustomPartitionWithK6|TestLoadStreamNoBatchWithK6|TestLoadStreamNoBatchWithCustomPartitionWithK6|TestSmokeLoadWithK6Streams)$'

if [ "$mode" = "load" ]; then
echo "Running functional integration test phase"
run_tests -test.skip="$load_tests" || return $?

echo "Running k6 load test phase"
run_tests -test.run="$load_tests"
return $?
fi

run_tests
}

run_tests () {
./quest.test -test.v -test.parallel=32 "$@" -edition="$edition" -mode="$mode" -query-url="$endpoint" -stream="$stream_name" -query-user="$username" -query-pass="$password" -minio-url="$minio_url" -minio-user="$minio_access_key" -minio-pass="$minio_secret_key" -minio-bucket="$minio_bucket" -ingestor-url="$ingestor_endpoint" -ingestor-user="$ingestor_username" -ingestor-pass="$ingestor_password"
}

configure_pb || exit $?
run
Loading
Loading