fix: add Windows test coverage - #362
Open
abhinavkr26104 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
1 issue found across 3 files
Confidence score: 2/5
- In
.github/workflows/ci.yml, theruns-onlogic instainless-sdks/*repos appears to force the Ubuntu depot runner for all matrix entries, so the Windows job may never execute on Windows and Windows-specific breakages can slip through CI—restrict the depot override to only the Ubuntu matrix case sowindowsuses a Windows runner.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/ci.yml">
<violation number="1" location=".github/workflows/ci.yml:85">
P1: In `stainless-sdks/*` repositories, this `runs-on` expression always picks the Ubuntu depot runner, so the Windows matrix job never gets a Windows runner. Gate the depot override to the Ubuntu matrix entry so `windows-latest` still runs on Windows.</violation>
</file>
Architecture diagram
sequenceDiagram
participant GH as GitHub Actions
participant CI as CI Workflow (test job)
participant Runner as CI Runner (Ubuntu/Windows)
participant Bash as Bash Shell
participant Bootstrap as Bootstrap Script
participant Test as Test Script
participant Git as Git Checkout (LF forced)
participant PyTest as Pytest (Python 3.9/3.14)
participant Env as Environment Variables
participant Tracemalloc as Tracemalloc Leak Check
participant ProxyTest as Proxy Env Test
participant Client as DefaultHttpxClient
Note over GH,Runner: CI Test Matrix (Ubuntu + Windows)
GH->>CI: Trigger test job
CI->>Runner: Select runner (matrix.os)
Runner->>Git: Checkout repo
Git->>Git: CHANGED: Force LF for tests/sample_file.txt (.gitattributes)
Runner->>Bash: Run bootstrap
Bash->>Bootstrap: Execute ./scripts/bootstrap
Bootstrap-->>Bash: Setup complete
Runner->>Bash: Run tests
Bash->>Test: Execute ./scripts/test
Test->>PyTest: Run test suite (3.9 and 3.14)
alt Windows OS
Note over PyTest,Tracemalloc: Platform-specific behavior
PyTest->>Tracemalloc: Skip leak assertions (win32)
PyTest->>ProxyTest: Run proxy env test (case-insensitive vars)
else Ubuntu OS
PyTest->>Tracemalloc: Skip only if Python >= 3.10
PyTest->>ProxyTest: Run proxy env test
end
ProxyTest->>Env: Clear HTTP_PROXY, ALL_PROXY, lowercase variants
ProxyTest->>Env: Set HTTPS_PROXY (last, after clearing)
Env-->>ProxyTest: Case-insensitive handling on Windows
ProxyTest->>Client: Instantiate client with proxy env
Client-->>ProxyTest: Client configured
PyTest-->>Test: Test results
Test-->>Bash: Exit code
Bash-->>Runner: Pass/Fail
Runner-->>CI: Report status
CI-->>GH: Job status
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest] | ||
| runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }} |
There was a problem hiding this comment.
P1: In stainless-sdks/* repositories, this runs-on expression always picks the Ubuntu depot runner, so the Windows matrix job never gets a Windows runner. Gate the depot override to the Ubuntu matrix entry so windows-latest still runs on Windows.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 85:
<comment>In `stainless-sdks/*` repositories, this `runs-on` expression always picks the Ubuntu depot runner, so the Windows matrix job never gets a Windows runner. Gate the depot override to the Ubuntu matrix entry so `windows-latest` still runs on Windows.</comment>
<file context>
@@ -77,8 +77,12 @@ jobs:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest]
+ runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
</file context>
Suggested change
| runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }} | |
| runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && matrix.os == 'ubuntu-latest' && 'depot-ubuntu-24.04' || matrix.os }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
uv run --frozen --isolated --all-extras --python 3.9 pytest(502 passed, 297 skipped)uv run --frozen --isolated --all-extras --python 3.14 pytest(502 passed, 297 skipped)uv run --frozen ruff check .uv run --frozen pyright -p .uv run --frozen mypy --platform linux .Fixes #355
Summary by cubic
Add Windows to the CI test matrix and make tests cross-platform stable. CI previously ran only on Ubuntu; now it runs on Ubuntu and Windows, with fixes for CRLF-sensitive fixtures, Windows proxy env var behavior, and flaky tracemalloc leak checks. Fixes #355.
ubuntu-latestandwindows-latest; bootstrap and test steps run withbash..gitattributesforces LF fortests/sample_file.txtto keep base64 assertions stable across OSes.HTTPS_PROXYlast.Written for commit b3ea05e. Summary will update on new commits.