Merge pull request #13572 from Budibase/fix/search-tests-bulk

Search test improvement - bulk import
This commit is contained in:
Michael Drury 2024-04-26 16:06:28 +01:00 committed by GitHub
commit dac65bc8de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 16 deletions

View File

@ -128,6 +128,7 @@ export async function importToRows(
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let row = data[i] let row = data[i]
row._id = generateRowID(table._id!) row._id = generateRowID(table._id!)
row.type = "row"
row.tableId = table._id row.tableId = table._id
// We use a reference to table here and update it after input processing, // We use a reference to table here and update it after input processing,

View File

@ -61,9 +61,7 @@ describe.each([
} }
async function createRows(rows: Record<string, any>[]) { async function createRows(rows: Record<string, any>[]) {
for (const row of rows) { await config.api.row.bulkImport(table._id!, { rows })
await config.api.row.save(table._id!, row)
}
} }
class SearchAssertion { class SearchAssertion {

View File

@ -131,11 +131,6 @@ export async function search(
}, },
relationships, relationships,
} }
// make sure only rows returned
request.filters!.equal = {
...request.filters?.equal,
type: "row",
}
if (params.sort) { if (params.sort) {
const sortField = table.schema[params.sort] const sortField = table.schema[params.sort]

View File

@ -11612,7 +11612,7 @@ fs.realpath@^1.0.0:
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
fsevents@^2.3.2, fsevents@~2.3.1, fsevents@~2.3.2: fsevents@^2.3.2, fsevents@~2.3.2:
version "2.3.3" version "2.3.3"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
@ -19761,13 +19761,6 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1,
dependencies: dependencies:
estree-walker "^0.6.1" estree-walker "^0.6.1"
rollup@2.45.2:
version "2.45.2"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.45.2.tgz#8fb85917c9f35605720e92328f3ccbfba6f78b48"
integrity sha512-kRRU7wXzFHUzBIv0GfoFFIN3m9oteY4uAsKllIpQDId5cfnkWF2J130l+27dzDju0E6MScKiV0ZM5Bw8m4blYQ==
optionalDependencies:
fsevents "~2.3.1"
rollup@^2.36.2, rollup@^2.45.2: rollup@^2.36.2, rollup@^2.45.2:
version "2.79.1" version "2.79.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7"