Skip to content

Commit

Permalink
Cloud test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed May 10, 2024
1 parent 2c5f952 commit cb19583
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
TEMPORAL_NAMESPACE: sdk-ci.a2dd6
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
TEMPORAL_CLIENT_CLOUD_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
steps:
- uses: actions/checkout@v3
with:
Expand Down
15 changes: 11 additions & 4 deletions test/cloud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package test_test
import (
"context"
"flag"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -51,12 +52,18 @@ type CloudTestSuite struct {
*require.Assertions
suite.Suite

config Config
client client.CloudOperationsClient

namespace string
apiKey string
}

func (c *CloudTestSuite) SetupSuite() {
c.Assertions = require.New(c.T())
c.namespace = os.Getenv("TEMPORAL_NAMESPACE")
c.NotEmpty(c.namespace)
c.apiKey = os.Getenv("TEMPORAL_CLIENT_CLOUD_API_KEY")
c.NotEmpty(c.apiKey)
}

func (c *CloudTestSuite) TearDownSuite() {
Expand All @@ -65,7 +72,7 @@ func (c *CloudTestSuite) TearDownSuite() {
func (c *CloudTestSuite) SetupTest() {
var err error
c.client, err = client.DialCloudOperationsClient(context.Background(), client.CloudOperationsClientOptions{
ConnectionOptions: client.ConnectionOptions{TLS: c.config.TLS},
Credentials: client.NewAPIKeyStaticCredentials(c.apiKey),
})
c.NoError(err)
}
Expand All @@ -79,8 +86,8 @@ func (c *CloudTestSuite) TearDownTest() {
func (c *CloudTestSuite) TestSimpleGetNamespace() {
resp, err := c.client.CloudService().GetNamespace(
context.Background(),
&cloudservice.GetNamespaceRequest{Namespace: c.config.Namespace},
&cloudservice.GetNamespaceRequest{Namespace: c.namespace},
)
c.NoError(err)
c.Equal(c.config.Namespace, resp.Namespace.Namespace)
c.Equal(c.namespace, resp.Namespace.Namespace)
}

0 comments on commit cb19583

Please sign in to comment.