Skip to content

Commit

Permalink
revert test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
corymhall committed Nov 14, 2024
1 parent 53a8940 commit 549a72d
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions provider/pkg/schema/gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"

jsschema "github.com/pulumi/jsschema"
"github.com/pulumi/pulumi-aws-native/provider/pkg/metadata"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/stretchr/testify/assert"
)
Expand All @@ -18,7 +17,7 @@ func marshalSpec(spec map[string]interface{}) *jsschema.Schema {
return s
}

func runTest(t *testing.T, spec map[string]interface{}, docs Docs) (*schema.PackageSpec, *metadata.CloudAPIMetadata, *Reports) {
func runTest(t *testing.T, spec map[string]interface{}, docs Docs) (*schema.PackageSpec, *Reports) {
return runTestWithRegions(t, spec, docs, []RegionInfo{
{
Name: "us-west-2",
Expand All @@ -31,17 +30,17 @@ func runTest(t *testing.T, spec map[string]interface{}, docs Docs) (*schema.Pack
})
}

func runTestWithRegions(t *testing.T, spec map[string]interface{}, docs Docs, regions []RegionInfo) (*schema.PackageSpec, *metadata.CloudAPIMetadata, *Reports) {
func runTestWithRegions(t *testing.T, spec map[string]interface{}, docs Docs, regions []RegionInfo) (*schema.PackageSpec, *Reports) {
s := marshalSpec(spec)
semanticsDocument, err := GatherSemantics("../../../provider/cmd/pulumi-resource-aws-native")
if err != nil {
t.Fatalf("Error gathering semantics: %v", err)
}
packageSpec, metadata, reports, err := GatherPackage([]string{s.Extras["typeName"].(string)}, []*jsschema.Schema{s}, false, &semanticsDocument, &docs, regions)
packageSpec, _, reports, err := GatherPackage([]string{s.Extras["typeName"].(string)}, []*jsschema.Schema{s}, false, &semanticsDocument, &docs, regions)
if err != nil {
t.Fatalf("GatherPackage failed: %v", err)
}
return packageSpec, metadata, reports
return packageSpec, reports
}

func TestGatherPackage_docs_inputProperty(t *testing.T) {
Expand All @@ -65,7 +64,7 @@ func TestGatherPackage_docs_inputProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
packageSpec.Resources["aws-native:events:Rule"].Properties["description"].Description,
Expand Down Expand Up @@ -115,7 +114,7 @@ func TestGatherPackage_docs_refProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"The ID of the target within the specified rule. Use this ID to reference the target when updating the rule. We recommend using a memorable and unique string.",
Expand Down Expand Up @@ -170,7 +169,7 @@ func TestGatherPackage_docs_nestedProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"The parameters for using a Kinesis stream as a source.",
Expand Down Expand Up @@ -219,7 +218,7 @@ func TestGatherPackage_docs_nestedPropertyProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"The maximum length of a time to wait for events.",
Expand Down Expand Up @@ -303,7 +302,7 @@ func TestGatherPackage_docs_nestedListProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"A list of files containing the environment variables to pass to a container. You can specify up to ten environment files. The file must have a `.env` file extension. Each line in an environment file should contain an environment variable in `VARIABLE=VALUE` format. Lines beginning with `#` are treated as comments and are ignored. For more information about the environment variable file syntax, see [Declare default environment variables in file](https://docs.aws.amazon.com/https://docs.docker.com/compose/env-file/) .\n\nIf there are environment variables specified using the `environment` parameter in a container definition, they take precedence over the variables contained within an environment file. If multiple environment files are specified that contain the same variable, they're processed from the top down. We recommend that you use unique variable names. For more information, see [Specifying environment variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html) in the *Amazon Elastic Container Service Developer Guide* .\n\nThis parameter is only supported for tasks hosted on Fargate using the following platform versions:\n\n- Linux platform version `1.4.0` or later.\n- Windows platform version `1.0.0` or later.",
Expand Down Expand Up @@ -356,7 +355,7 @@ func TestGatherPackage_docs_listProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"An array of server URLs.",
Expand All @@ -379,7 +378,7 @@ func TestGatherPackage_docs_topLevelResource(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"Specifies an Amazon Elastic Block Store (Amazon EBS) volume.\n\nWhen you use AWS CloudFormation to update an Amazon EBS volume that modifies `Iops` , `Size` , or `VolumeType` , there is a cooldown period before another operation can occur. This can cause your stack to report being in `UPDATE_IN_PROGRESS` or `UPDATE_ROLLBACK_IN_PROGRESS` for long periods of time.\n\nAmazon EBS does not support sizing down an Amazon EBS volume. AWS CloudFormation does not attempt to modify an Amazon EBS volume to a smaller size on rollback.\n\nSome common scenarios when you might encounter a cooldown period for Amazon EBS include:\n\n- You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.\n- You successfully update an Amazon EBS volume and the update succeeds but another change in your `update-stack` call fails. The rollback will be subject to a cooldown period.\n\nFor more information, see [Requirements for EBS volume modifications](https://docs.aws.amazon.com/ebs/latest/userguide/modify-volume-requirements.html) .\n\n*DeletionPolicy attribute*\n\nTo control how AWS CloudFormation handles the volume when the stack is deleted, set a deletion policy for your volume. You can choose to retain the volume, to delete the volume, or to create a snapshot of the volume. For more information, see [DeletionPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .\n\n> If you set a deletion policy that creates a snapshot, all tags on the volume are included in the snapshot.",
Expand All @@ -404,7 +403,7 @@ func TestGatherPackage_docs_augmentation_topLevelResource(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"Specifies an Amazon Elastic Block Store (Amazon EBS) volume.\n\nWhen you use AWS CloudFormation to update an Amazon EBS volume that modifies `Iops` , `Size` , or `VolumeType` , there is a cooldown period before another operation can occur. This can cause your stack to report being in `UPDATE_IN_PROGRESS` or `UPDATE_ROLLBACK_IN_PROGRESS` for long periods of time.\n\nAmazon EBS does not support sizing down an Amazon EBS volume. AWS CloudFormation does not attempt to modify an Amazon EBS volume to a smaller size on rollback.\n\nSome common scenarios when you might encounter a cooldown period for Amazon EBS include:\n\n- You successfully update an Amazon EBS volume and the update succeeds. When you attempt another update within the cooldown window, that update will be subject to a cooldown period.\n- You successfully update an Amazon EBS volume and the update succeeds but another change in your `update-stack` call fails. The rollback will be subject to a cooldown period.\n\nFor more information, see [Requirements for EBS volume modifications](https://docs.aws.amazon.com/ebs/latest/userguide/modify-volume-requirements.html) .\n\n*DeletionPolicy attribute*\n\nTo control how AWS CloudFormation handles the volume when the stack is deleted, set a deletion policy for your volume. You can choose to retain the volume, to delete the volume, or to create a snapshot of the volume. For more information, see [DeletionPolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) .\n\n> If you set a deletion policy that creates a snapshot, all tags on the volume are included in the snapshot.",
Expand Down Expand Up @@ -451,7 +450,7 @@ func TestGatherPackage_docs_augmentation_nestedProperty(t *testing.T) {
},
}

packageSpec, _, _ := runTest(t, spec, docs)
packageSpec, _ := runTest(t, spec, docs)
assert.Equal(
t,
"The encryption type to use.\n\nIf you use the `KMS` encryption type, the contents of the repository will be encrypted using server-side encryption with AWS Key Management Service key stored in AWS KMS . When you use AWS KMS to encrypt your data, you can either use the default AWS managed AWS KMS key for Amazon ECR, or specify your own AWS KMS key, which you already created. For more information, see [Protecting data using server-side encryption with an AWS KMS key stored in AWS Key Management Service (SSE-KMS)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the *Amazon Simple Storage Service Console Developer Guide* .\n\nIf you use the `AES256` encryption type, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts the images in the repository using an AES-256 encryption algorithm. For more information, see [Protecting data using server-side encryption with Amazon S3-managed encryption keys (SSE-S3)](https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) in the *Amazon Simple Storage Service Console Developer Guide* .",
Expand Down Expand Up @@ -491,7 +490,7 @@ func TestGatherPackage_docs_augmentation_unknownProperty(t *testing.T) {
Types: map[string]DocsTypes{},
}

packageSpec, _, reports := runTest(t, spec, docs)
packageSpec, reports := runTest(t, spec, docs)
assert.Equal(
t,
"The encryption type to use.\n If you u... Truncated",
Expand All @@ -516,7 +515,7 @@ func TestGatherPackage_regionGeneration(t *testing.T) {
},
},
}
packageSpec, _, _ := runTestWithRegions(t, spec, docs, []RegionInfo{
packageSpec, _ := runTestWithRegions(t, spec, docs, []RegionInfo{
{
Name: "us-west-2",
Description: "US West (Oregon)",
Expand Down

0 comments on commit 549a72d

Please sign in to comment.