Repository navigation
Refactor BaseTableCRUDTest to split the testing table preparation into a new base class - #1153
Conversation
15883a4 to
5881ed5
Compare
| @@ -0,0 +1,97 @@ | |||
| package io.unitycatalog.server.base.table; | |||
There was a problem hiding this comment.
This file is split from BaseTableCRUDTest.java
35e90fc to
5498d8d
Compare
6bd9253 to
313ed63
Compare
|
|
||
| @Test | ||
| public void testListTablesWithNoNextPageTokenShouldReturnNull() throws Exception { | ||
| createCommonResources(); |
There was a problem hiding this comment.
This function is now called inside setUp() for these tests.
313ed63 to
9f2617f
Compare
| super.setUp(); | ||
| schemaOperations = createSchemaOperations(serverConfig); | ||
| tableOperations = createTableOperations(serverConfig); | ||
| createCommonResources(); |
There was a problem hiding this comment.
Do we need to clean those created common resources after each test ?
There was a problem hiding this comment.
Otherwise, I assume it will conflicts if we create those resources for the next test cases, right ?
There was a problem hiding this comment.
The entire catalog is deleted by BaseCRUDTest.cleanUp(), the lower level base class, despite that the catalog is created here.
It's a little weird but it's been like that. Maybe the reason is that not all tests based on BaseCRUDTest would need a catalog (or two).
| .typePrecision(10) | ||
| .typeScale(0) |
There was a problem hiding this comment.
Why do we need the precision and scale for the integer type ? seems like those are definition for the float or double data types, right ?
There was a problem hiding this comment.
Yeah. I just copied this over so I didn't check. Removed.
| .properties(TestUtils.PROPERTIES) | ||
| .comment(TestUtils.COMMENT) | ||
| .storageLocation(storageLocation) | ||
| .tableType(TableType.EXTERNAL) |
There was a problem hiding this comment.
Since we don't support managed table currently, so we have to use the EXTERNAL right ?
There was a problem hiding this comment.
That's right. This will soon be changed to a parameter by the following PR.
9f2617f to
df5e26c
Compare
a11023e to
0ae1405
Compare
0ae1405 to
bdfea31
Compare
a74cf4d to
9e82c72
Compare
## 🥞 Stacked PR Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1135/files) to review incremental changes. - [**staging_table_service**](#1135) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1135/files)] - [refactor_base_table_crud_test](#1153) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1153/files/90c0f2a454c595eeb19df146f38a74e404de61b9..9e82c72fb64a8f5b50a11e0558b01ebb86f906a5)] - [staging_table_cli_test](#1136) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1136/files/9e82c72fb64a8f5b50a11e0558b01ebb86f906a5..b7cbb71bbf046d9926394052258e625b9921d303)] --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated Support managed table creation - Update TableService for creation of managed tables - Update API for CreateTable to make storage_location optional for managed tables - Enhance TemporaryTableCredentialsService with staging table support - Update KeyMapper to also check staging tables - Update repository classes to use new helper methods <!-- Please state what you've changed and how it might affect the users. --> Related issue is: #1143 --------- Signed-off-by: Yi Li <[email protected]> Co-authored-by: Tathagata Das <[email protected]>
tdas
left a comment
There was a problem hiding this comment.
LGTM on the incremental changes. will wait for the earlier prs in the stack to be merged first.
…o a new base class BaseTableCRUDTestEnv. This new base class BaseTableCRUDTestEnv will also be used by a new test for table commits. Signed-off-by: Yi Li <[email protected]>
9e82c72 to
8c05018
Compare
Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1135/files) to review incremental changes. - [**staging_table_service**](unitycatalog#1135) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1135/files)] - [refactor_base_table_crud_test](unitycatalog#1153) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1153/files/90c0f2a454c595eeb19df146f38a74e404de61b9..9e82c72fb64a8f5b50a11e0558b01ebb86f906a5)] - [staging_table_cli_test](unitycatalog#1136) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1136/files/9e82c72fb64a8f5b50a11e0558b01ebb86f906a5..b7cbb71bbf046d9926394052258e625b9921d303)] --------- **PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated Support managed table creation - Update TableService for creation of managed tables - Update API for CreateTable to make storage_location optional for managed tables - Enhance TemporaryTableCredentialsService with staging table support - Update KeyMapper to also check staging tables - Update repository classes to use new helper methods <!-- Please state what you've changed and how it might affect the users. --> Related issue is: unitycatalog#1143 --------- Signed-off-by: Yi Li <[email protected]> Co-authored-by: Tathagata Das <[email protected]>
…o a new base class (unitycatalog#1153) Use this [link](https://github.com/unitycatalog/unitycatalog/pull/1153/files) to review incremental changes. - [**refactor_base_table_crud_test**](unitycatalog#1153) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1153/files)] - [staging_table_cli_test](unitycatalog#1136) [[Files changed](https://github.com/unitycatalog/unitycatalog/pull/1136/files/8c0501897d14d08f1821d8c1cd93975305ebc3d8..95408a203472f015bd63cea1386e1c9134332373)] --------- **PR Checklist** - [X] A description of the changes is added to the description of this PR. - [ ] If there is a related issue, make sure it is linked to this PR. - [ ] If you've fixed a bug or added code that should be tested, add tests! - [ ] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Refactor BaseTableCRUDTest to split the testing table preparation into a new base class BaseTableCRUDTestEnv. This new base class BaseTableCRUDTestEnv will also be used by a new test for table commits. The remaining part in BaseTableCRUDTest is the table crud tests. Also createCommonResources() is called automatically for all tests based on BaseTableCRUDTestEnv. Signed-off-by: Yi Li <[email protected]>
🥞 Stacked PR
Use this link to review incremental changes.
PR Checklist
docsis updatedDescription of changes
Refactor BaseTableCRUDTest to split the testing table preparation into a new base class BaseTableCRUDTestEnv.
This new base class BaseTableCRUDTestEnv will also be used by a new test for table commits.
The remaining part in BaseTableCRUDTest is the table crud tests.
Also createCommonResources() is called automatically for all tests based on BaseTableCRUDTestEnv.