Skip to content

Commit 4526826

Browse files
committed
Run tests in CI
1 parent 70009d8 commit 4526826

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ jobs:
2424

2525
- name: Import library
2626
# This checks if we're triggering any syntax errors in older Python versions
27-
run: python -c "import mondantic"
27+
run: uv run python -c "import mondantic"
28+
29+
- name: Run tests
30+
run: uv run pytest

test/conftest.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +0,0 @@
1-
import pytest
2-
def pytest_addoption(parser: pytest.Parser):
3-
parser.addoption("--api-key", help="Monday API Key", required=False)
4-
parser.addoption("--board-id", help="Monday board ID", required=False)
5-
6-
@pytest.fixture
7-
def api_key(request: pytest.FixtureRequest) -> str:
8-
return str(request.config.getoption("--api-key"))
9-
10-
@pytest.fixture
11-
def board_id(request: pytest.FixtureRequest) -> int:
12-
return int(request.config.getoption("--board-id"))

test/test_mondantic.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from mondantic.hydrate import hydrate
44
from mondantic.query_builder import model_to_query
55
from mondantic.schema import DateValue
6+
import pytest
7+
import os
68

79
def test_graphql_query():
810
assert model_to_query(DateValue, exclude=["typename__"]).replace(" ", "").replace("\n", "") == """
@@ -30,7 +32,11 @@ def test_graphql_query():
3032
}
3133
""".replace(" ", "").replace("\n", "")
3234

33-
def test_codegen(api_key: str, board_id: int):
35+
@pytest.mark.skipif("MONDAY_API_KEY" not in os.environ or "MONDAY_BOARD_ID" not in os.environ, reason="Missing MONDAY_API_KEY or MONDAY_BOARD_ID")
36+
def test_codegen():
37+
api_key: str = os.environ["MONDAY_API_KEY"]
38+
board_id: int = int(os.environ["MONDAY_BOARD_ID"])
39+
3440
# Codegen
3541
result = codegen(board_id, api_key)
3642
cls_name = ""

0 commit comments

Comments
 (0)