Skip to content

Commit 69b32b5

Browse files
committed
Build tess
1 parent 6aad19d commit 69b32b5

File tree

2 files changed

+19
-32
lines changed

2 files changed

+19
-32
lines changed

.github/workflows/run_tests.yml

+2-29
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,7 @@ jobs:
115115
--cov-report=term-missing:skip-covered \
116116
--cov-report=xml:coverage.xml \
117117
--cov=tesseract_core \
118-
--cov-omit=tests/tutorial/*
119-
120-
- name: Run tutorial tests
121-
if: runner.os != 'Windows'
122-
run: |
123-
uv run --no-sync pytest \
124-
--skip-endtoend \
125-
--cov-report=term-missing:skip-covered \
126-
--cov-report=xml:coverage.xml \
127-
--cov=tesseract_core \
128-
tests/tutorial \
129-
--tesseract-dir \
130-
tests/tutorial/example_data/bootcamp
118+
--tesseract-dir=tests/tutorial/example_data/bootcamp
131119
132120
- name: Run test suite (Windows)
133121
if: runner.os == 'Windows'
@@ -139,22 +127,7 @@ jobs:
139127
--cov-report=term-missing:skip-covered \
140128
--cov-report=xml:coverage.xml \
141129
--cov=tesseract_core \
142-
--cov-omit=tests/tutorial/*
143-
144-
- name: Run tutorial tests (Windows)
145-
if: runner.os == 'Windows'
146-
shell: wsl-bash {0}
147-
run: |
148-
export PATH="$HOME/venv/bin:$PATH"
149-
uv run --no-sync pytest \
150-
--skip-endtoend \
151-
--cov-report=term-missing:skip-covered \
152-
--cov-report=xml:coverage.xml \
153-
--cov=tesseract_core \
154-
tests/tutorial \
155-
--tesseract-dir \
156-
tests/tutorial/example_data/bootcamp
157-
130+
--tesseract-dir=tests/tutorial/example_data/bootcamp
158131
159132
- name: Upload coverage reports to Codecov
160133
uses: codecov/[email protected]

tests/tutorial/test_bootcamp.py

+17-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_00_tesseract_init(tesseract_dir: Path) -> None:
3838
assert run_res.stdout
3939

4040

41-
def test_01a_tesseract_schema(tesseract_dir: Path) -> None:
41+
def test_01a_tesseract_schema(tesseract_dir: Path, docker_cleanup) -> None:
4242
"""Test for step 1 of the bootcamp tutorial.
4343
4444
Validate the input and output schema of the Tesseract.
@@ -55,6 +55,7 @@ def test_01a_tesseract_schema(tesseract_dir: Path) -> None:
5555
)
5656
assert run_res.exit_code == 0, run_res.stderr
5757
assert run_res.stdout
58+
docker_cleanup["images"].append(BOOTCAMP_IMAGE_NAME)
5859

5960
test_commands = ("input-schema", "output-schema")
6061
for command in test_commands:
@@ -76,7 +77,7 @@ def test_01a_tesseract_schema(tesseract_dir: Path) -> None:
7677
assert '"type":"string"' in run_res.stdout
7778

7879

79-
def test_01b_tesseract_apply(tesseract_dir: Path) -> None:
80+
def test_01b_tesseract_apply(tesseract_dir: Path, docker_cleanup) -> None:
8081
"""Test for step 2 of the bootcamp tutorial.
8182
8283
Validate that the apply function is correctly implemented.
@@ -91,6 +92,7 @@ def test_01b_tesseract_apply(tesseract_dir: Path) -> None:
9192
)
9293
assert run_res.exit_code == 0, run_res.stderr
9394
assert run_res.stdout
95+
docker_cleanup["images"].append(BOOTCAMP_IMAGE_NAME)
9496

9597
# Check that the apply function is implemented
9698
# Convert numbers to words
@@ -106,12 +108,24 @@ def test_01b_tesseract_apply(tesseract_dir: Path) -> None:
106108
assert "hello tesseract" in run_res.stdout
107109

108110

109-
def test_02_tesseract_packagedata() -> None:
111+
def test_02_tesseract_packagedata(tesseract_dir: Path, docker_cleanup) -> None:
110112
"""Test for step 3 of the bootcamp tutorial.
111113
112114
Call the apply function on secret_message.json and check that
113115
the output is correct.
114116
"""
117+
run_res = cli_runner.invoke(
118+
app,
119+
[
120+
"build",
121+
tesseract_dir,
122+
],
123+
catch_exceptions=False,
124+
)
125+
assert run_res.exit_code == 0, run_res.stderr
126+
assert run_res.stdout
127+
docker_cleanup["images"].append(BOOTCAMP_IMAGE_NAME)
128+
115129
data_dir = Path(__file__).parent / "example_data"
116130
run_res = cli_runner.invoke(
117131
app,

0 commit comments

Comments
 (0)