Skip to content

Commit 8bf55db

Browse files
authored
Synchronize the build scripts/config/docs with apache-airflow repo (#105)
1 parent 11726ed commit 8bf55db

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,14 @@ configuration = airflow_client.client.Configuration(
571571
)
572572
```
573573

574+
* Run scheduler (or dag file processor you have setup with standalone dag file processor) for few parsing
575+
loops (you can pass --num-runs parameter to it or keep it running in the background). The script relies
576+
on example DAGs being serialized to the DB and this only
577+
happens when scheduler runs with ``core/load_examples`` set to True.
578+
579+
* Run webserver - reachable at the host/port for the test script you want to run. Make sure it had enough
580+
time to initialize.
581+
574582
Run `python test_python_client.py` and you should see colored output showing attempts to connect and status.
575583

576584

pyproject.toml

+16-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ Homepage = "https://airflow.apache.org/"
6565
[tool.hatch.envs.test]
6666
dependencies = [
6767
"pytest-cov>=2.8.1",
68-
"python_dateutil >= 2.5.3",
6968
"urllib3 >= 1.25.3",
7069
]
7170

7271
[tool.hatch.envs.test.scripts]
73-
run-coverage = "pytest --cov-config=pyproject.toml --cov=airflow_client test --color=yes"
72+
run-coverage = "pytest test"
7473
run = "run-coverage --no-cov"
7574

7675
[[tool.hatch.envs.test.matrix]]
@@ -103,3 +102,18 @@ artifacts = [
103102
include = [
104103
"/airflow_client",
105104
]
105+
106+
[tool.pytest.ini_options]
107+
# make sure that pytest.ini is not read from pyproject.toml in paraent directories
108+
addopts = "--color=yes --cov-config=pyproject.toml --cov=airflow_client"
109+
norecursedirs = [
110+
]
111+
log_level = "INFO"
112+
filterwarnings = [
113+
]
114+
python_files = [
115+
"test_*.py",
116+
]
117+
testpaths = [
118+
"test",
119+
]

test_python_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
from __future__ import annotations
2828

29+
import sys
2930
import uuid
3031

3132
import airflow_client.client
@@ -124,5 +125,6 @@
124125

125126
if errors:
126127
print("\n[red]There were errors while running the script - see above for details")
128+
sys.exit(1)
127129
else:
128130
print("\n[green]Everything went well")

0 commit comments

Comments
 (0)