Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docs
.DS_Store
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
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 \
&& apt install wget \
COPY --from=telemetrygen /telemetrygen /usr/local/bin/telemetrygen

RUN go test ./tests/integration/clients/... \
&& go test -c -o quest.test ./tests/integration \
&& apt -y update \
&& apt -y 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 -f ./k6-v0.46.0-linux-amd64.deb \
&& 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 \
&& wget https://github.com/parseablehq/pb/releases/download/v1.0.1/pb_1.0.1_linux_amd64.tar.gz \
&& tar -xzf pb_1.0.1_linux_amd64.tar.gz pb \
&& install -m 0755 pb /usr/local/bin/pb

ENTRYPOINT ["./main.sh"]
27 changes: 25 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,34 @@ 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"
if [ "$mode" = "load" ]; then
echo "Running functional and k6 load tests in parallel"
fi
run_tests
}

run_tests () {
./quest.test -test.v -test.parallel=64 "$@" -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