Skip to content

Commit 37eaeb9

Browse files
committed
import_into: add create schemas sdk for cloud
1 parent ecdfc15 commit 37eaeb9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lightning/pkg/cloud/sdk.go renamed to pkg/executor/importer/cloud_sdk.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
package cloud
15+
package importer
16+
1617

1718
import (
1819
"context"

lightning/pkg/cloud/sdk_test.go renamed to pkg/executor/importer/cloud_sdk_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cloud
1+
package importer_test
22

33
import (
44
"context"
@@ -9,6 +9,7 @@ import (
99
"testing"
1010

1111
"github.com/DATA-DOG/go-sqlmock"
12+
"github.com/pingcap/tidb/pkg/executor/importer"
1213
"github.com/stretchr/testify/require"
1314
)
1415

@@ -45,7 +46,7 @@ func TestCreateSchemas_Success(t *testing.T) {
4546

4647
// invoke CreateSchemas
4748
path := "file://" + tmp
48-
err = CreateSchemas(context.Background(), path, db, WithConcurrency(1))
49+
err = importer.CreateSchemas(context.Background(), path, db, importer.WithConcurrency(1))
4950
require.NoError(t, err)
5051
require.NoError(t, mock.ExpectationsWereMet())
5152
}
@@ -65,7 +66,7 @@ func TestCreateSchemas_DBError(t *testing.T) {
6566
WillReturnError(sql.ErrConnDone)
6667

6768
path := "file://" + tmp
68-
err = CreateSchemas(context.Background(), path, db, WithConcurrency(1))
69+
err = importer.CreateSchemas(context.Background(), path, db, importer.WithConcurrency(1))
6970
require.Error(t, err)
7071
require.NoError(t, mock.ExpectationsWereMet())
7172
}

0 commit comments

Comments
 (0)