-
Notifications
You must be signed in to change notification settings - Fork 9
/
integration_azure_test.go
55 lines (43 loc) · 1.36 KB
/
integration_azure_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package rockset_test
import (
"testing"
"github.com/stretchr/testify/suite"
"github.com/rockset/rockset-go-client"
"github.com/rockset/rockset-go-client/internal/test"
)
type AzureIntegrationsSuite struct {
suite.Suite
rc *rockset.RockClient
integrationName string
connectionString string
}
func (s *AzureIntegrationsSuite) TestAzureBlob() {
ctx := test.Context()
_, err := s.rc.CreateAzureBlobStorageIntegration(ctx, s.integrationName, s.connectionString)
s.Require().NoError(err)
integration, err := s.rc.GetIntegration(ctx, s.integrationName)
s.Require().NoError(err)
s.NotNil(integration)
err = s.rc.DeleteIntegration(ctx, s.integrationName)
s.Require().NoError(err)
}
func (s *AzureIntegrationsSuite) TearDownSuite() {
ctx := test.Context()
// cleanup the integration if it is still around
_, err := s.rc.GetIntegration(ctx, s.integrationName)
if err == nil {
s.T().Logf("deleting lingering azure integration: %s", s.integrationName)
err = s.rc.DeleteIntegration(ctx, s.integrationName)
s.Require().NoError(err)
}
}
func TestAzureIntegrations(t *testing.T) {
connectionString := test.SkipUnlessEnvSet(t, "AZURE_CONNECTION_STRING")
rc, randomName := vcrTestClient(t, t.Name())
s := AzureIntegrationsSuite{
rc: rc,
integrationName: randomName("azure"),
connectionString: connectionString,
}
suite.Run(t, &s)
}