I would like to set up tests that will fire on the gitlab pipline. I would like to split the tests in cypress so that smoke fires once a day and all tests once a week. I have configured pipeline schedules in gitlab by specifying a variable for daily and weekly.
The problem is that now the pipeline does not start (all the time: Checking pipeline status).
Are the rules defined correctly?
---
#--------#
# STAGES #
#--------#
stages:
- test
#------#
# JOBS #
#------#
cypress:test:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.184-1-ff-123.0-edge-121.0.2277.128-1
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_SCHED_FREQ == "weekly"'
when: always
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
parallel: 2
cache:
key: ${CI_COMMIT_BRANCH}
paths:
- node_modules/
- /root/.cache/Cypress
script:
- yarn install
- yarn add mocha
- yarn test
artifacts:
when: always
paths:
- cypress/reports/
expire_in: 1 week
cypress:test:smoke:
image: cypress/browsers:node-20.11.0-chrome-121.0.6167.184-1-ff-123.0-edge-121.0.2277.128-1
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_BRANCH == "main"'
when: always
- if: '$CI_PIPELINE_SOURCE == "schedule" && $CI_SCHED_FREQ == "daily"'
when: always
cache:
key: ${CI_COMMIT_BRANCH}
paths:
- node_modules/
- /root/.cache/Cypress
script:
- yarn install
- yarn add mocha
- yarn test:smoke
artifacts:
when: always
paths:
- cypress/reports/
expire_in: 1 week
I have tried different rules configurations but it did not help.
Barsta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1