This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-client-python.git
The following commit(s) were added to refs/heads/main by this push:
new 8bf55db Synchronize the build scripts/config/docs with apache-airflow
repo (#105)
8bf55db is described below
commit 8bf55dbc64d72ea318027c49ceda8d59490494c2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Jan 14 17:56:50 2024 +0100
Synchronize the build scripts/config/docs with apache-airflow repo (#105)
---
README.md | 8 ++++++++
pyproject.toml | 18 ++++++++++++++++--
test_python_client.py | 2 ++
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 6ac3d23..dc8fd40 100644
--- a/README.md
+++ b/README.md
@@ -571,6 +571,14 @@ configuration = airflow_client.client.Configuration(
)
```
+* Run scheduler (or dag file processor you have setup with standalone dag file
processor) for few parsing
+ loops (you can pass --num-runs parameter to it or keep it running in the
background). The script relies
+ on example DAGs being serialized to the DB and this only
+ happens when scheduler runs with ``core/load_examples`` set to True.
+
+* Run webserver - reachable at the host/port for the test script you want to
run. Make sure it had enough
+ time to initialize.
+
Run `python test_python_client.py` and you should see colored output showing
attempts to connect and status.
diff --git a/pyproject.toml b/pyproject.toml
index a8a0e5b..59022ef 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -65,12 +65,11 @@ Homepage = "https://airflow.apache.org/"
[tool.hatch.envs.test]
dependencies = [
"pytest-cov>=2.8.1",
- "python_dateutil >= 2.5.3",
"urllib3 >= 1.25.3",
]
[tool.hatch.envs.test.scripts]
-run-coverage = "pytest --cov-config=pyproject.toml --cov=airflow_client test
--color=yes"
+run-coverage = "pytest test"
run = "run-coverage --no-cov"
[[tool.hatch.envs.test.matrix]]
@@ -103,3 +102,18 @@ artifacts = [
include = [
"/airflow_client",
]
+
+[tool.pytest.ini_options]
+# make sure that pytest.ini is not read from pyproject.toml in paraent
directories
+addopts = "--color=yes --cov-config=pyproject.toml --cov=airflow_client"
+norecursedirs = [
+]
+log_level = "INFO"
+filterwarnings = [
+]
+python_files = [
+ "test_*.py",
+]
+testpaths = [
+ "test",
+]
diff --git a/test_python_client.py b/test_python_client.py
index ea0f42d..d36f6d1 100644
--- a/test_python_client.py
+++ b/test_python_client.py
@@ -26,6 +26,7 @@
from __future__ import annotations
+import sys
import uuid
import airflow_client.client
@@ -124,5 +125,6 @@ with airflow_client.client.ApiClient(configuration) as
api_client:
if errors:
print("\n[red]There were errors while running the script - see above
for details")
+ sys.exit(1)
else:
print("\n[green]Everything went well")