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

Question re: generative providers and testing #140

Closed
baronfel opened this issue Oct 12, 2017 · 4 comments
Closed

Question re: generative providers and testing #140

baronfel opened this issue Oct 12, 2017 · 4 comments

Comments

@baronfel
Copy link
Contributor

Description

I'm working on testing out the new context-aware changes on the SwaggerProvider PR here, and wanted to make sure I was doing things correctly.

I ran into a small problem with the way the SwaggerProvider does its testing. I need to be able to create a testing TypeProviderConfig, which I'd like to do with ProvidedTypesTesting.Testing.MakeSimulatedTypeProviderConfig, but that whole module is marked internal so it's not available across the module boundary.

Is there a more-supported way to test TP generation?

Repro steps

Please provide the steps required to reproduce the problem

  1. Clone the SwaggerProvider PR linked above
  2. Run build.cmd or build.sh
  3. See the compilation failure in SwaggerProvider\tests\SwaggerProvider.Tests\Schema.Parser.Tests.fs.

Expected behavior

I have some mechanism to create a TypeProviderConfig

Actual behavior

I can't without removing the internal scope from the module .

Known workarounds

Remove the internal scope from the module .

Related information

  • Any OS
  • master@130750141e9033f2f6f82368745a18fafe98d305
  • .NET Runtime 4.7
@sergey-tihon
Copy link
Member

The PR mentioned in this PR fails with error (when compiling the project that uses TP)

error FS3033: The type provider 'SwaggerProvider.SwaggerTypeProvider' reported an error: The operation 'Namespace' on item 'Pet[]' should not be called on provided type, member or parameter [/Users/sergey/github/SwaggerProvider/tests/SwaggerProvider.ProviderTests/SwaggerProvider.ProviderTests.fsproj]

this also looks like an issue of SDK.

Repro steps are the same

@dsyme
Copy link
Contributor

dsyme commented Oct 12, 2017

@baronfel Can use use InternalsVisibleTo?

@dsyme
Copy link
Contributor

dsyme commented Oct 23, 2017

@baronfel Did using InternalsVisibleTo help?

@sergey-tihon
Copy link
Member

Since we rolled back to initial API that does not use context - #148 (comment)

we do not really need it anymore. I did restore tests here - fsprojects/SwaggerProvider@30da540

@baronfel please reopen if i am wrong

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

3 participants