Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate the schemas for the eject tests via the tfgen tests
- Loading branch information
Showing
5 changed files
with
173 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright 2016-2022, Pulumi Corporation. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package testing | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
type TestFileMapper struct { | ||
Path string | ||
} | ||
|
||
func (l *TestFileMapper) GetMapping(provider string) ([]byte, error) { | ||
mappingPath := filepath.Join(l.Path, provider) + ".json" | ||
|
||
mappingBytes, err := os.ReadFile(mappingPath) | ||
if err != nil { | ||
if os.IsNotExist(err) { | ||
return nil, nil | ||
} | ||
return nil, err | ||
} | ||
|
||
return mappingBytes, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,86 @@ | ||
{ | ||
"name": "simple", | ||
"provider": { | ||
"dataSources": { | ||
"simple_data_source": { | ||
"input_one": { | ||
"type": 4 | ||
}, | ||
"input_two": { | ||
"type": 2 | ||
}, | ||
"result": { | ||
"type": 4, | ||
"computed": true | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"simple_resource": { | ||
"input_one": { | ||
"type": 4 | ||
}, | ||
"input_two": { | ||
"type": 2 | ||
}, | ||
"result": { | ||
"type": 4, | ||
"computed": true | ||
} | ||
} | ||
|
||
} | ||
"name": "simple", | ||
"attribution": "This Pulumi package is based on the [`simple` Terraform Provider](https://github.com/terraform-providers/terraform-provider-simple).", | ||
"meta": { | ||
"moduleFormat": "(.*)(?:/[^/]*)" | ||
}, | ||
"language": { | ||
"nodejs": { | ||
"compatibility": "tfbridge20", | ||
"disableUnionOutputTypes": true, | ||
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-simple)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-simple` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-simple` repo](https://github.com/terraform-providers/terraform-provider-simple/issues)." | ||
}, | ||
"dataSources": { | ||
"simple_data_source": { | ||
"tok": "simple:index:data_source", | ||
"fields": { | ||
"input_one": { | ||
"name": "inputOne", | ||
"type": "string" | ||
}, | ||
"input_two": { | ||
"name": "inputTwo", | ||
"type": "integer" | ||
}, | ||
"result": { | ||
"name": "result", | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"resources": { | ||
"simple_resource": { | ||
"tok": "simple:index:resource", | ||
"fields": { | ||
"input_one": { | ||
"name": "inputOne", | ||
"type": "string" | ||
}, | ||
"input_two": { | ||
"name": "inputTwo", | ||
"type": "integer" | ||
}, | ||
"result": { | ||
"name": "result", | ||
"type": "string" | ||
} | ||
} | ||
"python": { | ||
"compatibility": "tfbridge20", | ||
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-simple)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-simple` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-simple` repo](https://github.com/terraform-providers/terraform-provider-simple/issues)." | ||
} | ||
}, | ||
"config": {}, | ||
"provider": { | ||
"description": "The provider type for the simple package. By default, resources use package-wide configuration\nsettings, however an explicit `Provider` instance may be created and passed during resource\nconstruction to achieve fine-grained programmatic control over provider settings. See the\n[documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.\n" | ||
}, | ||
"resources": { | ||
"simple:index:resource": { | ||
"properties": { | ||
"inputOne": { | ||
"type": "string" | ||
}, | ||
"inputTwo": { | ||
"type": "integer" | ||
}, | ||
"result": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"inputOne", | ||
"inputTwo", | ||
"result" | ||
], | ||
"stateInputs": { | ||
"description": "Input properties used for looking up and filtering resource resources.\n", | ||
"properties": { | ||
"inputOne": { | ||
"type": "string" | ||
}, | ||
"inputTwo": { | ||
"type": "integer" | ||
}, | ||
"result": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object" | ||
} | ||
} | ||
}, | ||
"functions": { | ||
"simple:index:data_source": { | ||
"outputs": { | ||
"description": "A collection of values returned by data_source.\n", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "The provider-assigned unique ID for this managed resource.\n" | ||
}, | ||
"inputOne": { | ||
"type": "string" | ||
}, | ||
"inputTwo": { | ||
"type": "integer" | ||
}, | ||
"result": { | ||
"type": "string" | ||
} | ||
}, | ||
"type": "object", | ||
"required": [ | ||
"inputOne", | ||
"inputTwo", | ||
"result", | ||
"id" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
These files are auto-generated and checked via the tfgen/Test_GenerateTestDataSchemas test. | ||
DO NOT EDIT BY HAND! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters