Problem/Motivation

This code in WorkAllocator

  private function getTestTypeWeight(string $class): int {
    assert(class_exists($class), "$class does not exist");
    return match(TRUE) {
      is_subclass_of($class, WebDriverTestBase::class) => 3,
      is_subclass_of($class, BrowserTestBase::class) => 2,
      is_subclass_of($class, BuildTestBase::class) => 2,
      is_subclass_of($class, KernelTestBase::class) => 1,
      default => 0,
    };
  }

makes it hard to unit test it with fixtures, because fixture is dependent on the existence of the test class.

Proposed resolution

Rely on the determination done in PhpUnitTestDiscovery instead of checking existence and inheritance in WorkAllocator.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3588584

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

mondrake created an issue. See original summary.

mondrake’s picture

Issue summary: View changes

mondrake’s picture

Status: Active » Needs review
mondrake’s picture

Issue tags: +Major version only

D12 eligible only, as the MR uses the native PHPUnit testsuite names, that are not supported in 11.x

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Going off the eye test here as wasn't sure how to test, but the change to getTestTypeWeight makes sense and tests appear to run. Going to mark but if more I should test let me know.

Since this is major only maybe we try it out on main for a bit?

  • catch committed 7f1b588a on 11.x
    task: #3588584 run-tests.sh - move suite determination from...

  • catch committed c6cf9c29 on main
    task: #3588584 run-tests.sh - move suite determination from...
catch’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to main and 11.x, thanks!

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.

mondrake’s picture

Status: Fixed » Reviewed & tested by the community
Related issues: +#3581399: Stop using legacy names for test suites

imo the 11.x commit should be reverted - this issue is built over #3581399: Stop using legacy names for test suites that was only committed to main.

edit - alternatively the related could be backported (maybe, haven’t checked)

  • catch committed c433a1d0 on 11.x
    Revert "task: #3588584 run-tests.sh - move suite determination from...
catch’s picture

Version: 11.x-dev » main
Status: Reviewed & tested by the community » Fixed

Reverted the 11.x commit, let's leave this fixed on main for now.

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.

Status: Fixed » Closed (fixed)

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