Merge pull request #14484 from Budibase/fix/sqs-default-dev-on
Enable SQS by default in development
This commit is contained in:
commit
4b5ab43266
|
@ -267,5 +267,5 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
|
|||
// default values set correctly and their types flow through the system.
|
||||
export const flags = new FlagSet({
|
||||
DEFAULT_VALUES: Flag.boolean(false),
|
||||
SQS: Flag.boolean(false),
|
||||
SQS: Flag.boolean(env.isDev()),
|
||||
})
|
||||
|
|
|
@ -47,7 +47,6 @@ async function init() {
|
|||
HTTP_LOGGING: "0",
|
||||
VERSION: "0.0.0+local",
|
||||
PASSWORD_MIN_LENGTH: "1",
|
||||
TENANT_FEATURE_FLAGS: "*:SQS",
|
||||
}
|
||||
|
||||
config = { ...config, ...existingConfig }
|
||||
|
|
|
@ -159,7 +159,7 @@ describe("run misc tests", () => {
|
|||
const rowThree = rows.find(row => row.e === 3)
|
||||
expect(rowThree.a).toEqual("9")
|
||||
expect(rowThree.f).toEqual(["Two", "Four"])
|
||||
expect(rowThree.g).toEqual(null)
|
||||
expect(rowThree.g).toEqual(undefined)
|
||||
|
||||
const rowFour = rows.find(row => row.e === 4)
|
||||
expect(rowFour.a).toEqual("13")
|
||||
|
|
|
@ -95,9 +95,11 @@ describe.each([
|
|||
let envCleanup: (() => void) | undefined
|
||||
|
||||
beforeAll(async () => {
|
||||
await withCoreEnv({ TENANT_FEATURE_FLAGS: "*SQS" }, () => config.init())
|
||||
if (isSqs) {
|
||||
envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*SQS" })
|
||||
await withCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" }, () => config.init())
|
||||
if (isLucene) {
|
||||
envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:!SQS" })
|
||||
} else if (isSqs) {
|
||||
envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" })
|
||||
}
|
||||
|
||||
if (dsProvider) {
|
||||
|
|
|
@ -68,7 +68,11 @@ describe.each([
|
|||
|
||||
beforeAll(async () => {
|
||||
await withCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" }, () => config.init())
|
||||
if (isSqs) {
|
||||
if (isLucene) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:!SQS",
|
||||
})
|
||||
} else if (isSqs) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:SQS",
|
||||
})
|
||||
|
|
|
@ -35,7 +35,7 @@ const { basicTable } = setup.structures
|
|||
const ISO_REGEX_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/
|
||||
|
||||
describe.each([
|
||||
["internal", undefined],
|
||||
["sqs", undefined],
|
||||
[DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)],
|
||||
[DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)],
|
||||
[DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)],
|
||||
|
@ -290,7 +290,7 @@ describe.each([
|
|||
expected._rev = expect.stringMatching(/^2-.+/)
|
||||
}
|
||||
|
||||
expect(updatedTable).toEqual(expected)
|
||||
expect(updatedTable).toEqual(expect.objectContaining(expected))
|
||||
|
||||
const persistedTable = await config.api.table.get(updatedTable._id!)
|
||||
expected = {
|
||||
|
@ -304,7 +304,7 @@ describe.each([
|
|||
if (isInternal) {
|
||||
expected._rev = expect.stringMatching(/^2-.+/)
|
||||
}
|
||||
expect(persistedTable).toEqual(expected)
|
||||
expect(persistedTable).toEqual(expect.objectContaining(expected))
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -687,7 +687,7 @@ describe.each([
|
|||
basicTable(datasource, { name: generator.guid() })
|
||||
)
|
||||
const res = await config.api.table.get(table._id!)
|
||||
expect(res).toEqual(table)
|
||||
expect(res).toEqual(expect.objectContaining(table))
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -727,10 +727,12 @@ describe.each([
|
|||
body: { message: `Table ${testTable._id} deleted.` },
|
||||
})
|
||||
expect(events.table.deleted).toHaveBeenCalledTimes(1)
|
||||
expect(events.table.deleted).toHaveBeenCalledWith({
|
||||
...testTable,
|
||||
tableId: testTable._id,
|
||||
})
|
||||
expect(events.table.deleted).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
...testTable,
|
||||
tableId: testTable._id,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
it("deletes linked references to the table after deletion", async () => {
|
||||
|
|
|
@ -444,7 +444,10 @@ describe("/views", () => {
|
|||
|
||||
assertJsonExport(res)
|
||||
expect(events.table.exported).toHaveBeenCalledTimes(1)
|
||||
expect(events.table.exported).toHaveBeenCalledWith(table, "json")
|
||||
expect(events.table.exported).toHaveBeenCalledWith(
|
||||
expect.objectContaining(table),
|
||||
"json"
|
||||
)
|
||||
})
|
||||
|
||||
it("should be able to export a table as CSV", async () => {
|
||||
|
@ -454,7 +457,10 @@ describe("/views", () => {
|
|||
|
||||
assertCSVExport(res)
|
||||
expect(events.table.exported).toHaveBeenCalledTimes(1)
|
||||
expect(events.table.exported).toHaveBeenCalledWith(table, "csv")
|
||||
expect(events.table.exported).toHaveBeenCalledWith(
|
||||
expect.objectContaining(table),
|
||||
"csv"
|
||||
)
|
||||
})
|
||||
|
||||
it("should be able to export a view as JSON", async () => {
|
||||
|
|
|
@ -97,7 +97,11 @@ describe.each([
|
|||
await withCoreEnv({ TENANT_FEATURE_FLAGS: isSqs ? "*:SQS" : "" }, () =>
|
||||
config.init()
|
||||
)
|
||||
if (isSqs) {
|
||||
if (isLucene) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:!SQS",
|
||||
})
|
||||
} else if (isSqs) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:SQS",
|
||||
})
|
||||
|
|
|
@ -45,7 +45,11 @@ describe.each([
|
|||
config.init()
|
||||
)
|
||||
|
||||
if (isSqs) {
|
||||
if (isLucene) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:!SQS",
|
||||
})
|
||||
} else if (isSqs) {
|
||||
envCleanup = setCoreEnv({
|
||||
TENANT_FEATURE_FLAGS: "*:SQS",
|
||||
})
|
||||
|
|
|
@ -30,7 +30,6 @@ async function init() {
|
|||
HTTP_LOGGING: "0",
|
||||
VERSION: "0.0.0+local",
|
||||
PASSWORD_MIN_LENGTH: "1",
|
||||
TENANT_FEATURE_FLAGS: "*:SQS",
|
||||
}
|
||||
|
||||
config = { ...config, ...existingConfig }
|
||||
|
|
|
@ -17,7 +17,9 @@ describe.each(["lucene", "sql"])("/api/global/auditlogs (%s)", method => {
|
|||
let envCleanup: (() => void) | undefined
|
||||
|
||||
beforeAll(async () => {
|
||||
if (method === "sql") {
|
||||
if (method === "lucene") {
|
||||
envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:!SQS" })
|
||||
} else if (method === "sql") {
|
||||
envCleanup = setCoreEnv({ TENANT_FEATURE_FLAGS: "*:SQS" })
|
||||
}
|
||||
await config.beforeAll()
|
||||
|
|
Loading…
Reference in New Issue