The test filter change introduced in #3248470: Rules Integration tests fail because Typed Data cannot be installed has had a strange effect. Previously the drupalci.yml had

testing:
  run_tests.standard:
    types: 'PHPUnit-Functional'

and now we have

testing:
  run_tests.functional:
    types: 'PHPUnit-Functional'
      testgroups: 'scheduler,scheduler_api'

to filter out the scheduler_rules_intergration tests.

However three tests which are in @group scheduler are no longer being run when there is no good reason why they should be filtered out.

Issue fork scheduler-3251399

Command icon 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:

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes

The tests which are no longer being run are

Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicProductTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicMediaTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerAdminSettingsTest

Previously, with no testgroups filtering, the tests were executed in reverse-alphabetical class name, and these three were the last three to be executed. Now, with the testgroups filter in place, the tests are being executed in forward-alphabetical class name order. I have no idea why the change or order, probably some side-effect of how the test list is selected or reduced.

However, is it a co-incidence that these three tests would now be the first three that should be run? Is it linked to the fact that three test classes are now correctly being filtered out due to not including @group scheduler_rules_integration and somehow another three are being dropped by accident?

jonathan1055’s picture

Status: Active » Needs review

First, to elimintate the change of identifier in the .yml syntax

jonathan1055’s picture

OK, the three tests at the top of the list are still not being run. Now see what happens if I move one of API tests back into the main Scheduler group.

jonathan1055’s picture

So! That's interesting. I moved EventsTest (which was running fine) out of @group scheduler_api into @group scheduler. The test still runs, but now we get one of the lost/discarded tests schedulerBasicProductTest back in the list of tests being run. This was the third test (in forwards-alphabetical order) that was being discarded.

move one test out of api group

The recovered test runs first, then we get the moved test, then the rest of the list in alphatbetical order. The API group has now been shifted to the end of the list. Something funny is going on.

jonathan1055’s picture

See what happens if the order of the two test groups in the list are changed over.

jonathan1055’s picture

StatusFileSize
new574.08 KB

Swapping the order of the two values in testgroups has had an impact. We have got back the two tests at the top of the list which had been lost, but have now not run the two tests in scheduler_api group. It is as if some kind of array counter bug means that the list of tests is not being merged correctly.

api first in list

jonathan1055’s picture

Title: Drupalci.yml filtering for @group scheduler ignores 3 tests in that group » Drupalci.yml filtering for testgroups: 'scheduler,scheduer_api' does not run all the required tests
StatusFileSize
new612.8 KB

Here's the test comparison list that goes with #6

jonathan1055’s picture

Title: Drupalci.yml filtering for testgroups: 'scheduler,scheduer_api' does not run all the required tests » Drupalci.yml filtering for testgroups: 'scheduler,scheduler_api' does not run all the required tests

Now move the EventsTest back into scheduler_api group but keep the order of the two groups in the drupalci.yml parameter the same as in #8 above, i.e. testgroups: 'scheduler_api,scheduler'

jonathan1055’s picture

StatusFileSize
new493.54 KB

Probably as expected, the test that is moved back into scheduler_api is not run.

move events back into api

Looking at the evidence of all the tests above, one theory could be that the number of tests getting run in the group being shown second is reduced by the number being run in the first group.

jonathan1055’s picture

This run has only five tests in the scheduler group as I have moved all the others from that group into a new do_not_run group. All five tests were run and none of the three in scheduler_api were run.

Scheduler.Scheduler

Scheduler.Drupal\Tests\scheduler\Functional\SchedulerAdminSettingsTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicMediaTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicProductTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicTest
Scheduler.Drupal\Tests\scheduler\FunctionalJavascript\SchedulerJavascriptDefaultTimeTest

Now going to move those last two tests into do_not_run

jonathan1055’s picture

There are 3 tests in scheduler group and 3 tests in scheduler_api group but only the three in scheduler get run:

Scheduler.Scheduler

Scheduler.Drupal\Tests\scheduler\Functional\SchedulerAdminSettingsTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicMediaTest
Scheduler.Drupal\Tests\scheduler\Functional\SchedulerBasicProductTest

The next change will be to move one of the running tests from scheduler into do_not_run group

jonathan1055’s picture

StatusFileSize
new161.3 KB

So now that BasicMedia is in the do_not_run group, we have 2 tests defined in scheduler and 3 tests defined in scheduler_api. Dropping one of the running tests has allowed one of the api tests to show up. This is the "third" api test that should be run.

change on test to do_not_run

jonathan1055’s picture

StatusFileSize
new150.44 KB

In the commit above I defined BasicProduct to the do_not_run group. This has allowed another of the already defined scheduler_api tests to be included and run. There is now just one test defined in the scheduler group and this is causing just one test from the scheduler_api group to be ignored.

change basicproduct to not run

jonathan1055’s picture

That's good. When my patch for run-tests.sh is applied we get the expected set of tests being run. In this cut-down example we get the four tests compared to the three in #15 above.

  • jonathan1055 committed 19b4314 on 2.x
    Issue #3251399 by jonathan1055: Patch run-tests.sh so that tests are not...
jonathan1055’s picture

Status: Needs review » Fixed

Commited the change to drupalci.yml which applies the patch to core/scripts/run-tests.sh. This can be removed when #3251817: Make run-tests.sh select all the required tests when testgroups: has more than one value is committed.

Also moved the javascript test from @group scheduler into @group scheduler_js

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jonathan1055’s picture

StatusFileSize
new1.13 KB

Don't want to re-open this issue, and cannot run patch tests when it is Closed.
See #3049585-7: Check drupal.org testing infrastructure for the test.