Skip to content

Commit

Permalink
Synchronize the build scripts/config/docs with apache-airflow repo (#105
Browse files Browse the repository at this point in the history
)
  • Loading branch information
potiuk authored Jan 14, 2024
1 parent 11726ed commit 8bf55db
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
18 changes: 16 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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",
]
2 changes: 2 additions & 0 deletions test_python_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

from __future__ import annotations

import sys
import uuid

import airflow_client.client
Expand Down Expand Up @@ -124,5 +125,6 @@

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")

0 comments on commit 8bf55db

Please sign in to comment.