Skip to content

Improve local CI validation - #215

Merged
berndverst merged 13 commits into
mainfrom
andystaples-improve-ci-validation
Jul 27, 2026
Merged

Improve local CI validation#215
berndverst merged 13 commits into
mainfrom
andystaples-improve-ci-validation

Conversation

@andystaples

@andystaples andystaples commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Nox sessions that mirror CI linting, Pyright, unit-test matrices, Azure Managed emulator tests, and Functions E2E tests; invoke them from GitHub Actions.
  • Automatically provision isolated DTS and Azurite-backed validation environments, avoiding shared-emulator conflicts.
  • Document nox -R focused validation with file paths and test selectors; forward selectors to lint and type-check sessions.
  • Surface Functions host-log paths for local E2E diagnosis.

Validation

  • nox -s lint
  • nox -s typecheck_core typecheck_functions
  • nox -s core_tests-3.10 core_tests-3.11 core_tests-3.13 core_tests-3.14
  • nox -s functions_unit-3.13 functions_unit-3.14
  • nox -s azuremanaged_tests-3.10 (84 passed, 1 skipped)
  • Focused nox -R lint, Pyright, and pytest selector forwarding

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Copilot AI review requested due to automatic review settings July 27, 2026 19:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ci aggregate session.
  • Updated GitHub Actions workflows to invoke Nox sessions instead of duplicating install/test logic.
  • Documented the new Nox-driven validation workflow (including nox -R usage) in docs/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_tests ignores session.posargs, so nox -R -s azuremanaged_tests-3.10 -- <paths/selectors> (as documented) can't forward focused pytest selection to the underlying pytest invocation.
        session.run("pytest", "tests/durabletask-azuremanaged", "-m", "dts", "--verbose")

Comment thread docs/development.md Outdated
Comment thread noxfile.py Outdated
Copilot AI review requested due to automatic review settings July 27, 2026 19:35
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pytest invocation does not forward session.posargs, so commands like nox -R -s core_tests-3.10 -- tests/... -k ... (as documented) are ignored. Append *session.posargs to let file paths / selectors flow through.
        targets = session.posargs or ("tests/durabletask",)

Comment thread noxfile.py
Comment thread noxfile.py Outdated
Copilot AI review requested due to automatic review settings July 27, 2026 19:40
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Popen is not subscriptable at runtime, so using subprocess.Popen[str] in a return annotation will raise TypeError when importing noxfile.py (breaking all Nox sessions unless annotations are postponed). Use the non-parameterized type here (or add from __future__ import annotations and keep the generic).
    ports: Sequence[int],

noxfile.py:163

  • Same runtime issue as above: subprocess.Popen[str] will raise TypeError on import because Popen isn't subscriptable without postponed evaluation. Use subprocess.Popen (unparameterized) or postpone annotations.

Copilot AI review requested due to automatic review settings July 27, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread docs/development.md Outdated
Comment thread docs/development.md Outdated
Copilot AI review requested due to automatic review settings July 27, 2026 19:51
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread noxfile.py Outdated
Copilot AI review requested due to automatic review settings July 27, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread noxfile.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Copilot AI review requested due to automatic review settings July 27, 2026 20:13
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread noxfile.py
Comment thread noxfile.py Outdated
Comment thread noxfile.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Copilot AI review requested due to automatic review settings July 27, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_azurite always resolves the azurite executable. For blob-only sessions like core_tests, that can still bind (and potentially conflict on) the default queue/table ports even though the session only needs blob storage. Prefer azurite-blob when only blob is required (it supports --location as used elsewhere in the repo) and fall back to azurite otherwise.
    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.")

Comment thread docs/development.md
Copilot AI review requested due to automatic review settings July 27, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_open only 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)}).")

Comment thread noxfile.py
Copilot AI review requested due to automatic review settings July 27, 2026 21:24
Comment thread noxfile.py Outdated
Comment thread noxfile.py Outdated
Comment thread noxfile.py
Comment thread noxfile.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_tests for 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`.

Comment thread docs/development.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Copilot AI review requested due to automatic review settings July 27, 2026 21:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread noxfile.py
berndverst
berndverst previously approved these changes Jul 27, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 61acbc5e-7c07-42a7-8e38-31329c4befce
Copilot AI review requested due to automatic review settings July 27, 2026 21:37
@berndverst
berndverst merged commit b871df8 into main Jul 27, 2026
25 checks passed
@berndverst
berndverst deleted the andystaples-improve-ci-validation branch July 27, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread docs/development.md
using [Chocolatey](https://chocolatey.org/) or use WSL.

```sh
pip3 install -r dev-requirements.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants