Users should be able to update the Test-only changes file pattern
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3539542. -->
Reported by: [codebymikey](https://www.drupal.org/user/3573206)
Related to !396 !388
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The test-only script has a <a href="https://git.drupalcode.org/project/gitlab_templates/-/blob/977e5d1b/scripts/test-only.sh#L17">hard-coded pattern of file paths</a> that it allows to be exempt from reverts.</p>
<div class="codeblock">
<pre><span style="color: #000000"><span style="color: #0000BB"><?php<br>PATTERN</span><span style="color: #007700">=</span><span style="color: #DD0000">'(tests/|composer\.json|\.info\.yml|phpunit\.xml|\.gitlab-ci\.yml)'<br></span><span style="color: #0000BB">?></span></span></pre></div>
<p>However there are some specific cases where a particular change requires a specific file to not be reverted in order to test the behaviour properly, so should be supported.</p>
<p>e.g. <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-8"><a href="https://www.drupal.org/project/stage_file_proxy/issues/3521812" title="Status: Needs review">#3521812: Take non-Clean URL requests into account</a></span></p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Introduce a new optional <code>_TEST_ONLY_FILE_PATTERN</code> variable that adds additional file patterns to the existing pattern list.</p>
<p>It's now also possible to trigger test-only changes jobs without needing to create a MR - this is useful if you need to test a feature branch without creating a MR before it's ready.</p>
<p>It works through a new optional <code>_TEST_ONLY_TARGET_BRANCH</code> variable that it compares against to determine if there are tests to run.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>N/A</p>
> Related issue: [Issue #3521812](https://www.drupal.org/node/3521812)
issue