Skip to content

Commit

Permalink
Fix compilation of the perf test refactor (pulumi#1018)
Browse files Browse the repository at this point in the history
  • Loading branch information
t0yv0 committed Jun 11, 2021
1 parent e0948c3 commit b7b1020
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
24 changes: 0 additions & 24 deletions misc/test/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/base64"
"fmt"
"net/url"
"os"
"path"
"strings"
"testing"
Expand Down Expand Up @@ -65,8 +64,6 @@ func TestAccAwsGoFargate(t *testing.T) {
integration.ProgramTest(t, &test)
}



func TestAccAwsGoS3FolderComponent(t *testing.T) {
test := getAWSBase(t).
With(integration.ProgramTestOptions{
Expand Down Expand Up @@ -554,24 +551,3 @@ func TestAccAwsTsLambdaEfs(t *testing.T) {

integration.ProgramTest(t, &test)
}

func getAWSBase(t *testing.T) integration.ProgramTestOptions {
awsRegion := getAwsRegion()
base := getBaseOptions(t)
awsBase := base.With(integration.ProgramTestOptions{
Config: map[string]string{
"aws:region": awsRegion,
},
})
return awsBase
}

func getAwsRegion() string {
awsRegion := os.Getenv("AWS_REGION")
if awsRegion == "" {
awsRegion = "us-west-1"
fmt.Println("Defaulting AWS_REGION to 'us-west-1'. You can override using the AWS_REGION environment variable")
}

return awsRegion
}
23 changes: 23 additions & 0 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,26 @@ func assertHTTPHelloWorld(t *testing.T, output interface{}, headers map[string]s
return assert.Equal(t, "Hello, World!\n", s)
})
}

// Below: aws-specifics shared so that -tags Performance and -tags Aws compilation works.

func getAWSBase(t *testing.T) integration.ProgramTestOptions {
awsRegion := getAwsRegion()
base := getBaseOptions(t)
awsBase := base.With(integration.ProgramTestOptions{
Config: map[string]string{
"aws:region": awsRegion,
},
})
return awsBase
}

func getAwsRegion() string {
awsRegion := os.Getenv("AWS_REGION")
if awsRegion == "" {
awsRegion = "us-west-1"
fmt.Println("Defaulting AWS_REGION to 'us-west-1'. You can override using the AWS_REGION environment variable")
}

return awsRegion
}
9 changes: 9 additions & 0 deletions misc/test/performance_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

package test

import (
"path"
"testing"
"time"

"github.com/pulumi/pulumi/pkg/v3/testing/integration"
"github.com/stretchr/testify/assert"
)

func TestAccAwsGoS3Folder(t *testing.T) {
test := getAWSBase(t).
With(integration.ProgramTestOptions{
Expand Down

0 comments on commit b7b1020

Please sign in to comment.