mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #20686 from overleaf/jpa-faster-e2e
[server-pro] tests: faster reconfiguring GitOrigin-RevId: 8e9254f5a9e30f7a815eb25a6f226095b7e16c29
This commit is contained in:
parent
2b72d89171
commit
ecfc8a1f9a
1 changed files with 11 additions and 11 deletions
|
@ -253,9 +253,10 @@ app.post(
|
||||||
function maybeResetData(resetData, callback) {
|
function maybeResetData(resetData, callback) {
|
||||||
if (!resetData) return callback()
|
if (!resetData) return callback()
|
||||||
|
|
||||||
|
previousConfig = ''
|
||||||
runDockerCompose(
|
runDockerCompose(
|
||||||
'stop',
|
'down',
|
||||||
['--timeout=0', 'sharelatex'],
|
['--timeout=0', '--volumes', 'mongo', 'redis', 'sharelatex'],
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
if (error) return callback(error, stdout, stderr)
|
if (error) return callback(error, stdout, stderr)
|
||||||
|
|
||||||
|
@ -264,13 +265,7 @@ function maybeResetData(resetData, callback) {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return callback(error)
|
return callback(error)
|
||||||
}
|
}
|
||||||
|
callback()
|
||||||
previousConfig = ''
|
|
||||||
runDockerCompose(
|
|
||||||
'down',
|
|
||||||
['--timeout=0', '--volumes', 'mongo', 'redis'],
|
|
||||||
callback
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -294,6 +289,12 @@ app.post(
|
||||||
maybeResetData(resetData, (error, stdout, stderr) => {
|
maybeResetData(resetData, (error, stdout, stderr) => {
|
||||||
if (error) return res.json({ error, stdout, stderr })
|
if (error) return res.json({ error, stdout, stderr })
|
||||||
|
|
||||||
|
const previousConfigServer = previousConfig
|
||||||
|
const newConfig = JSON.stringify(req.body)
|
||||||
|
if (previousConfig === newConfig) {
|
||||||
|
return res.json({ previousConfigServer })
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setVarsDockerCompose({ pro, version, vars, withDataDir })
|
setVarsDockerCompose({ pro, version, vars, withDataDir })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -305,8 +306,7 @@ app.post(
|
||||||
'up',
|
'up',
|
||||||
['--detach', '--wait', 'sharelatex'],
|
['--detach', '--wait', 'sharelatex'],
|
||||||
(error, stdout, stderr) => {
|
(error, stdout, stderr) => {
|
||||||
const previousConfigServer = previousConfig
|
previousConfig = newConfig
|
||||||
previousConfig = JSON.stringify(req.body)
|
|
||||||
res.json({ error, stdout, stderr, previousConfigServer })
|
res.json({ error, stdout, stderr, previousConfigServer })
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue