Automation tests run in GitLab CI environment. We have a regression suite of around 100+ tests. If a test fails due to some intermittent issue, the CI job fails and, since the next stage is dependent on the regression one, the pipeline gets blocked. We retry the job to rerun regression suite expecting this time it will pass, but some other test fails this time. Is there any capability using which on retrying the failed CI job, only the failed tests run (not the whole suite)?
Automation tests run in GitLab CI environment. We have a regression suite of around 100+ tests. If a test fails due to some intermittent issue, the CI job fails and, since the next stage is dependent on the regression one, the pipeline gets blocked. We retry the job to rerun regression suite expecting this time it will pass, but some other test fails this time. Is there any capability using which on retrying the failed CI job, only the failed tests run (not the whole suite)?
You could add
allow_failure: true
on each stage and if one of your test failed, come back check and run them again or even set condition if more than 10 test failed, block the deployment.
Sounds like you could use the retry keyword:
Use retry to configure how many times a job is retried if it fails. If not defined, defaults to 0 and jobs do not retry.
The default is 0 and you can configure your job to either retry once or twice. You can also specify the failure reason or retry only on specific exit codes.