Problem/Motivation
It's currently not possible to run the Repeat Class Test job for WebDriver tests without attaching the selenium chrome service like:
services:
- <<: *with-database
- <<: *with-selenium-chrome
It would also be good to be able to control the number of repeats, currently this is hardcoded to 100.
Steps to reproduce
Try to run the repeat class test pipeline against a FunctionalJavascript test
Proposed resolution
Add the service by default.
Issue fork drupal-3519177
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3519177-attach-selenium-service
changes, plain diff MR !11826
Comments
Comment #3
acbramley commentedComment #4
mstrelan commentedYes please. While we're at it, can we add a var for number of repeats? It's currently hardcoded at
--repeat "100". Would be good if we could set this var via the UI likeREPEAT_TEST_CLASS.We can do a separate issue for that, or we can re-title / re-purpose this issue to include this.
Comment #5
catchYes! Kept meaning to open an issue for this and hadn't done it yet, and agreed a variable for number of tests would be good - both for really long running tests that can time out with 100 runs, and also when you need 500, I think it's fine either here or split out.
Comment #6
acbramley commentedYou can do it via the UI? 😲
Happy to add the variable here given this is such a small change.
Comment #7
catchOnce you have a pipeline running, you can manually run the job, and gitlab allows you to set environment variables there - this currently supports only the class name, but if we do the same for the number of runs, then it'll just be setting two variables - would be nice to keep it defaulting to 100 though I think so it's not required.
Comment #8
mstrelan commentedFor example, go to https://git.drupalcode.org/issue/drupal-3519177/-/pipelines/473447, click on Repeat Test Class then enter the variables.
Comment #9
acbramley commentedJust found the help text in the job about how to set the variables in the UI. That's awesome.
Added REPEAT_COUNT
Comment #10
acbramley commentedTested with both variables here https://git.drupalcode.org/issue/drupal-3519177/-/jobs/4965595
Comment #11
mstrelan commentedComment #12
catchThis is great, let's do it. Normally I'd leave an issue open a bit longer, but it's only changing a manually triggered test job, so quicker to commit than leave this then come back to it a day later.
Comment #16
xjmSorry for issue necromancy but it would be nice for more people to know about this. :)
Comment #17
mstrelan commentedCan you be more specific about which documentation to update? There is https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-dr... and https://www.drupal.org/about/core/policies/core-change-policies/how-to-d... but neither of these mention REPEAT_TEST_CLASS. Since this issue is about a minor enhancement to #3393475: Enable running the same test multiple times on gitlab ci for random test failures I suspect that is the issue that should have added documentation. Probably better to raise a new issue for it at this point.