mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
feat(core): separate runtimeConfig for e2e tests and deployment (#5976)
Prior to modification, it will function for both `deploy` and `e2e-test`. Consequently, `allowLocalWorkspace` is also set to `true` in the production environment. https://github.com/toeverything/AFFiNE/actions/runs/8093473180/job/22116199541#step:5:120
This commit is contained in:
@@ -147,6 +147,10 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
||||
: currentBuildPreset.allowLocalWorkspace,
|
||||
};
|
||||
|
||||
const testEnvironmentPreset = {
|
||||
allowLocalWorkspace: true,
|
||||
};
|
||||
|
||||
if (buildFlags.mode === 'development') {
|
||||
currentBuildPreset.serverUrlPrefix = 'http://localhost:8080';
|
||||
}
|
||||
@@ -156,6 +160,10 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
|
||||
// environment preset will overwrite current build preset
|
||||
// this environment variable is for debug proposes only
|
||||
// do not put them into CI
|
||||
...(process.env.CI ? { allowLocalWorkspace: true } : environmentPreset),
|
||||
...(process.env.CI ? {} : environmentPreset),
|
||||
|
||||
// test environment preset will overwrite current build preset
|
||||
// this environment variable is for github workflow e2e-test only
|
||||
...(process.env.IN_CI_TEST ? testEnvironmentPreset : {}),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user