Updating some test cases which were failing silently and changing how environment want handled.
This commit is contained in:
parent
82e73ae0ea
commit
c4683a3743
|
@ -37,7 +37,7 @@ describe("/accesslevels", () => {
|
|||
beforeEach(async () => {
|
||||
instanceId = (await createInstance(request, appId))._id
|
||||
model = await createModel(request, appId, instanceId)
|
||||
view = await createView(request, appId, instanceId)
|
||||
view = await createView(request, appId, instanceId, model._id)
|
||||
})
|
||||
|
||||
describe("create", () => {
|
||||
|
|
|
@ -67,9 +67,10 @@ exports.createModel = async (request, appId, instanceId, model) => {
|
|||
return res.body
|
||||
}
|
||||
|
||||
exports.createView = async (request, appId, instanceId, view) => {
|
||||
exports.createView = async (request, appId, instanceId, modelId, view) => {
|
||||
view = view || {
|
||||
map: "function(doc) { emit(doc[doc.key], doc._id); } ",
|
||||
modelId: modelId,
|
||||
}
|
||||
|
||||
const res = await request
|
||||
|
@ -262,11 +263,7 @@ exports.builderEndpointShouldBlockNormalUsers = async ({
|
|||
appId,
|
||||
instanceId,
|
||||
}) => {
|
||||
const headers = await createUserWithAdminPermissions(
|
||||
request,
|
||||
appId,
|
||||
instanceId
|
||||
)
|
||||
const headers = await createUserWithAdminPermissions(request, appId, instanceId)
|
||||
|
||||
await createRequest(request, method, url, body)
|
||||
.set(headers)
|
||||
|
|
|
@ -120,6 +120,10 @@ describe("/models", () => {
|
|||
testModel = await createModel(request, app._id, instance._id, testModel)
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
delete testModel._rev
|
||||
});
|
||||
|
||||
it("returns all the models for that instance in the response body", done => {
|
||||
request
|
||||
.get(`/api/models`)
|
||||
|
|
|
@ -7,4 +7,5 @@ module.exports = {
|
|||
COUCH_DB_URL: process.env.COUCH_DB_URL,
|
||||
SALT_ROUNDS: process.env.SALT_ROUNDS,
|
||||
LOGGER: process.env.LOGGER,
|
||||
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const triggers = require("./triggers")
|
||||
const environment = require("../environment")
|
||||
const workerFarm = require("worker-farm")
|
||||
const singleThread = require("./thread")
|
||||
|
||||
|
@ -21,7 +22,7 @@ function runWorker(job) {
|
|||
*/
|
||||
module.exports.init = function() {
|
||||
triggers.workflowQueue.process(async job => {
|
||||
if (process.env.BUDIBASE_ENVIRONMENT === "PRODUCTION") {
|
||||
if (environment.BUDIBASE_ENVIRONMENT === "PRODUCTION") {
|
||||
await runWorker(job)
|
||||
} else {
|
||||
await singleThread(job)
|
||||
|
|
Loading…
Reference in New Issue