-
Notifications
You must be signed in to change notification settings - Fork 99
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
Replace AWS.Kinesis/Stream with AWS.S3/Bucket in functional tests #5227
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import aws as aws | ||
|
||
param streamName string | ||
param bucketName string | ||
|
||
resource stream 'AWS.Kinesis/Stream@default' = { | ||
alias: streamName | ||
resource bucket 'AWS.S3/Bucket@default' = { | ||
alias: bucketName | ||
properties: { | ||
Name: streamName | ||
RetentionPeriodHours: 168 | ||
ShardCount: 3 | ||
BucketName: bucketName | ||
Tags: [ | ||
{ | ||
Key: 'testKey' | ||
Value: 'testValue' | ||
} | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import aws as aws | ||
|
||
param streamName string | ||
param bucketName string | ||
|
||
resource stream 'AWS.Kinesis/Stream@default' = { | ||
alias: streamName | ||
resource bucket 'AWS.S3/Bucket@default' = { | ||
alias: bucketName | ||
properties: { | ||
Name: streamName | ||
RetentionPeriodHours: 48 | ||
ShardCount: 3 | ||
BucketName: bucketName | ||
Tags: [ | ||
{ | ||
Key: 'testKey' | ||
Value: 'testValue2' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this value tested? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
] | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
// ------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// ------------------------------------------------------------ | ||
|
||
package resource_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/google/uuid" | ||
"github.com/project-radius/radius/test/functional/corerp" | ||
"github.com/project-radius/radius/test/step" | ||
"github.com/project-radius/radius/test/validation" | ||
) | ||
|
||
func Test_AWS_S3Bucket(t *testing.T) { | ||
template := "testdata/aws-s3-bucket.bicep" | ||
name := generateS3BucketName() | ||
|
||
test := corerp.NewCoreRPTest(t, name, []corerp.TestStep{ | ||
{ | ||
Executor: step.NewDeployExecutor(template, "bucketName="+name), | ||
SkipKubernetesOutputResourceValidation: true, | ||
SkipObjectValidation: true, | ||
AWSResources: &validation.AWSResourceSet{ | ||
Resources: []validation.AWSResource{ | ||
{ | ||
Name: name, | ||
Type: validation.AWSS3BucketResourceType, | ||
Identifier: name, | ||
Properties: map[string]any{ | ||
"BucketName": name, | ||
"Tags": []any{ | ||
map[string]any{ | ||
"Key": "testKey", | ||
"Value": "testValue", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
test.Test(t) | ||
} | ||
|
||
func Test_AWS_S3Bucket_Existing(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add doc here to identify the difference between this test and the one above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you point me to the doc? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. basically the idea is that the first step deploys the S3Bucket resource, then the second step uses the bicep |
||
template := "testdata/aws-s3-bucket.bicep" | ||
templateExisting := "testdata/aws-s3-bucket-existing.bicep" | ||
name := generateS3BucketName() | ||
|
||
test := corerp.NewCoreRPTest(t, name, []corerp.TestStep{ | ||
{ | ||
Executor: step.NewDeployExecutor(template, "bucketName="+name), | ||
SkipKubernetesOutputResourceValidation: true, | ||
SkipObjectValidation: true, | ||
AWSResources: &validation.AWSResourceSet{ | ||
Resources: []validation.AWSResource{ | ||
{ | ||
Name: name, | ||
Type: validation.AWSS3BucketResourceType, | ||
Identifier: name, | ||
Properties: map[string]any{ | ||
"BucketName": name, | ||
"Tags": []any{ | ||
map[string]any{ | ||
"Key": "testKey", | ||
"Value": "testValue", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
// The following step deploys an existing resource and validates that it retrieves the same | ||
// resource as was deployed above | ||
{ | ||
Executor: step.NewDeployExecutor(templateExisting, "bucketName="+name), | ||
SkipKubernetesOutputResourceValidation: true, | ||
SkipObjectValidation: true, | ||
AWSResources: &validation.AWSResourceSet{ | ||
Resources: []validation.AWSResource{ | ||
{ | ||
Name: name, | ||
Type: validation.AWSS3BucketResourceType, | ||
Identifier: name, | ||
Properties: map[string]any{ | ||
"BucketName": name, | ||
"Tags": []any{ | ||
map[string]any{ | ||
"Key": "testKey", | ||
"Value": "testValue", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
test.Test(t) | ||
} | ||
|
||
func generateS3BucketName() string { | ||
return "radiusfunctionaltestbucket-" + uuid.New().String() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this run into length constraints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be 63 characters (e.g.
radiusfunctionaltestbucket-4c4f3c7e-8341-41f3-a275-e4b39bbcc449
), which conforms to our spec as well as AWS', so we should be good