We have a gitlab CI pipeline for building&testing our product. Our product can be, fairly clearly, divided into two distinct parts - let's say we call them A and B. The most time-consuming part of our pipeline are end-to-end (e2e) tests that take > 40 minutes to execute, and we want to cut this time down. They are currently executed in 1 job.
Because our product consists of A and B, for each merge request we want to run only a subset of our e2e tests (only tests for A or only tests for B or all) - we want to be able to specify this manually for each merge request.
We were looking for some idiomatic way to do this in GitLab CI, but didn't find one. What is the cleanest, least obtrusive way to achieve this? We ofc also want to be able to run all e2e tests - this would be the case of master branch.
Our ideas included encoding this information in commit messages or merge request title and extracting this from env variables - https://docs.gitlab.com/ee/ci/variables/predefined_variables.html but both seem like a hack.
Thank you :)