@centreon/js-config 24.10.18 → 24.10.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/e2e/commands.ts +6 -0
- package/cypress/e2e/tasks.ts +19 -7
- package/package.json +1 -1
package/cypress/e2e/commands.ts
CHANGED
|
@@ -450,6 +450,8 @@ Cypress.Commands.add(
|
|
|
450
450
|
interface StartContainersProps {
|
|
451
451
|
composeFile?: string;
|
|
452
452
|
databaseImage?: string;
|
|
453
|
+
dbConfiguration?: string;
|
|
454
|
+
dbStorage?: string;
|
|
453
455
|
moduleName?: string;
|
|
454
456
|
openidImage?: string;
|
|
455
457
|
profiles?: Array<string>;
|
|
@@ -464,6 +466,8 @@ Cypress.Commands.add(
|
|
|
464
466
|
({
|
|
465
467
|
composeFile,
|
|
466
468
|
databaseImage = Cypress.env('DATABASE_IMAGE'),
|
|
469
|
+
dbConfiguration = Cypress.env('MYSQL_DB_CONFIGURATION'),
|
|
470
|
+
dbStorage = Cypress.env('MYSQL_DB_STORAGE'),
|
|
467
471
|
moduleName = 'centreon-web',
|
|
468
472
|
openidImage = `ghcr.io/centreon/centreon/keycloak:${Cypress.env(
|
|
469
473
|
'OPENID_IMAGE_VERSION'
|
|
@@ -494,6 +498,8 @@ Cypress.Commands.add(
|
|
|
494
498
|
{
|
|
495
499
|
composeFile: composeFilePath,
|
|
496
500
|
databaseImage,
|
|
501
|
+
dbConfiguration,
|
|
502
|
+
dbStorage,
|
|
497
503
|
openidImage,
|
|
498
504
|
profiles,
|
|
499
505
|
samlImage,
|
package/cypress/e2e/tasks.ts
CHANGED
|
@@ -188,7 +188,9 @@ export default (on: Cypress.PluginEvents): void => {
|
|
|
188
188
|
name,
|
|
189
189
|
portBindings = []
|
|
190
190
|
}: StartContainerProps) => {
|
|
191
|
-
let container = await new GenericContainer(image)
|
|
191
|
+
let container = await new GenericContainer(image)
|
|
192
|
+
.withName(name)
|
|
193
|
+
.withAddedCapabilities('SYS_NICE');
|
|
192
194
|
|
|
193
195
|
portBindings.forEach(({ source, destination }) => {
|
|
194
196
|
container = container.withExposedPorts({
|
|
@@ -210,6 +212,8 @@ export default (on: Cypress.PluginEvents): void => {
|
|
|
210
212
|
startContainers: async ({
|
|
211
213
|
composeFile,
|
|
212
214
|
databaseImage,
|
|
215
|
+
dbConfiguration,
|
|
216
|
+
dbStorage,
|
|
213
217
|
openidImage,
|
|
214
218
|
profiles,
|
|
215
219
|
samlImage,
|
|
@@ -219,16 +223,24 @@ export default (on: Cypress.PluginEvents): void => {
|
|
|
219
223
|
const composeFileDir = path.dirname(composeFile);
|
|
220
224
|
const composeFileName = path.basename(composeFile);
|
|
221
225
|
|
|
226
|
+
const environment: Record<string, string> = {
|
|
227
|
+
MYSQL_IMAGE: databaseImage,
|
|
228
|
+
OPENID_IMAGE: openidImage,
|
|
229
|
+
SAML_IMAGE: samlImage,
|
|
230
|
+
WEB_IMAGE: webImage,
|
|
231
|
+
};
|
|
232
|
+
if (dbConfiguration) {
|
|
233
|
+
environment.MYSQL_DB_CONFIGURATION = dbConfiguration;
|
|
234
|
+
}
|
|
235
|
+
if (dbStorage) {
|
|
236
|
+
environment.MYSQL_DB_STORAGE = dbStorage;
|
|
237
|
+
}
|
|
238
|
+
|
|
222
239
|
dockerEnvironment = await new DockerComposeEnvironment(
|
|
223
240
|
composeFileDir,
|
|
224
241
|
composeFileName
|
|
225
242
|
)
|
|
226
|
-
.withEnvironment(
|
|
227
|
-
MYSQL_IMAGE: databaseImage,
|
|
228
|
-
OPENID_IMAGE: openidImage,
|
|
229
|
-
SAML_IMAGE: samlImage,
|
|
230
|
-
WEB_IMAGE: webImage
|
|
231
|
-
})
|
|
243
|
+
.withEnvironment(environment)
|
|
232
244
|
.withProfiles(...profiles)
|
|
233
245
|
.withStartupTimeout(120000)
|
|
234
246
|
.withWaitStrategy(
|
package/package.json
CHANGED