Skip to content

A basic test suite for orleans source generator #9459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 28, 2025

Conversation

Meir017
Copy link
Contributor

@Meir017 Meir017 commented Apr 25, 2025

related to #9272

used https://github.com/VerifyTests/Verify to verify the generated code

@Meir017
Copy link
Contributor Author

Meir017 commented Apr 25, 2025


<PropertyGroup>
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
<xUnitVersion>2.9.3</xUnitVersion>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

due to the dependency on xunit.extensibility.execution see https://www.nuget.org/packages/Verify.Xunit/28.15.0#dependencies-body-tab

could we upgrade the xunit versions in this repo? (maybe separate PR)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we can upgrade xUnit - either in this PR or a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think a separate PR would be better, are we still supporting netcoreapp3.1? There are some conditions there, we'll discuss this in the new PR for xunit upgrades

Copy link
Member

Choose a reason for hiding this comment

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

We support it just for the code generator... we will drop it at some point (maybe for the .NET 10 release). It's ok if tests don't cover it.

@ReubenBond ReubenBond requested a review from Copilot April 28, 2025 03:23
Copy link
Contributor

@Copilot Copilot AI left a comment

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 basic test suite for the Orleans source generator to verify generated code using VerifyTests and enhances CI to run the code generator tests across multiple OS environments.

  • Added a snapshot file to capture the generated Orleans serialization code.
  • Introduced a new test in OrleansSourceGeneratorTests.cs to validate the source generator output.
  • Updated the CI configuration to include a dedicated job for testing the code generator.

Reviewed Changes

Copilot reviewed 4 out of 9 changed files in this pull request and generated no comments.

File Description
test/Orleans.CodeGenerator.Tests/snapshots/OrleansSourceGeneratorTests.TestBasicClass.verified.cs Added generated snapshot verification file for Orleans serialization.
test/Orleans.CodeGenerator.Tests/OrleansSourceGeneratorTests.cs Introduced a basic test case for validating the Orleans source generator.
.github/workflows/ci.yml Added a new CI job to test the code generator across multiple operating systems and frameworks.
Files not reviewed (5)
  • .editorconfig: Language not supported
  • .gitattributes: Language not supported
  • Directory.Packages.props: Language not supported
  • Orleans.sln: Language not supported
  • test/Orleans.CodeGenerator.Tests/Orleans.CodeGenerator.Tests.csproj: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/ci.yml:521

  • Consider removing 'continue-on-error: true' unless it is intentional, as this setting might mask failures in the code generator tests.
continue-on-error: true

@ReubenBond ReubenBond merged commit 2906ef3 into dotnet:main Apr 28, 2025
27 of 28 checks passed
@Meir017 Meir017 deleted the tests/source-generator branch April 28, 2025 07:48
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants