Updating tests to be more consistent in how they pick to create an internal or external table.
This commit is contained in:
parent
fd29b8d949
commit
d0f989597a
|
@ -140,7 +140,12 @@ describe.each([
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const tableConfig = generateTableConfig()
|
const tableConfig = generateTableConfig()
|
||||||
const table = await config.createTable(tableConfig)
|
let table
|
||||||
|
if (dsProvider) {
|
||||||
|
table = await config.createExternalTable(tableConfig)
|
||||||
|
} else {
|
||||||
|
table = await config.createTable(tableConfig)
|
||||||
|
}
|
||||||
tableId = table._id!
|
tableId = table._id!
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ describe.each([
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return config.createTable({
|
return config.createExternalTable({
|
||||||
...priceTable(),
|
...priceTable(),
|
||||||
sourceId: datasource._id,
|
sourceId: datasource._id,
|
||||||
sourceType: TableSourceType.EXTERNAL,
|
sourceType: TableSourceType.EXTERNAL,
|
||||||
|
|
|
@ -93,7 +93,7 @@ describe.skip("external", () => {
|
||||||
describe("search", () => {
|
describe("search", () => {
|
||||||
const rows: Row[] = []
|
const rows: Row[] = []
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
const table = await config.createTable({
|
const table = await config.createExternalTable({
|
||||||
...tableData,
|
...tableData,
|
||||||
sourceId: externalDatasource._id,
|
sourceId: externalDatasource._id,
|
||||||
})
|
})
|
||||||
|
|
|
@ -574,7 +574,21 @@ class TestConfiguration {
|
||||||
config.sourceId = this.datasource._id
|
config.sourceId = this.datasource._id
|
||||||
config.sourceType = TableSourceType.EXTERNAL
|
config.sourceType = TableSourceType.EXTERNAL
|
||||||
}
|
}
|
||||||
|
return this.updateTable(config, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
async createExternalTable(
|
||||||
|
config?: TableToBuild,
|
||||||
|
options = { skipReassigning: false }
|
||||||
|
) {
|
||||||
|
if (config != null && config._id) {
|
||||||
|
delete config._id
|
||||||
|
}
|
||||||
|
config = config || basicTable()
|
||||||
|
if (this.datasource?._id) {
|
||||||
|
config.sourceId = this.datasource._id
|
||||||
|
config.sourceType = TableSourceType.EXTERNAL
|
||||||
|
}
|
||||||
return this.updateTable(config, options)
|
return this.updateTable(config, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue