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

Tests with [InternalsVisibleTo] don't catch serialization issues. #1093

Closed
joshlang opened this issue Dec 10, 2019 · 2 comments
Closed

Tests with [InternalsVisibleTo] don't catch serialization issues. #1093

joshlang opened this issue Dec 10, 2019 · 2 comments
Assignees

Comments

@joshlang
Copy link
Contributor

There are various issues in which problems are caused by internal types not being deserialized properly. Examples:

#1004
#871

The current tests do not discover the problems because of:

[assembly: InternalsVisibleTo("Microsoft.Azure.Cosmos.Tests" + AssemblyKeys.ProductPublicKey)]

The [InternalsVisibleTo] attribute allows these unit tests to deserialize internal types as if they were public. The unit tests succeed. But outside of these testing assemblies, the calls would fail because they're actually internal.

I would suggest creating a test project which is not referenced by [InternalsVisibleTo] and migrating some of the tests over to it.

@j82w j82w self-assigned this Dec 10, 2019
@j82w
Copy link
Contributor

j82w commented Dec 10, 2019

I agree that this is causing a lot of issues. I'm working on a PR right now to address this. We do have a backlog item to start running the samples as part of the test, but I'm not sure when that will get prioritized. What ever the solution is there will be tests to prevent any future regressions like this.

@j82w
Copy link
Contributor

j82w commented Feb 3, 2020

Fixed in PR #1105

@j82w j82w closed this as completed Feb 3, 2020
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

No branches or pull requests

2 participants