Skip to content
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

Full coverage for CSharpSnapshotGenerator #26297

Merged
merged 1 commit into from
Oct 11, 2021
Merged

Full coverage for CSharpSnapshotGenerator #26297

merged 1 commit into from
Oct 11, 2021

Conversation

ajcvickers
Copy link
Member

Since we have had a few bugs in this area.

image

@ajcvickers ajcvickers requested a review from a team October 9, 2021 19:03
@ajcvickers ajcvickers merged commit e28fe99 into main Oct 11, 2021
@ajcvickers ajcvickers deleted the MethodActing1009 branch October 11, 2021 17:36
@bricelam
Copy link
Contributor

I think our biggest problem is forgetting to add coverage when we add new features. It would be nice if we had one set of tests for both model building and round-tripping through the snapshot.

@bricelam
Copy link
Contributor

For example:

Test(
    mb => mb.Entity<MyEntity>.Property(e => e.MyProperty).HasCollation("MY_COLLATION"),
    model =>
    {
        Assert.Equal("MY_COLLATION", model.GetEntityType("MyEntity").GetProperty("MyProperty").Collation);
    });

The assert could be run both against regular model building, and through the model that comes back from the compiled snapshot.

@AndriySvyryd
Copy link
Member

I think our biggest problem is forgetting to add coverage when we add new features. It would be nice if we had one set of tests for both model building and round-tripping through the snapshot.

I am reluctant to add too many snapshot tests as on average they are 17 times slower than pure model building tests

@AndriySvyryd
Copy link
Member

Converting all model building tests would increase testing time by almost 20 minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants