diff --git a/sdk/tables/aztable/ci.yml b/sdk/tables/aztable/ci.yml new file mode 100644 index 000000000000..1e3a644b906c --- /dev/null +++ b/sdk/tables/aztable/ci.yml @@ -0,0 +1,15 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. +trigger: + paths: + include: + - sdk/tables/aztable/ + +pr: + paths: + include: + - sdk/tables/aztable/ + +stages: +- template: ../../../eng/pipelines/templates/jobs/archetype-sdk-client.yml + parameters: + ServiceDirectory: 'tables' diff --git a/sdk/tables/aztable/table_client_test.go b/sdk/tables/aztable/table_client_test.go index 718f8928da26..17fd0560dc5c 100644 --- a/sdk/tables/aztable/table_client_test.go +++ b/sdk/tables/aztable/table_client_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" + "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" "github.com/Azure/azure-sdk-for-go/sdk/internal/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -22,18 +22,18 @@ import ( type tableClientLiveTests struct { suite.Suite endpointType EndpointType - mode testframework.RecordMode + mode recording.RecordMode } // Hookup to the testing framework func TestTableClient_Storage(t *testing.T) { - storage := tableClientLiveTests{endpointType: StorageEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + storage := tableClientLiveTests{endpointType: StorageEndpoint, mode: recording.Playback /* change to Record to re-record tests */} suite.Run(t, &storage) } // Hookup to the testing framework func TestTableClient_Cosmos(t *testing.T) { - cosmos := tableClientLiveTests{endpointType: CosmosEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + cosmos := tableClientLiveTests{endpointType: CosmosEndpoint, mode: recording.Playback /* change to Record to re-record tests */} suite.Run(t, &cosmos) } diff --git a/sdk/tables/aztable/table_service_client_test.go b/sdk/tables/aztable/table_service_client_test.go index c55e60489cf6..2c4d55f006df 100644 --- a/sdk/tables/aztable/table_service_client_test.go +++ b/sdk/tables/aztable/table_service_client_test.go @@ -9,8 +9,8 @@ import ( "net/http" "testing" + "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/internal/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) @@ -18,18 +18,18 @@ import ( type tableServiceClientLiveTests struct { suite.Suite endpointType EndpointType - mode testframework.RecordMode + mode recording.RecordMode } // Hookup to the testing framework func TestServiceClient_Storage(t *testing.T) { - storage := tableServiceClientLiveTests{endpointType: StorageEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + storage := tableServiceClientLiveTests{endpointType: StorageEndpoint, mode: recording.Playback /* change to Record to re-record tests */} suite.Run(t, &storage) } // Hookup to the testing framework func TestServiceClient_Cosmos(t *testing.T) { - cosmos := tableServiceClientLiveTests{endpointType: CosmosEndpoint, mode: testframework.Playback /* change to Record to re-record tests */} + cosmos := tableServiceClientLiveTests{endpointType: CosmosEndpoint, mode: recording.Playback /* change to Record to re-record tests */} suite.Run(t, &cosmos) } diff --git a/sdk/tables/aztable/zt_tableRecordedTests.go b/sdk/tables/aztable/zt_table_recorded_tests.go similarity index 82% rename from sdk/tables/aztable/zt_tableRecordedTests.go rename to sdk/tables/aztable/zt_table_recorded_tests.go index e39cdd6a3c5c..257bef5e34fe 100644 --- a/sdk/tables/aztable/zt_tableRecordedTests.go +++ b/sdk/tables/aztable/zt_table_recorded_tests.go @@ -11,16 +11,16 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/internal/testframework" + "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/stretchr/testify/assert" ) type tablesRecordedTests struct{} type testContext struct { - recording *testframework.Recording + recording *recording.Recording client *TableServiceClient - context *testframework.TestContext + context *recording.TestContext } const ( @@ -54,7 +54,7 @@ func cosmosURI(accountName string, endpointSuffix string) string { } // create the test specific TableClient and wire it up to recordings -func recordedTestSetup(t *testing.T, testName string, endpointType EndpointType, mode testframework.RecordMode) { +func recordedTestSetup(t *testing.T, testName string, endpointType EndpointType, mode recording.RecordMode) { var accountName string var suffix string var cred *SharedKeyCredential @@ -63,27 +63,27 @@ func recordedTestSetup(t *testing.T, testName string, endpointType EndpointType, assert := assert.New(t) // init the test framework - context := testframework.NewTestContext(func(msg string) { assert.FailNow(msg) }, func(msg string) { t.Log(msg) }, func() string { return testName }) - recording, err := testframework.NewRecording(context, mode) + context := recording.NewTestContext(func(msg string) { assert.FailNow(msg) }, func(msg string) { t.Log(msg) }, func() string { return testName }) + r, err := recording.NewRecording(context, mode) assert.Nil(err) if endpointType == StorageEndpoint { - accountName, err = recording.GetRecordedVariable(storageAccountNameEnvVar, testframework.Default) - suffix = recording.GetOptionalRecordedVariable(storageEndpointSuffixEnvVar, DefaultStorageSuffix, testframework.Default) - secret, err = recording.GetRecordedVariable(storageAccountKeyEnvVar, testframework.Secret_Base64String) + accountName, err = r.GetRecordedVariable(storageAccountNameEnvVar, recording.Default) + suffix = r.GetOptionalRecordedVariable(storageEndpointSuffixEnvVar, DefaultStorageSuffix, recording.Default) + secret, err = r.GetRecordedVariable(storageAccountKeyEnvVar, recording.Secret_Base64String) cred, _ = NewSharedKeyCredential(accountName, secret) uri = storageURI(accountName, suffix) } else { - accountName, err = recording.GetRecordedVariable(cosmosAccountNameEnnVar, testframework.Default) - suffix = recording.GetOptionalRecordedVariable(cosmosEndpointSuffixEnvVar, DefaultCosmosSuffix, testframework.Default) - secret, err = recording.GetRecordedVariable(cosmosAccountKeyEnvVar, testframework.Secret_Base64String) + accountName, err = r.GetRecordedVariable(cosmosAccountNameEnnVar, recording.Default) + suffix = r.GetOptionalRecordedVariable(cosmosEndpointSuffixEnvVar, DefaultCosmosSuffix, recording.Default) + secret, err = r.GetRecordedVariable(cosmosAccountKeyEnvVar, recording.Secret_Base64String) cred, _ = NewSharedKeyCredential(accountName, secret) uri = cosmosURI(accountName, suffix) } - client, err := NewTableServiceClient(uri, cred, &TableClientOptions{HTTPClient: recording, Retry: azcore.RetryOptions{MaxRetries: -1}}) + client, err := NewTableServiceClient(uri, cred, &TableClientOptions{HTTPClient: r, Retry: azcore.RetryOptions{MaxRetries: -1}}) assert.Nil(err) - clientsMap[testName] = &testContext{client: client, recording: recording, context: &context} + clientsMap[testName] = &testContext{client: client, recording: r, context: &context} } func recordedTestTeardown(key string) {