mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-23 14:00:08 +02:00

* [web] prepare filestore migration for Server Pro/CE * [history-v1] remove unused USER_FILES_BUCKET_NAME env var from script * [server-ce] tests: write default docker-compose.override.yml on startup * [server-ce] tests: extend access logging of host-admin for response * [server-ce] tests: test text and binary file upload * [server-ce] tests: add tests for filestore migration * [web] simplify feature gate for filestore/project-history-blobs logic Co-authored-by: Brian Gough <brian.gough@overleaf.com> * [server-ce] test: fix flaky test helper --------- Co-authored-by: Brian Gough <brian.gough@overleaf.com> GitOrigin-RevId: f89bdab2749e2b7a49d609e2eac6bf621c727966
65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
import { reconfigure } from './hostAdminClient'
|
|
import { resetActivateUserRateLimit, resetCreatedUsersCache } from './login'
|
|
|
|
export const STARTUP_TIMEOUT =
|
|
parseInt(Cypress.env('STARTUP_TIMEOUT'), 10) || 120_000
|
|
|
|
export function isExcludedBySharding(
|
|
shard:
|
|
| 'CE_DEFAULT'
|
|
| 'CE_CUSTOM_1'
|
|
| 'CE_CUSTOM_2'
|
|
| 'CE_CUSTOM_3'
|
|
| 'PRO_DEFAULT_1'
|
|
| 'PRO_DEFAULT_2'
|
|
| 'PRO_CUSTOM_1'
|
|
| 'PRO_CUSTOM_2'
|
|
| 'PRO_CUSTOM_3'
|
|
) {
|
|
const SHARD = Cypress.env('SHARD')
|
|
return SHARD && shard !== SHARD
|
|
}
|
|
|
|
let previousConfigFrontend: string
|
|
|
|
export function startWith({
|
|
pro = false,
|
|
version = 'latest',
|
|
vars = {},
|
|
varsFn = () => ({}),
|
|
withDataDir = false,
|
|
resetData = false,
|
|
}) {
|
|
before(async function () {
|
|
Object.assign(vars, varsFn())
|
|
const cfg = JSON.stringify({
|
|
pro,
|
|
version,
|
|
vars,
|
|
withDataDir,
|
|
resetData,
|
|
})
|
|
if (resetData) {
|
|
resetCreatedUsersCache()
|
|
resetActivateUserRateLimit()
|
|
// no return here, always reconfigure when resetting data
|
|
} else if (previousConfigFrontend === cfg) {
|
|
return
|
|
}
|
|
|
|
this.timeout(STARTUP_TIMEOUT)
|
|
const { previousConfigServer } = await reconfigure({
|
|
pro,
|
|
version,
|
|
vars,
|
|
withDataDir,
|
|
resetData,
|
|
})
|
|
if (previousConfigServer !== cfg) {
|
|
await Cypress.session.clearAllSavedSessions()
|
|
}
|
|
previousConfigFrontend = cfg
|
|
})
|
|
}
|
|
|
|
export { reconfigure }
|