Merge pull request #7964 from Budibase/qa/real-couch-integration-tests
This commit is contained in:
commit
d9cdfd9357
|
@ -23,6 +23,15 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
services:
|
||||||
|
couchdb:
|
||||||
|
image: ibmcom/couchdb3
|
||||||
|
env:
|
||||||
|
COUCHDB_PASSWORD: budibase
|
||||||
|
COUCHDB_USER: budibase
|
||||||
|
ports:
|
||||||
|
- 4567:5984
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [14.x]
|
node-version: [14.x]
|
||||||
|
@ -53,13 +62,6 @@ jobs:
|
||||||
name: codecov-umbrella
|
name: codecov-umbrella
|
||||||
verbose: true
|
verbose: true
|
||||||
|
|
||||||
# TODO: parallelise this
|
|
||||||
- name: Cypress run
|
|
||||||
uses: cypress-io/github-action@v2
|
|
||||||
with:
|
|
||||||
install: false
|
|
||||||
command: yarn test:e2e:ci
|
|
||||||
|
|
||||||
- name: QA Core Integration Tests
|
- name: QA Core Integration Tests
|
||||||
run: |
|
run: |
|
||||||
cd qa-core
|
cd qa-core
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
const cypressConfig = require("../cypress.json")
|
const cypressConfig = require("../cypress.json")
|
||||||
const path = require("path")
|
|
||||||
|
|
||||||
const tmpdir = path.join(require("os").tmpdir(), ".budibase")
|
|
||||||
|
|
||||||
// normal development system
|
// normal development system
|
||||||
const SERVER_PORT = cypressConfig.env.PORT
|
const SERVER_PORT = cypressConfig.env.PORT
|
||||||
const WORKER_PORT = cypressConfig.env.WORKER_PORT
|
const WORKER_PORT = cypressConfig.env.WORKER_PORT
|
||||||
|
|
||||||
process.env.NODE_ENV = "cypress"
|
if (!process.env.NODE_ENV) {
|
||||||
|
process.env.NODE_ENV = "cypress"
|
||||||
|
}
|
||||||
process.env.ENABLE_ANALYTICS = "0"
|
process.env.ENABLE_ANALYTICS = "0"
|
||||||
process.env.JWT_SECRET = cypressConfig.env.JWT_SECRET
|
process.env.JWT_SECRET = cypressConfig.env.JWT_SECRET
|
||||||
process.env.COUCH_URL = `leveldb://${tmpdir}/.data/`
|
|
||||||
process.env.SELF_HOSTED = 1
|
process.env.SELF_HOSTED = 1
|
||||||
process.env.WORKER_URL = `http://localhost:${WORKER_PORT}/`
|
process.env.WORKER_URL = `http://localhost:${WORKER_PORT}/`
|
||||||
process.env.APPS_URL = `http://localhost:${SERVER_PORT}/`
|
process.env.APPS_URL = `http://localhost:${SERVER_PORT}/`
|
||||||
|
|
|
@ -7,7 +7,7 @@ exports.init = () => {
|
||||||
find: true,
|
find: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env.isTest()) {
|
if (env.isTest() && !env.COUCH_DB_URL) {
|
||||||
dbConfig.inMemory = true
|
dbConfig.inMemory = true
|
||||||
dbConfig.allDbs = true
|
dbConfig.allDbs = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ const env = require("../environment")
|
||||||
|
|
||||||
exports.init = () => {
|
exports.init = () => {
|
||||||
const dbConfig = {}
|
const dbConfig = {}
|
||||||
if (env.isTest()) {
|
if (env.isTest() && !env.COUCH_DB_URL) {
|
||||||
dbConfig.inMemory = true
|
dbConfig.inMemory = true
|
||||||
dbConfig.allDbs = true
|
dbConfig.allDbs = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
BB_ADMIN_USER_EMAIL=qa@budibase.com
|
BB_ADMIN_USER_EMAIL=qa@budibase.com
|
||||||
BB_ADMIN_USER_PASSWORD=budibase
|
BB_ADMIN_USER_PASSWORD=budibase
|
||||||
ENCRYPTED_TEST_PUBLIC_API_KEY=a65722f06bee5caeadc5d7ca2f543a43-d610e627344210c643bb726f
|
ENCRYPTED_TEST_PUBLIC_API_KEY=a65722f06bee5caeadc5d7ca2f543a43-d610e627344210c643bb726f
|
||||||
|
COUCH_DB_URL=http://budibase:budibase@localhost:4567
|
||||||
|
COUCH_DB_USER=budibase
|
||||||
|
COUCH_DB_PASSWORD=budibase
|
|
@ -0,0 +1,12 @@
|
||||||
|
version: "3.8"
|
||||||
|
services:
|
||||||
|
qa-core-couchdb:
|
||||||
|
# platform: linux/amd64
|
||||||
|
container_name: budi-couchdb-qa
|
||||||
|
restart: on-failure
|
||||||
|
image: ibmcom/couchdb3
|
||||||
|
environment:
|
||||||
|
- COUCHDB_PASSWORD=${COUCH_DB_PASSWORD}
|
||||||
|
- COUCHDB_USER=${COUCH_DB_USER}
|
||||||
|
ports:
|
||||||
|
- "4567:5984"
|
|
@ -12,7 +12,9 @@
|
||||||
"test": "jest --runInBand",
|
"test": "jest --runInBand",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:debug": "DEBUG=1 jest",
|
"test:debug": "DEBUG=1 jest",
|
||||||
"api:server:setup": "env-cmd ts-node ../packages/builder/cypress/ts/setup.ts",
|
"docker:up": "docker-compose up -d",
|
||||||
|
"docker:down": "docker-compose down",
|
||||||
|
"api:server:setup": "npm run docker:up && env-cmd ts-node ../packages/builder/cypress/ts/setup.ts",
|
||||||
"api:server:setup:ci": "env-cmd node ../packages/builder/cypress/setup.js",
|
"api:server:setup:ci": "env-cmd node ../packages/builder/cypress/setup.js",
|
||||||
"api:test:ci": "start-server-and-test api:server:setup:ci http://localhost:4100/builder test",
|
"api:test:ci": "start-server-and-test api:server:setup:ci http://localhost:4100/builder test",
|
||||||
"api:test": "start-server-and-test api:server:setup http://localhost:4100/builder test"
|
"api:test": "start-server-and-test api:server:setup http://localhost:4100/builder test"
|
||||||
|
|
|
@ -41,6 +41,7 @@ describe("Public API - /rows endpoints", () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
|
expect(rows.length).toEqual(1)
|
||||||
expect(rows[0]._id).toEqual(config.context._id)
|
expect(rows[0]._id).toEqual(config.context._id)
|
||||||
expect(rows[0].tableId).toEqual(config.context.tableId)
|
expect(rows[0].tableId).toEqual(config.context.tableId)
|
||||||
expect(rows[0].testColumn).toEqual(config.context.testColumn)
|
expect(rows[0].testColumn).toEqual(config.context.testColumn)
|
||||||
|
|
Loading…
Reference in New Issue