Skip to content

Commit 2948a7a

Browse files
committed
Support focused reusable test sessions
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
1 parent a072713 commit 2948a7a

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

docs/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ For a focused change, run just the relevant session:
4242
nox -R -s lint -- durabletask/client.py tests/durabletask/test_client.py
4343
nox -R -s typecheck_core -- durabletask/client.py examples/history_export
4444
nox -R -s typecheck_functions -- azure-functions-durable/azure
45-
nox -R -s core_tests-3.10 -- tests/durabletask/test_client.py -k "schedule"
45+
nox -R -s core_tests-3.10 -- tests/durabletask/test_client.py::test_get_grpc_channel_insecure
4646
nox -R -s azuremanaged_tests-3.10 -- tests/durabletask-azuremanaged/test_dts_orchestration_e2e.py
4747
nox -R -s functions_unit-3.13 -- tests/azure-functions-durable/test_client_compat.py
4848
nox -R -s functions_e2e -- -k "dtask_client"

noxfile.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,15 @@ def core_tests(session: nox.Session) -> None:
294294
)
295295
try:
296296
session.install("-r", "requirements.txt")
297-
session.install(f"{REPO_ROOT}[azure-blob-payloads]", "aiohttp")
298-
session.run("pytest", "tests/durabletask", "-m", "not dts", "--verbose")
297+
session.install("-e", f"{REPO_ROOT}[azure-blob-payloads]", "aiohttp")
298+
targets = session.posargs or ("tests/durabletask",)
299+
session.run(
300+
"pytest",
301+
*targets,
302+
"-m",
303+
"not dts",
304+
"--verbose",
305+
)
299306
finally:
300307
_stop_process(azurite)
301308

@@ -315,7 +322,8 @@ def azuremanaged_tests(session: nox.Session) -> None:
315322
"-e",
316323
str(AZUREMANAGED),
317324
)
318-
session.run("pytest", "tests/durabletask-azuremanaged", "-m", "dts", "--verbose")
325+
targets = session.posargs or ("tests/durabletask-azuremanaged",)
326+
session.run("pytest", *targets, "-m", "dts", "--verbose")
319327
finally:
320328
_stop_dts_emulator(container_name)
321329

@@ -324,12 +332,13 @@ def azuremanaged_tests(session: nox.Session) -> None:
324332
def functions_unit(session: nox.Session) -> None:
325333
"""Run the azure-functions-durable unit tests (no func/azurite required)."""
326334
session.install("-r", "requirements.txt")
327-
_install_packages(session)
335+
_install_packages(session, editable=True)
328336
session.install("pytest")
337+
targets = session.posargs or ("tests/azure-functions-durable",)
329338
session.run(
330-
"pytest", "tests/azure-functions-durable",
339+
"pytest", *targets,
331340
"-m", "not dts and not azurite and not functions_e2e",
332-
*session.posargs)
341+
)
333342

334343

335344
@nox.session(python=["3.13"])
@@ -373,10 +382,11 @@ def functions_e2e(session: nox.Session) -> None:
373382
session.install("pytest")
374383
for app in E2E_APPS:
375384
_link_app_venv(session, E2E_APPS_DIR / app)
385+
targets = session.posargs or ("tests/azure-functions-durable/e2e",)
376386
session.run(
377-
"pytest", "tests/azure-functions-durable/e2e",
387+
"pytest", *targets,
378388
"-m", "functions_e2e",
379-
*session.posargs)
389+
)
380390
finally:
381391
session.log(
382392
"Functions host logs are available at "

0 commit comments

Comments
 (0)