Skip to content
代码片段 群组 项目
提交 421aa6e8 编辑于 作者: Timotej Ecimovic's avatar Timotej Ecimovic
浏览文件

Automatic test port assignment didn't work out. Explicitely assign ports for each test now.

上级 412536db
No related branches found
No related tags found
无相关合并请求
......@@ -32,7 +32,7 @@ const generationEngine = require('../src-electron/generator/generation-engine.js
const testUtil = require('./test-util.js')
var db
const { port, baseUrl } = testUtil.testServer()
const { port, baseUrl } = testUtil.testServer(__filename)
const timeout = 5000
beforeAll(() => {
......
......@@ -35,7 +35,7 @@ const restApi = require('../src-shared/rest-api.js')
const testUtil = require('./test-util.js')
var db
const { port, baseUrl } = testUtil.testServer()
const { port, baseUrl } = testUtil.testServer(__filename)
var packageId
var sessionId, secondSessionId
var sessionCookie = null
......
......@@ -31,7 +31,7 @@ var db
var axiosInstance = null
beforeAll(() => {
const { port, baseUrl } = testUtil.testServer()
const { port, baseUrl } = testUtil.testServer(__filename)
env.setDevelopmentEnv()
var file = env.sqliteTestFile('server-zcl')
axiosInstance = axios.create({ baseURL: baseUrl })
......
......@@ -16,9 +16,17 @@
*
*/
var testPort = 9073
function testServer() {
function testServer(fileName) {
var testPort
if (fileName.includes('server-bare.test')) {
testPort = 9073
} else if (fileName.includes('server-with-zcl.test')) {
testPort = 9074
} else if (fileName.includes('generation.test')) {
testPort = 9075
} else {
throw `You must manually assign a port for the given test file: ${fileName}`
}
var ret = {
port: testPort,
baseUrl: `http://localhost:${testPort++}`,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册