Skip to content

Commit

Permalink
Cleanup and more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petteja committed May 15, 2024
1 parent b527775 commit a401734
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
44 changes: 43 additions & 1 deletion tests-integration/knada.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
use_uv_pip_install=True,
)
py_op_uv = python_operator(
dag=dag,
Expand All @@ -34,6 +33,16 @@
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
)

nb_op_uv = notebook_operator(
dag=dag,
name="nb-op",
repo="navikt/dataverk-airflow",
nb_path="tests-integration/notebooks/mynb.ipynb",
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
use_uv_pip_install=True,
)

Expand All @@ -50,6 +59,21 @@
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
)

quarto_op_uv = quarto_operator(
dag=dag,
name="quarto-op",
repo="navikt/dataverk-airflow",
quarto={
"path": "tests-integration/notebooks/quarto.ipynb",
"env": "dev",
"id": "bf48d8a4-05ca-47a5-a360-bc24171baf62",
"token": Variable.get("quarto_token"),
},
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
use_uv_pip_install=True,
)

Expand All @@ -66,11 +90,29 @@
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
)

quarto_book_op_uv = quarto_operator(
dag=dag,
name="quarto-book-op",
repo="navikt/dataverk-airflow",
quarto={
"folder": "tests-integration/notebooks/quartobook",
"env": "dev",
"id": "757da08e-031e-4fac-a5f0-fffe6d2d96b6",
"token": Variable.get("quarto_token"),
},
requirements_path="tests-integration/notebooks/requirements.txt",
retries=0,
startup_timeout_seconds=60,
use_uv_pip_install=True,
)

py_op
py_op_uv
nb_op
nb_op_uv
quarto_op
quarto_op_uv
quarto_book_op
quarto_book_op_uv
3 changes: 2 additions & 1 deletion tests/test_kubernetes_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ def test_that_uv_is_used_for_pip_install(self, dag):
use_uv_pip_install=True)

assert container.arguments == [
"uv pip install -r /workspace/requirements.txt --no-cache-dir && python script.py"]
f"uv venv .local",
f". .local/bin/activate && uv pip install -r /workspace/requirements.txt --no-cache-dir && python script.py"]

0 comments on commit a401734

Please sign in to comment.