Improve local CI validation - #215
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
There was a problem hiding this comment.
Pull request overview
This PR introduces a Nox-based local validation workflow intended to mirror the repository’s GitHub Actions checks, and updates CI workflows/documentation to use those Nox sessions for consistent lint/typecheck/test execution.
Changes:
- Added/expanded Nox sessions for linting, strict Pyright checks, core/azuremanaged/functions test matrices, and a
ciaggregate session. - Updated GitHub Actions workflows to invoke Nox sessions instead of duplicating install/test logic.
- Documented the new Nox-driven validation workflow (including
nox -Rusage) indocs/development.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
noxfile.py |
Adds CI-mirroring Nox sessions and emulator provisioning helpers; introduces a ci meta-session. |
docs/development.md |
Documents running CI-equivalent validation locally via Nox, including -R reuse guidance and examples. |
.github/workflows/typecheck.yml |
Switches Pyright CI jobs to run via nox -s typecheck_core/typecheck_functions. |
.github/workflows/durabletask.yml |
Replaces lint/test steps with nox -s lint and nox -s core_tests-<py>. |
.github/workflows/durabletask-azuremanaged.yml |
Replaces lint/docker test orchestration with nox -s lint and nox -s azuremanaged_tests-<py>. |
.github/workflows/durabletask-azurefunctions.yml |
Replaces lint/unit/e2e orchestration pieces with Nox-driven sessions. |
Comments suppressed due to low confidence (1)
noxfile.py:318
azuremanaged_testsignoressession.posargs, sonox -R -s azuremanaged_tests-3.10 -- <paths/selectors>(as documented) can't forward focused pytest selection to the underlyingpytestinvocation.
session.run("pytest", "tests/durabletask-azuremanaged", "-m", "dts", "--verbose")
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
noxfile.py:298
- This
pytestinvocation does not forwardsession.posargs, so commands likenox -R -s core_tests-3.10 -- tests/... -k ...(as documented) are ignored. Append*session.posargsto let file paths / selectors flow through.
targets = session.posargs or ("tests/durabletask",)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
noxfile.py:121
subprocess.Popenis not subscriptable at runtime, so usingsubprocess.Popen[str]in a return annotation will raiseTypeErrorwhen importingnoxfile.py(breaking all Nox sessions unless annotations are postponed). Use the non-parameterized type here (or addfrom __future__ import annotationsand keep the generic).
ports: Sequence[int],
noxfile.py:163
- Same runtime issue as above:
subprocess.Popen[str]will raiseTypeErroron import becausePopenisn't subscriptable without postponed evaluation. Usesubprocess.Popen(unparameterized) or postpone annotations.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
noxfile.py:376
- The E2E session starts Azurite without specifying
--location, which means Azurite will persist its metadata/DB files into the current working directory. That can leave untracked__azurite_db__*artifacts in the repo after local runs.
Use a session temp directory (or another dedicated folder) via --location to keep the repo clean.
arguments=(
"--silent",
"--skipApiVersionCheck",
"--blobPort",
"10000",
"--queuePort",
"10001",
"--tablePort",
"10002",
),
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
noxfile.py:142
_start_azuritealways resolves theazuriteexecutable. For blob-only sessions likecore_tests, that can still bind (and potentially conflict on) the default queue/table ports even though the session only needs blob storage. Preferazurite-blobwhen only blob is required (it supports--locationas used elsewhere in the repo) and fall back toazuriteotherwise.
executable = shutil.which("azurite")
if executable is None:
session.error(
"Azurite is required for this session. Install it with "
"`npm install -g azurite` and run the session again.")
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
noxfile.py:136
- This error message assumes the listeners are Azurite, but
_is_port_openonly checks whether some process is accepting connections. Consider wording this in terms of ports being in use so the message stays accurate even if another service is bound to the port(s).
session.error(
"Azurite has only some required ports open "
f"({', '.join(str(port) for port in open_ports)}). Stop the "
"existing instance or start one that exposes all required ports "
f"({', '.join(str(port) for port in ports)}).")
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
docs/development.md:28
- The docs suggest running
nox -s core_tests/nox -s azuremanaged_testsfor full-matrix validation, but those session names don’t exist because these sessions are parameterized by Python version (e.g.,core_tests-3.10,azuremanaged_tests-3.10). Update the examples to use the version-suffixed session names (and optionally mention repeating for other versions).
Run the versioned test sessions directly when a change needs complete matrix
coverage, for example `nox -s core_tests` or `nox -s azuremanaged_tests`.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
| using [Chocolatey](https://chocolatey.org/) or use WSL. | ||
|
|
||
| ```sh | ||
| pip3 install -r dev-requirements.txt |
Summary
nox -Rfocused validation with file paths and test selectors; forward selectors to lint and type-check sessions.Validation
nox -s lintnox -s typecheck_core typecheck_functionsnox -s core_tests-3.10 core_tests-3.11 core_tests-3.13 core_tests-3.14nox -s functions_unit-3.13 functions_unit-3.14nox -s azuremanaged_tests-3.10(84 passed, 1 skipped)nox -Rlint, Pyright, and pytest selector forwarding