mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-22 21:33:44 +00: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) {
|
||||
if (!resetData) return callback()
|
||||
|
||||
previousConfig = ''
|
||||
runDockerCompose(
|
||||
'stop',
|
||||
['--timeout=0', 'sharelatex'],
|
||||
'down',
|
||||
['--timeout=0', '--volumes', 'mongo', 'redis', 'sharelatex'],
|
||||
(error, stdout, stderr) => {
|
||||
if (error) return callback(error, stdout, stderr)
|
||||
|
||||
|
@ -264,13 +265,7 @@ function maybeResetData(resetData, callback) {
|
|||
} catch (error) {
|
||||
return callback(error)
|
||||
}
|
||||
|
||||
previousConfig = ''
|
||||
runDockerCompose(
|
||||
'down',
|
||||
['--timeout=0', '--volumes', 'mongo', 'redis'],
|
||||
callback
|
||||
)
|
||||
callback()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -294,6 +289,12 @@ app.post(
|
|||
maybeResetData(resetData, (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 {
|
||||
setVarsDockerCompose({ pro, version, vars, withDataDir })
|
||||
} catch (error) {
|
||||
|
@ -305,8 +306,7 @@ app.post(
|
|||
'up',
|
||||
['--detach', '--wait', 'sharelatex'],
|
||||
(error, stdout, stderr) => {
|
||||
const previousConfigServer = previousConfig
|
||||
previousConfig = JSON.stringify(req.body)
|
||||
previousConfig = newConfig
|
||||
res.json({ error, stdout, stderr, previousConfigServer })
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue