Problem

ProductVariationExportTest does not have any @group

When using Commerce as a 3rd-party module for testing Scheduler's integration with this module, the phpunit tests fail with

Drupal\Core\Test\Exception\MissingGroupException: 
Missing @group annotation in Drupal\Tests\commerce_product\Kernel\ProductVariationExportTest
in /builds/project/scheduler/web/core/lib/Drupal/Core/Test/TestDiscovery.php:342

Here is the job log

Solution

Add class comment block and @group to modules/product/tests/src/Kernel/ProductVariationExportTest.php

CommentFileSizeAuthor
#5 Screenshot 2026-11-05 at 13.36.32.png110.84 KBjonathan1055

Issue fork commerce-3635503

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

Some test classes do not have any class docblock at all. This would normally get reported by PHPCS but I see that you have excluded that rule in the project's customs phpcs.xml so that explains why the PHPCS job ends green in your regular pipeline. Removing that exclusion shows that the block is indeed missing in many files.

jonathan1055’s picture

The problem does not happen in 'current' Drupal 11 but it does fail in 'Previous Minor' Drupal 10 as we see in this pipeline

jonathan1055’s picture

StatusFileSize
new110.84 KB

I temporarily added a matrix on @group and this seemed to speed up the pipeline. It also helps to isolate a test failure, if one group failed.
The pipeline is https://git.drupalcode.org/issue/commerce-3635503/-/pipelines/1032406
matrix
Let me know if you think this is useful and I will keep it in the MR

I presume there was a good reason for excluding the phpcs rule, so I will revert that change here.

jsacksick made their first commit to this issue’s fork.

jsacksick’s picture

Status: Active » Needs review

Thanks for the report! !780 mixes several changes together (CI matrix, phpcs, group renames), so I opened a smaller MR with just the fix:

  • Added the missing @group commerce to ProductVariationExportTest.
  • Six tests had only a submodule group (commerce_cart, commerce_order, commerce_price, commerce_store), so --group commerce skipped them. They now use commerce.
  • Removed two @group debug tags left over on test methods.

Commerce uses one commerce group on purpose. The submodules are tested together, --group commerce runs the whole suite, and other contrib modules can include or exclude Commerce with a single name. Per-submodule groups wouldn't really help a CI matrix either: commerce is also the base module's machine name, so that group would still contain everything. In !780, almost all tests ran in the commerce job. I think most of the speedup came from turning off the opt-in jobs and linters.

If there's a way in the GitLab templates to split the suite across parallel jobs without relying on groups, I'd be happy to look at it in a follow-up issue. The Drupal.Commenting.ClassComment.Missing phpcs exclusion is intentional, so let's keep it.

  • jsacksick committed 24aac346 on 3.x
    test: #3635503 Add the missing @group and consistently use the commerce...
jsacksick’s picture

Status: Needs review » Fixed

Marking that one as fixed for now, thanks for reporting the error and working on it.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jonathan1055’s picture

I didn't mean to make work for you :-) I was happy to revert all the other changes, once I got a response as to whether you wanted the matrix or not. Thanks for merging, and for the explanations.

I understand that you do not want a matrix, but just for clarity you said "commerce is also the base module's machine name, so that group would still contain everything". My understanding of how run-tests.sh works is that if you specify a group, like we did in the matrix, then only that @group would be run, so the 'commerce' matrix job would only run the tests with @group commerce and not the others. I have done this in other projects, where the main group is also the module name, and you don't get everything in that main group. But this is all just for background info, given that you don't want to split by @group anyway.

If there's a way in the GitLab templates to split the suite across parallel jobs without relying on groups, I'd be happy to look at it in a follow-up issue.

Yes there is. You can add parallel: N where N is the number of splits you want. The Gitlab Templates PHPunit doc has more details. I'd be happy to work on that if you would like that feature.

jsacksick’s picture

@jonathan1055: I wanted to add another group in addition.
So in other words, keep @commerce and add commerce_cart, commerce_payment etc. Also your MR only changed the group for ~5 payment tests right?

jonathan1055’s picture

Also your MR only changed the group for ~5 payment tests right?

Yes my MR was not a finished thing, I just changed the group for payments so that the failing test could be run in isolation, so as not to waste resources, by temporarily commenting out the others in the matrix. I stopped working on the MR until I got some feedback. I have closed MR780 now.