Skip to content

Preserve customized Python test fixtures - #11422

Merged
Yuchao Yan (msyyc) merged 16 commits into
mainfrom
python-test-update
Jul 29, 2026
Merged

Yuchao Yan (msyyc) merged 16 commits into
mainfrom
python-test-update

Conversation

@msyyc

Copy link
Copy Markdown
Contributor

Summary

  • track generated Python fixtures that contain test-required customizations
  • preserve those fixtures while cleaning other generated packages
  • document why each fixture must survive regeneration

@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11422

commit: 1a46216

@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-python
Show changes

@typespec/http-client-python - internal ✏️

Track only hand-authored test fixture files instead of whole generated packages, and clean generated test code with git clean during regeneration.

@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:d320a53bb33cf1cbf7f5e2742b9da369944ae9be vs this PR.

Diff summary: 45 file(s), +45 / -275

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

@azure-sdk-automation

azure-sdk-automation Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@tadelesh Chenjie Shi (tadelesh) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer only keep _patch.py in the source code. Could you please check if Python could adopt Go's git ignore solution: https://github.com/Azure/typespec-azure/blob/d7e19546374047f90ee322da471b2e90a49f6dee/.gitignore#L230

Yuchao Yan (msyyc) and others added 3 commits July 29, 2026 15:24
Instead of committing whole generated packages and hard-coding an allowlist of
preserved folders in the regeneration script, ignore everything under
tests/generated and re-include only the hand-authored files, each with a comment
explaining why it cannot be regenerated.

Regeneration now cleans with `git clean -xdf -- tests/generated`, which deletes
ignored/untracked files but never tracked ones, so .gitignore is the single
source of truth.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: abb15bc1-4c77-451e-9ff0-46971b14d9b0
@msyyc

Copy link
Copy Markdown
Contributor Author

I prefer only keep _patch.py in the source code. Could you please check if Python could adopt Go's git ignore solution: https://github.com/Azure/typespec-azure/blob/d7e19546374047f90ee322da471b2e90a49f6dee/.gitignore#L230

Reduced unnecessary generated files and only 30 files are left now.

Comment thread packages/http-client-python/.gitignore Resolved
Comment thread packages/http-client-python/.gitignore Resolved
@msyyc
Yuchao Yan (msyyc) added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 20a02b2 Jul 29, 2026
42 checks passed
@msyyc
Yuchao Yan (msyyc) deleted the python-test-update branch July 29, 2026 09:45
Dapeng Zhang (ArcturusZhang) pushed a commit to ArcturusZhang/typespec-azure that referenced this pull request Jul 30, 2026
related upstream PR: microsoft/typespec#11422

Adds generated Python test fixtures required by the test suite and syncs
the marked `.gitignore` fixture rules from upstream. Missing markers now
produce a warning and skip the `.gitignore` update.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants