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

Add roundtrip tests for schema json #13080

Open
Frassle opened this issue Jun 2, 2023 · 1 comment
Open

Add roundtrip tests for schema json #13080

Frassle opened this issue Jun 2, 2023 · 1 comment
Labels
area/codegen SDK-gen, program-gen, convert kind/engineering Work that is not visible to an external user

Comments

@Frassle
Copy link
Member

Frassle commented Jun 2, 2023

A while ago we broke some Go SDK generation due to a bug in how package schema's were marshalled to json: #13000

We fixed that one specific bug but in the investigation for that it turned out we had pretty much no tests for this marshalling code.

We should add roundtrip tests for various schemas to ensure that they can be read in from JSON, and then back out again without loss of information.

@Frassle Frassle added area/codegen SDK-gen, program-gen, convert kind/engineering Work that is not visible to an external user labels Jun 2, 2023
bors bot added a commit that referenced this issue Jul 18, 2023
13519: Fix ReplaceOnChanges being dropped in schema marshalling r=Frassle a=Frassle

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #13492.

## Checklist

- [x] I have run `make tidy` to update any new dependencies
- [x] I have run `make lint` to verify my code passes the lint check
  - [x] I have formatted my code using `gofumpt`

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works - No, we'll cover this with #13080, but that's a large amount of work. This is a quick fix in now to unblock providers.

<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Fraser Waters <fraser@pulumi.com>
@Frassle
Copy link
Member Author

Frassle commented Jul 29, 2023

Abhinav suggested possibly using https://github.com/google/go-cmp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen SDK-gen, program-gen, convert kind/engineering Work that is not visible to an external user
Projects
None yet
Development

No branches or pull requests

1 participant