Skip to content

Commit 8151146

Browse files
committed
test: introduce end-to-end app test
1 parent b1a15e9 commit 8151146

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/test-e2e.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ jobs:
7070
- name: Test | Run pytest
7171
run: ${{ inputs.run-test-command }}
7272

73+
- name: Test | Run End-to-End App Test
74+
run: ./tests/e2e_test_app.py
75+
76+
- name: Test | Check End-to-End Test Results
77+
run: [ "$(wc -l < e2e-test-app-stderr.log)" -eq 3 ] && [ "$(wc -l < e2e-test-logfile.log)" -eq 3 ] && [ ! -s "e2e-test-logfile_root.log" ]

tests/e2e_test_app.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env -S uv run --script
2+
#
3+
# /// script
4+
# requires-python = ">=3.11"
5+
# dependencies = [
6+
# "readylog",
7+
# ]
8+
#
9+
# [tool.uv.sources]
10+
# readylog = { path = "..", editable = true }
11+
# ///
12+
13+
from logging import getLogger
14+
from logging.config import dictConfig
15+
16+
from readylog import create_dict_config
17+
from readylog.decorators import debug
18+
19+
logging_configuration = create_dict_config(
20+
"e2e-test-logfile.log", "e2e-test-app", console_log_level="DEBUG"
21+
)
22+
dictConfig(logging_configuration)
23+
24+
logger = getLogger(__name__)
25+
26+
27+
@debug
28+
def greet(greeting: str, name: str) -> None:
29+
return f"{greeting.title()}, {name.title()}"
30+
31+
32+
logger.debug("e2e-test-app runs")
33+
34+
greet("hello", "world")

0 commit comments

Comments
 (0)