Skip to content

tests: use syrupy for AsyncAPI schema snapshot testing (#2978) - #2979

Open
ashishSoni1234 wants to merge 1 commit into
ag2ai:mainfrom
ashishSoni1234:feature/2978-syrupy-snapshot-tests
Open

tests: use syrupy for AsyncAPI schema snapshot testing (#2978)#2979
ashishSoni1234 wants to merge 1 commit into
ag2ai:mainfrom
ashishSoni1234:feature/2978-syrupy-snapshot-tests

Conversation

@ashishSoni1234

Copy link
Copy Markdown

Replace large hand-written dict literals in the shared AsyncAPI arguments test cases with syrupy snapshots, so expected schemas are generated once and diffed automatically instead of being maintained by hand across every broker/version test module.

Description

Please include a summary of the change and specify which issue is being addressed. Additionally, provide relevant motivation and context.

Fixes # (issue number)

Type of change

Please delete options that are not relevant.

  • Documentation (typos, code examples, or any documentation updates)
  • Bug fix (a non-breaking change that resolves an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a fix or feature that would disrupt existing functionality)
  • This change requires a documentation update

Checklist

  • My code adheres to the style guidelines of this project (just lint shows no errors)
  • I have conducted a self-review of my own code
  • I have made the necessary changes to the documentation
  • My changes do not generate any new warnings
  • I have added tests to validate the effectiveness of my fix or the functionality of my new feature
  • Both new and existing unit tests pass successfully on my local environment by running just test-coverage
  • I have ensured that static analysis tests are passing by running just static-analysis
  • I have included code examples to illustrate the modifications

Replace large hand-written dict literals in the shared AsyncAPI
arguments test cases with syrupy snapshots, so expected schemas are
generated once and diffed automatically instead of being maintained
by hand across every broker/version test module.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Aug 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bae5ec714b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"type": "object",
},
}, payload
assert payload == snapshot

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep enum snapshots tolerant of Pydantic v1

When these shared AsyncAPI tests are run with Pydantic v1, enum definitions include Pydantic's generated description field; the previous IsPartialDict intentionally accepted that extra key, but the recorded syrupy snapshots are exact and were generated without it. That makes the Pydantic-v1 compatibility run fail for every broker/version inheriting this test (the 3.0.0 copy has the same change), so either keep a partial/filtered snapshot or provide separate v1/v2 snapshots.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants