Open dmlemeshko opened 6 months ago
Okay here is the gist of the issue
Look at this test which clearly explains the process - https://github.com/vigneshshanmugam/synthetics/blob/8fd2b339f4961f1b4f8e78d76f7704975455047a/__tests__/core/runner.test.ts#L846
We could fix this by appending the monitor.use tags during push instead of replacing them.
The goal is to define a single journey file and run it on different serverless test envs (qa, staging, prod). Since some journeys maybe qa-only, I rely on tagging mechanism to run/push only required journeys.
Journey example:
synthetics.config.ts
```ts import type { SyntheticsConfig } from '@elastic/synthetics'; export default (env) => { const configQA: SyntheticsConfig = { params: { base_url: process.env.BASE_URL, es_username: process.env.ES_USERNAME, es_password: process.env.ES_PASSWORD, }, playwrightOptions: { ignoreHTTPSErrors: false, testIdAttribute: 'data-test-subj', timezoneId: 'UTC', locale: 'en-US', }, /** * Configure global monitor settings */ monitor: { // @ts-ignore locations: ['us_central_qa'], privateLocations: [], schedule: 60, }, /** * Project monitors settings */ project: { id: 'serverless-qa', url:run command works as expected:
TEST_ENV=prod npx @elastic/synthetics journeys --tags=prod
push command completely ignores journey tags:
It only works if I add 'prod' tag in config-level, but this way tags in Synthetics UI will look confusing:
'appex', 'serverless', 'qa', 'prod'
;I believe that ideally tagging mechanism should be identical for both commands, could be possible to use Journey context while filtering monitors for push?