Fixing issues with automation test cases running steps outside of a tenant.
This commit is contained in:
parent
ca7d532443
commit
3258aead45
|
@ -43,6 +43,7 @@ describe("run misc tests", () => {
|
||||||
|
|
||||||
describe("test table utilities", () => {
|
describe("test table utilities", () => {
|
||||||
it("should be able to import a CSV", async () => {
|
it("should be able to import a CSV", async () => {
|
||||||
|
return config.doInContext(null, async () => {
|
||||||
const table = await config.createTable({
|
const table = await config.createTable({
|
||||||
name: "table",
|
name: "table",
|
||||||
type: "table",
|
type: "table",
|
||||||
|
@ -92,4 +93,5 @@ describe("run misc tests", () => {
|
||||||
expect(rows[0].c).toEqual("3")
|
expect(rows[0].c).toEqual("3")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
})
|
})
|
|
@ -1,4 +1,6 @@
|
||||||
const TestConfig = require("../../../tests/utilities/TestConfiguration")
|
const TestConfig = require("../../../tests/utilities/TestConfiguration")
|
||||||
|
const { TENANT_ID } = require("../../../tests/utilities/structures")
|
||||||
|
const { doInTenant } = require("@budibase/backend-core/tenancy")
|
||||||
const actions = require("../../actions")
|
const actions = require("../../actions")
|
||||||
const emitter = require("../../../events/index")
|
const emitter = require("../../../events/index")
|
||||||
const env = require("../../../environment")
|
const env = require("../../../environment")
|
||||||
|
@ -31,6 +33,7 @@ exports.runInProd = async fn => {
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.runStep = async function runStep(stepId, inputs) {
|
exports.runStep = async function runStep(stepId, inputs) {
|
||||||
|
return doInTenant(TENANT_ID, async () => {
|
||||||
let step = await actions.getAction(stepId)
|
let step = await actions.getAction(stepId)
|
||||||
expect(step).toBeDefined()
|
expect(step).toBeDefined()
|
||||||
return step({
|
return step({
|
||||||
|
@ -40,6 +43,7 @@ exports.runStep = async function runStep(stepId, inputs) {
|
||||||
apiKey: exports.apiKey,
|
apiKey: exports.apiKey,
|
||||||
emitter,
|
emitter,
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.apiKey = "test"
|
exports.apiKey = "test"
|
||||||
|
|
Loading…
Reference in New Issue