Skip to content

Commit c70ab04

Browse files
committed
ci: add tests runs and template patch ensuring
1 parent f3a9601 commit c70ab04

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Ensure Patched Templates
2+
3+
on:
4+
pull_request:
5+
branches: [ main, dev ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v1
23+
with:
24+
version: latest
25+
26+
- name: Install dependencies
27+
run: |
28+
uv pip install pytest ruamel.yaml
29+
30+
- name: Test patch_templates target
31+
run: |
32+
make patch_templates
33+
34+
if [ -n "$(git status --porcelain)" ]; then
35+
echo "Error: Running patch_templates produced changes. Please run 'make patch_templates' locally and commit the changes."
36+
echo "git status"
37+
git status
38+
echo "git diff"
39+
git diff
40+
exit 1
41+
fi

.github/workflows/run_tests.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
branches: [ main, dev ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v1
23+
with:
24+
version: latest
25+
26+
- name: Ensure Docker Compose is installed
27+
run: docker compose --version
28+
29+
- name: Run tests
30+
run: |
31+
make tests

tests/test_labs.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ def test_labs_create_api_key(lab: Lab, lab_svc: Labs):
2626
assert res.data.startswith("standard_")
2727

2828

29+
@pytest.mark.e2e
30+
def test_labs_synced_project(lab: Lab, lab_svc: Labs):
31+
synced_proj_name = "KubeProject"
32+
synced_proj = lab.projects.get(synced_proj_name)
33+
assert synced_proj is not None
34+
assert synced_proj.api_key.startswith("standard_")
35+
assert synced_proj.project_name == "KubeProject"
36+
37+
2938
@pytest.mark.e2e
3039
def test_labs_create_project(lab: Lab, lab_svc: Labs):
3140
project_name = "test-project"

0 commit comments

Comments
 (0)