π The fast, Pythonic way to build MCP servers and clients.
Run Windows tests on main and manual runs only (#5198)
nate nowackbbdde2f84fb5
diff --git a/.github/scripts/test-ci-workflows.mjs b/.github/scripts/test-ci-workflows.mjsindex c0a7e5e37..72ea73f89 100644--- a/.github/scripts/test-ci-workflows.mjs+++ b/.github/scripts/test-ci-workflows.mjs@@ -190,7 +190,7 @@ test("required matrix checks retain names even when editorial steps skip", () =>"Tests: Python ${{ matrix.python-version }} on ${{ matrix.os }}",);assert.deepEqual(matrix.strategy.matrix, {- os: ["ubuntu-latest", "windows-latest"],+ os: ["ubuntu-latest"],"python-version": ["3.10"],include: [{ os: "ubuntu-latest", "python-version": "3.13" }],});@@ -220,6 +220,21 @@ test("required matrix checks retain names even when editorial steps skip", () =>);}});+test("Windows retains its check name but runs only outside PRs", () => {+ const windows = workflow.jobs.run_windows_tests;+ assert.equal(windows.name, "Tests: Python 3.10 on windows-latest");+ assert.equal(windows.if, "github.event_name != 'pull_request'");+ assert.equal(windows["runs-on"], "windows-latest");+ assert.equal(windows.needs, undefined);+ assert.deepEqual(windows.steps[1].with, {+ "python-version": "3.10",+ resolution: "locked",+ });+ assert.equal(windows.steps[2].uses, "./.github/actions/run-pytest");+ assert.equal(windows.steps[3].uses, "./.github/actions/run-pytest");+ assert.equal(windows.steps[3].with["test-type"], "client_process");+ assert.ok(windows.steps.every((step) => step.if === undefined));+});test("PR cancellation cannot supersede main or manual runs", () => {for (const name of ["run-tests", "run-static"]) {assert.deepEqual(workflows[name].concurrency, {diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.ymlindex 371d56fd7..a459e2c6e 100644--- a/.github/workflows/run-tests.yml+++ b/.github/workflows/run-tests.yml@@ -72,7 +72,7 @@ jobs:runs-on: ${{ matrix.os }}strategy:matrix:- os: [ubuntu-latest, windows-latest]+ os: [ubuntu-latest]python-version: ["3.10"]include:- os: ubuntu-latest@@ -105,6 +105,25 @@ jobs:if: needs.changes.outputs.run-tests == 'false' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'run: uv run pytest tests/docs -n 0+ run_windows_tests:+ if: github.event_name != 'pull_request'+ name: "Tests: Python 3.10 on windows-latest"+ runs-on: windows-latest+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@v7+ - name: Setup uv+ uses: ./.github/actions/setup-uv+ with:+ python-version: "3.10"+ resolution: locked+ - name: Run unit tests+ uses: ./.github/actions/run-pytest+ - name: Run serial subprocess tests+ uses: ./.github/actions/run-pytest+ with:+ test-type: client_process+run_tests_lowest_direct:needs: changes# Run even if classification fails, preserving coverage and check names.diff --git a/pyproject.toml b/pyproject.tomlindex 158c9fce6..629032417 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -247,3 +247,4 @@ known-first-party = ["fastmcp", "fastmcp_remote"][tool.codespell]ignore-words-list = "asend,shttp,te"+ignore-regex = 'caf%C3%A9'