From 3a240aa0a900f4048a88862184165b7465b0bdd4 Mon Sep 17 00:00:00 2001 From: Robert Szefler Date: Fri, 5 Jul 2024 13:19:34 +0200 Subject: [PATCH] the Prometheus <-> tests connection --- .github/workflows/test-prometrix.yml | 15 +++++++++------ tests/config_github_kind.yaml | 11 +++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test-prometrix.yml b/.github/workflows/test-prometrix.yml index 18ffdc2..cff5a29 100644 --- a/.github/workflows/test-prometrix.yml +++ b/.github/workflows/test-prometrix.yml @@ -16,7 +16,6 @@ jobs: with: python-version: 3.8 - # setup a KIND cluster with Prometheus - name: Create k8s Kind Cluster uses: helm/kind-action@v1.2.0 - name: Install Prometheus @@ -34,17 +33,21 @@ jobs: kubectl get namespaces echo "=== PODS ===" kubectl get pods --all-namespaces - echo "=== PROMETHEUS NS ===" - kubectl get all --namespace prometheus - # install Prometrix so that we can run tests on it - name: Install Prometrix run: | curl -sSL https://install.python-poetry.org | python3 - --version 1.4.0 poetry config virtualenvs.create false poetry install --with test - # run the actual tests - - name: Test Prometrix + - name: Setup Prometrix <-> Github runner tunnel + uses: vbem/k8s-port-forward@v1 + with: + workload: 'service/kind-prometheus-kube-prome-prometheus' + mappings: 9090:9090 + options: '-n prometheus' + + - name: Run Prometrix tests run: | +# kubectl port-forward -n prometheus service/kind-prometheus-kube-prome-prometheus 9090:9090 python tests/main.py tests/config_github_kind.yaml diff --git a/tests/config_github_kind.yaml b/tests/config_github_kind.yaml index 08c4c46..3c54a2b 100644 --- a/tests/config_github_kind.yaml +++ b/tests/config_github_kind.yaml @@ -1,9 +1,8 @@ testConfig: - type: "PrometheusConfig" params: - url: - disable_ssl: - headers: - prometheus_auth: - prometheus_url_query_string: - additional_labels: + url: localhost:9090 + # headers: + # prometheus_auth: + # prometheus_url_query_string: + # additional_labels: