Skip to content

Commit cc26aeb

Browse files
committed
Clarify representative CI validation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
1 parent e37b053 commit cc26aeb

2 files changed

Lines changed: 38 additions & 13 deletions

File tree

docs/development.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,26 @@ require that `make` is installed on your local machine. If you're using Windows,
66

77
## Validation
88

9-
Use Nox to run the same correctness checks as the GitHub Actions workflows:
9+
Use Nox to run the representative local correctness checks:
1010

1111
```sh
1212
python -m pip install -r dev-requirements.txt
1313
nox -s ci
1414
```
1515

16-
The `ci` session runs linting, strict type checks, the core SDK test matrix
17-
(Python 3.10--3.14), Azure Managed emulator tests, Azure Functions unit tests,
18-
and Azure Functions end-to-end tests. Install each Python version in the matrix
19-
to run the complete suite locally. Nox reports a missing interpreter clearly
20-
when one is unavailable.
16+
The `ci` session runs linting, strict type checks, core SDK and Azure Managed
17+
tests on Python 3.14, Azure Functions unit tests on Python 3.14, and Azure
18+
Functions end-to-end tests on Python 3.13. It intentionally runs one
19+
representative version rather than the complete CI matrix, keeping routine
20+
local validation fast. To use another supported version (3.10--3.14) for the
21+
core SDK and Azure Managed tests, pass it after `--`:
22+
23+
```sh
24+
nox -s ci -- 3.10
25+
```
26+
27+
Run the versioned test sessions directly when a change needs complete matrix
28+
coverage, for example `nox -s core_tests` or `nox -s azuremanaged_tests`.
2129

2230
Nox starts Azurite automatically for the core and Azure Functions tests. The
2331
Azure Managed tests start a disposable DTS emulator Docker container. Start

noxfile.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
# Sample apps that need an in-app virtual environment for the E2E suite.
4343
E2E_APPS = ("v1_style", "dtask_style")
4444
PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14")
45+
DEFAULT_CI_PYTHON = "3.14"
4546

4647

4748
def _install_packages(session: nox.Session, editable: bool = False) -> None:
@@ -139,16 +140,20 @@ def _start_azurite(
139140
"Azurite is required for this session. Install it with "
140141
"`npm install -g azurite` and run the session again.")
141142

142-
command = [executable, *arguments]
143+
command = [
144+
executable,
145+
*arguments,
146+
"--location",
147+
session.create_tmp(),
148+
]
143149
if os.name == "nt" and executable.endswith(".ps1"):
144150
command = [
145151
"powershell",
146152
"-NoProfile",
147153
"-ExecutionPolicy",
148154
"Bypass",
149155
"-File",
150-
executable,
151-
*arguments,
156+
*command,
152157
]
153158

154159
process = subprocess.Popen(command)
@@ -399,11 +404,23 @@ def functions_e2e(session: nox.Session) -> None:
399404

400405
@nox.session(python=False)
401406
def ci(session: nox.Session) -> None:
402-
"""Run all lint, type, unit, emulator, and end-to-end CI-equivalent checks."""
407+
"""Run the representative local lint, type, test, emulator, and E2E checks.
408+
409+
Pass a core/Azure Managed Python version after ``--`` to override the
410+
default representative version, for example ``nox -s ci -- 3.10``.
411+
"""
412+
if len(session.posargs) > 1 or (
413+
session.posargs and session.posargs[0] not in PYTHON_VERSIONS
414+
):
415+
session.error(
416+
"Pass at most one supported Python version after `--`: "
417+
f"{', '.join(PYTHON_VERSIONS)}.")
418+
419+
python_version = session.posargs[0] if session.posargs else DEFAULT_CI_PYTHON
403420
session.notify("lint")
404421
session.notify("typecheck_core")
405422
session.notify("typecheck_functions")
406-
session.notify("core_tests")
407-
session.notify("azuremanaged_tests")
408-
session.notify("functions_unit")
423+
session.notify(f"core_tests-{python_version}")
424+
session.notify(f"azuremanaged_tests-{python_version}")
425+
session.notify("functions_unit-3.14")
409426
session.notify("functions_e2e")

0 commit comments

Comments
 (0)