Problem/Motivation

Speed up testbot and simplify tests by using the testing profile instead of the standard profile.

Steps to reproduce

Proposed resolution

Convert Drupal\node\Tests\NodeAccessBaseTableTest to use the testing profile, not the standard profile.

Remaining tasks

Decide on approach

Review
Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Issue fork drupal-2254189

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

Status: Needs review » Needs work

The last submitted patch, testperf.node-NodeTranslationUITest.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

markdorison’s picture

Version: 8.1.x-dev » 8.3.x-dev
Related issues: +#2254187: Fix test performance of Drupal\node\Tests\NodeAccessBaseTableTest

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

voleger’s picture

Issue tags: +Needs reroll
anya_m’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.44 KB

Rerolled it

Status: Needs review » Needs work

The last submitted patch, 9: 2254189-9.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

anya_m’s picture

StatusFileSize
new1.45 KB
new437 bytes
andypost’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andregp’s picture

Status: Needs work » Needs review
StatusFileSize
new525 bytes

I used the suggestion from this issue's summary to create this patch. (I basically removed the default theme, so this code would use the test's theme).

I also reverted the change on run-tests.sh as those changes would not be committed to core.

andregp’s picture

Status: Needs review » Needs work

The last submitted patch, 20: 2254189-20.patch, failed testing. View results

andregp’s picture

Status: Needs work » Needs review

The fail is possibly unrelated (as it passed before). The bot will retest it.

smustgrave’s picture

StatusFileSize
new585 bytes

Reading the description this appears to be updating the install profile.

#23 appears to be removing the theme.

Status: Needs review » Needs work

The last submitted patch, 24: 2254189-24.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review
StatusFileSize
new1.37 KB
new1.73 KB

Updated test cases since standard isn't being used.

Status: Needs review » Needs work

The last submitted patch, 26: 2254189-26.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review
StatusFileSize
new897 bytes
new1.37 KB

Status: Needs review » Needs work

The last submitted patch, 28: 2254189-28.patch, failed testing. View results

smustgrave’s picture

StatusFileSize
new1.18 KB
new1.45 KB

Can't seem to get around this one issue if anyone could help

There is 1 Add new comment link, /node/1#comment-form, for the en translation of a node on the frontpage. (Found 0.)
Failed asserting that 0 is identical to 1. /var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
 /var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:90
 /var/www/html/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php:383
 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726
smustgrave’s picture

StatusFileSize
new15.7 KB
new19.54 KB

Adding a new test module article_test to avoid using olivero_test for an article content type with all the fields.

I removed some of the cache tags as those modules aren't being tested.so removed them.

Still can't figure out

There is 1 Add new comment link, /node/1#comment-form, for the en translation of a node on the frontpage. (Found 0.)
Failed asserting that 0 is identical to 1. /var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
 /var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php:90
 /var/www/html/web/core/modules/node/tests/src/Functional/NodeTranslationUITest.php:383
 /var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:726
smustgrave’s picture

Status: Needs work » Needs review
StatusFileSize
new1.08 KB
new19.7 KB

Figured it out! Standard was adding some permissions to the authenticated role that was missing.

Status: Needs review » Needs work

The last submitted patch, 32: 2254189-32.patch, failed testing. View results

smustgrave’s picture

Status: Needs work » Needs review
StatusFileSize
new628 bytes
new19.68 KB
smustgrave’s picture

bumping as this will unblock others.

joachim’s picture

> Adding a new test module article_test to avoid using olivero_test for an article content type with all the fields.

That seems like a LOT of code to add for just this test.

AFAICT the article_test module duplicates the article content type that the standard profile installs. Which means that this adds a maintenance burden, as the article_test module will need to be kept in sync with future changes to the profile.

If we're needing to test articles, then why not just test the standard profile?

And if we're needing to test something about having a content type with fields, can we do that more simply?

smustgrave’s picture

The goal is to not use the full standard install.

There are a number of tests that rely on the article content type with those fields. Figured it would be easier to have them in one place vs having to manually create the content type, fields, form display, etc each time.

joachim’s picture

It's a shame we don't yet have profile inheritance :(

What about making a testing profile that's just the article type? There are already profiles called testing_foo in core/profiles.

The advantages would be:

- the files in testing_article would be direct copies of the relevant ones in standard profile. It's therefore easier to keep them in sync
- someone changing the standard profile in future is a bit more likely to notice there is a testing_article profile that they need to update as well, since it's in the same part of the folder structure

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

smustgrave’s picture

Version: 10.0.x-dev » 11.x-dev

catch’s picture

Priority: Normal » Major

Bumping to major - this is one of the slowest Functional tests we have.

Note that #3384936: Use the API to set up languages in tests that are not specifically testing the language form is also open but complementary to this issue.

quietone’s picture

Status: Needs work » Needs review

Trying a new approach here where BrowserTestBase::setup(); is called instead of parent::setUp() in the setUp method.

smustgrave changed the visibility of the branch 2254189-nodeTranslationUiTest to hidden.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

So I tried fixing the merge conflict in 5601 but got 100s of merge conflicts. So I just started a new one with the exact changes from 5601.

Testing locally I see tests still pass so think @quietone's solution works!

smustgrave’s picture

Status: Reviewed & tested by the community » Needs work

Just saw @joachim comment, should investigate.

quietone’s picture

Status: Needs work » Needs review
quietone’s picture

Testing locally without xdebug the test took 3m 33s to run and with this change it was 1m 33s.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Wow I didn't think it would be much of a difference.

But thanks for checking the comment!

quietone’s picture

StatusFileSize
new13.02 KB

I also wanted to see what this would look like without the phstan-ignore line. For now, I'll upload a patch for the work I did. All the tests changed in the patch pass locally. Is it worth doing that to avoid the ignore line?

smustgrave’s picture

Only meant to trigger once but page froze

quietone’s picture

StatusFileSize
new12.17 KB

I fixed the error.

But what do you think of the approach?

quietone’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs review

I made a new branch for the new approach, attempt3.

catch’s picture

That looks like a good approach but a naming nitpick - could we call the new helper doSetUp()? Just because it more closely matches naming patterns with similar methods that are always called from the same method.

smustgrave’s picture

Status: Needs review » Needs work

For the renaming

quietone’s picture

Status: Needs work » Needs review

Re #58: I agree that doSetup is a better name. I have made that change.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

I'd thought I'd have time today to get to it but got sidetracked :(

Rename looks good.

  • catch committed 78fbdef2 on 10.2.x
    Issue #2254189 by smustgrave, quietone, anya_m, andregp, sun, joachim:...

  • catch committed f0d3a7bf on 11.x
    Issue #2254189 by smustgrave, quietone, anya_m, andregp, sun, joachim:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x and cherry-picked to 10.2.x, thanks!

Status: Fixed » Closed (fixed)

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