Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
fix: gets prometheus url from runtime config file
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurDinalli authored and fczuardi committed Feb 28, 2024
1 parent 5826f27 commit 02ff885
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ COPY justfile /app/justfile
COPY run_tests.sh /app/run_tests.sh
COPY requirements.txt /app/requirements.txt
COPY LICENSE /app/LICENSE
COPY config.yaml /app/config.yaml
RUN pip install --no-cache-dir --no-dependencies -r requirements.txt
RUN mkdir /app/config
ENTRYPOINT ["just", "-f", "/app/justfile"]
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ oci_manager := env_var_or_default("DBX_CONTAINER_MANAGER", fallback_cm)
k6_vus := "1"
k6_iterations := "1"

# Reads Prometheus RW server URL from config.yaml
prometheus_rw_url := `dasel -f "./config.yaml" 'prometheus_rw_url'`


# OCI
main_image := "ghcr.io/marmotitude/object-storage-tests:main"
Expand Down Expand Up @@ -184,12 +183,13 @@ _setup: _setup-rclone _setup-aws _setup-mgc
# run k6 test with env vars and outputs to JSON and Prometheus if url is set
_k6-run remote testname results_dir *args:
#!/usr/bin/env sh
prometheus_rw_url := `dasel -f "{{config_file}}" 'prometheus_rw_url'`
prometheus_output_arg=""
if [ -n "{{prometheus_rw_url}}" ]; then
if [ -n "$prometheus_rw_url" ]; then
echo "prometheus_rw_url is set and not empty"
prometheus_output_arg="--out=experimental-prometheus-rw"
fi
K6_PROMETHEUS_RW_SERVER_URL="{{prometheus_rw_url}}" \
K6_PROMETHEUS_RW_SERVER_URL="$prometheus_rw_url" \
k6 run src/k6/{{testname}}.js \
--address localhost:0 \
--tag "remote={{remote}}" \
Expand Down

0 comments on commit 02ff885

Please sign in to comment.