Skip to content

Commit d1802fe

Browse files
authored
Merge pull request #490 from willcl-ark/fix-logging-test-timeouts
2 parents b3f7eeb + cea6b6e commit d1802fe

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/workflows/test.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
18+
- uses: eifinger/setup-uv@v1
1919
- run: uvx ruff check .
2020

2121
ruff-format:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v4
25-
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
25+
- uses: eifinger/setup-uv@v1
2626
- run: uvx ruff format . --check
2727

2828
test:
@@ -34,10 +34,13 @@ jobs:
3434
steps:
3535
- uses: actions/checkout@v4
3636
- uses: azure/[email protected]
37-
- uses: medyagh/setup-minikube@master
38-
- name: Install uv
39-
run: |
40-
curl -LsSf https://astral.sh/uv/install.sh | sh
37+
- name: start minikube
38+
uses: medyagh/setup-minikube@latest
39+
id: minikube
40+
with:
41+
cpus: max
42+
memory: 4000m
43+
- uses: eifinger/setup-uv@v1
4144
- name: Install project
4245
run: uv sync --all-extras --dev
4346
- name: Run tests

test/logging_test.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def make_grafana_api_request(self, ds_uid, start, metric):
8080
"to": "now",
8181
}
8282
reply = requests.post("http://localhost:3000/api/ds/query", json=data)
83-
assert reply.status_code == 200
83+
if reply.status_code != 200:
84+
self.log.error(f"Grafana API request failed with status code {reply.status_code}")
85+
self.log.error(f"Response content: {reply.text}")
86+
return None
8487

8588
# Default ref ID is "A", only inspecting one "frame"
8689
return reply.json()["results"]["A"]["frames"][0]["data"]["values"]
@@ -102,6 +105,9 @@ def test_prometheus_and_grafana(self):
102105

103106
def get_five_values_for_metric(metric):
104107
data = self.make_grafana_api_request(prometheus_uid, start, metric)
108+
if data is None:
109+
self.log.info(f"Failed to get Grafana data for {metric}")
110+
return False
105111
if len(data) < 1:
106112
self.log.info(f"No Grafana data yet for {metric}")
107113
return False

0 commit comments

Comments
 (0)