sqs-browse: fixed pad printf and fixed test parallel
This commit is contained in:
parent
c9a31eae35
commit
fb749aaee2
4 changed files with 20 additions and 15 deletions
|
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
type TestData []map[string]interface{}
|
||||
|
||||
func SetupTestTable(t *testing.T, tableName string, testData TestData) *dynamodb.Client {
|
||||
func SetupTestTable(t *testing.T, tableName string, testData TestData) (*dynamodb.Client, func()) {
|
||||
t.Helper()
|
||||
ctx := context.Background()
|
||||
|
||||
|
|
@ -26,10 +26,6 @@ func SetupTestTable(t *testing.T, tableName string, testData TestData) *dynamodb
|
|||
dynamoClient := dynamodb.NewFromConfig(cfg,
|
||||
dynamodb.WithEndpointResolver(dynamodb.EndpointResolverFromURL("http://localhost:8000")))
|
||||
|
||||
dynamoClient.DeleteTable(ctx, &dynamodb.DeleteTableInput{
|
||||
TableName: aws.String(tableName),
|
||||
})
|
||||
|
||||
_, err = dynamoClient.CreateTable(ctx, &dynamodb.CreateTableInput{
|
||||
TableName: aws.String(tableName),
|
||||
KeySchema: []types.KeySchemaElement{
|
||||
|
|
@ -58,5 +54,9 @@ func SetupTestTable(t *testing.T, tableName string, testData TestData) *dynamodb
|
|||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
return dynamoClient
|
||||
return dynamoClient, func() {
|
||||
dynamoClient.DeleteTable(ctx, &dynamodb.DeleteTableInput{
|
||||
TableName: aws.String(tableName),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue