Skip to content

Commit b1f0f96

Browse files
author
Miki
committed
Default to openSearchUrl when ENGINE and SECONDARY_ENGINE are missing a url
Signed-off-by: Miki <[email protected]>
1 parent b65017b commit b1f0f96

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cypress.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ module.exports = defineConfig({
1717
env: {
1818
ENGINE: {
1919
name: 'default',
20-
url: 'http://localhost:9200',
20+
url: undefined,
2121
},
2222
SECONDARY_ENGINE: {
2323
name: 'test_cluster',
24-
url: 'http://localhost:9200',
24+
url: undefined,
2525
},
2626
S3_ENGINE: {
2727
name: 'BasicS3Connection',

cypress/utils/constants.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@
55

66
export * from './apps/constants';
77

8+
// ToDo: `BASE_PATH` need not and should not be used by any test; remove it!
89
export const BASE_PATH = Cypress.config('baseUrl');
10+
911
export const BASE_ENGINE = Cypress.env('ENGINE');
12+
// If SECONDARY_ENGINE.url is not provided, use the OpenSearch instance
13+
BASE_ENGINE.url = BASE_ENGINE.url || Cypress.env('openSearchUrl');
14+
1015
export const SECONDARY_ENGINE = Cypress.env('SECONDARY_ENGINE');
16+
// If SECONDARY_ENGINE.url is not provided, use the OpenSearch instance
17+
SECONDARY_ENGINE.url = SECONDARY_ENGINE.url || Cypress.env('openSearchUrl');
1118

1219
export const PATHS = {
1320
BASE: BASE_PATH,

0 commit comments

Comments
 (0)