See #2862508: Convert system functional tests to phpunit
See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)

Scope:
Everything in /core/modules/system/src/Tests/Install

Things taken into account:

  • All tests were moved to /core/tests/Drupal/FunctionalTests/Installer where the BrowserTestBase version of InstallerTestBase already lives
  • All setUp() logic was moved to prepareEnvironment() to take into account the order in which the file system is set up in BrowserTestBase
CommentFileSizeAuthor
#88 interdiff-78-87.txt1.08 KBAnonymous (not verified)
#87 2907728-87.patch58.55 KBLendude
#78 2907728-78.patch59.62 KBLendude
#78 interdiff-2907728-74-78.txt3.83 KBLendude
#74 interdiff-71-74.txt3.81 KBAnonymous (not verified)
#74 2907728-74.patch60.48 KBAnonymous (not verified)
#73 interdiff-InstallerTestBase.txt6.35 KBAnonymous (not verified)
#71 2907728-71.patch58.97 KBLendude
#71 interdiff-290772865-71.txt728 bytesLendude
#65 2907728-65.patch58.99 KBLendude
#65 interdiff-2907728-62-65.txt5.03 KBLendude
#62 2907728-62.patch55.99 KBLendude
#62 interdiff-2907728-60-62.txt4.28 KBLendude
#60 2907728-60.patch55.69 KBLendude
#60 interdiff-2907728-58-60.txt1.35 KBLendude
#58 2907728-58.patch55.88 KBLendude
#56 2907728-56.patch55.73 KBLendude
#56 interdiff-2907728-53-56.txt2.68 KBLendude
#53 interdiff-50-53.txt3.51 KBAnonymous (not verified)
#53 2907728-53.patch54.65 KBAnonymous (not verified)
#52 DistributionProfileExistingSettingsTest-setUpSite-page-log.patch52.85 KBAnonymous (not verified)
#50 2907728-50.patch52.11 KBLendude
#48 2907728-48.patch52.16 KBLendude
#48 interdiff-2907728-45-48.txt2.32 KBLendude
#45 2907728-45.patch53.17 KBLendude
#45 interdiff-2907728-42-45.txt3.5 KBLendude
#42 2907728-42.patch52.27 KBLendude
#42 interdiff-2907728-41-42.txt819 bytesLendude
#41 2907728-41.patch52.21 KBLendude
#41 interdiff-2907728-24-41.txt2.9 KBLendude
#37 interdiff-28-37.txt2 KBAnonymous (not verified)
#37 2907728-37-last_write_timestamp_cache_config.patch52.02 KBAnonymous (not verified)
#31 interdiff-29-31.txt2.58 KBAnonymous (not verified)
#31 2907728-31.patch51.35 KBAnonymous (not verified)
#29 interdiff-24-28.txt853 bytesAnonymous (not verified)
#29 2907728-28.patch50.02 KBAnonymous (not verified)
#26 interdiff-24-26.txt1.93 KBAnonymous (not verified)
#26 2907728-26.patch51.32 KBAnonymous (not verified)
#26 2907728-26-test-only.patch50.62 KBAnonymous (not verified)
#24 interdiff-19-24.txt3.6 KBAnonymous (not verified)
#24 2907728-24.patch49.99 KBAnonymous (not verified)
#22 2907728-22.patch51.26 KBLendude
#22 interdiff-2907728-19-22.txt670 bytesLendude
#19 2907728-19.patch51.51 KBLendude
#19 interdiff-2907728-17-19.txt800 bytesLendude
#17 2907728-17.patch51.72 KBLendude
#17 interdiff-2907728-15-17.txt908 bytesLendude
#15 2907728-15.patch51.08 KBLendude
#15 interdiff-2907728-12-15.txt988 bytesLendude
#12 2907728-12.patch50.73 KBLendude
#12 interdiff-2907728-10-12.txt6.24 KBLendude
#10 2907728-10.patch47.18 KBLendude
#10 interdiff-2907728-6-10.txt6.65 KBLendude
#7 2907728-6.patch44.07 KBAnonymous (not verified)
#4 interdiff-3-4.txt12.65 KBAnonymous (not verified)
#4 2907728-4.patch44.34 KBAnonymous (not verified)
#3 2907728-3.patch37.01 KBdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lendude created an issue. See original summary.

dawehner’s picture

Assigned: Unassigned » dawehner

Let's see where I get to

dawehner’s picture

Assigned: dawehner » Unassigned
FileSize
37.01 KB

Current progress ...

Anonymous’s picture

Status: Active » Needs review
FileSize
44.34 KB
12.65 KB

I'm not sure, that my patch contains improvements (it's hard enough for me). So, you can ignore this patch. It seems that the install page hasn't 'profile' tab (task). As result, drupalPostForm not works (without related 'profile' field).

Anonymous’s picture

Also ConfigTranslationInstallTest already works with patch #3. Cool!

Status: Needs review » Needs work

The last submitted patch, 4: 2907728-4.patch, failed testing. View results

Anonymous’s picture

Status: Needs work » Needs review
FileSize
44.07 KB

Nit reroll.

Status: Needs review » Needs work

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

Lendude’s picture

Assigned: Unassigned » Lendude

working on cleaning up some of these fails

Lendude’s picture

Assigned: Lendude » Unassigned
Status: Needs work » Needs review
FileSize
6.65 KB
47.18 KB

This should clear up some of the fails, just moving stuff from setup() to prepareEnvironment()

Status: Needs review » Needs work

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

Lendude’s picture

Status: Needs work » Needs review
FileSize
6.24 KB
50.73 KB

This comes back green for everything locally, lets see what happens here.

Status: Needs review » Needs work

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

Anonymous’s picture

#10, #12: Steep fixes!


#13: I cann't reproduce these fails too.
Lendude’s picture

Status: Needs work » Needs review
FileSize
988 bytes
51.08 KB

Yeah these are green for me locally too, stab in the dark attempt at a fix....

Status: Needs review » Needs work

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

Lendude’s picture

Status: Needs work » Needs review
FileSize
908 bytes
51.72 KB

Lendude's proficiency in Blind fighting has gone up a level (2)

Ok that seems to do the trick, now the other one...

Status: Needs review » Needs work

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

Lendude’s picture

Status: Needs work » Needs review
FileSize
800 bytes
51.51 KB

Ok so fixing the second one, re-breaks the other one....

lets simplify InstallerExistingSettingsNoProfileTest, locally it works fine without the whole $request = Request::createFromGlobals(); bit

Status: Needs review » Needs work

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

Lendude’s picture

Ahhh crap, it's random fails :(

#19 had 3 failing tests the first time, 0 fails on retest. That's not good.

Edit: On the plus side: it's green! So that's nice :)

Lendude’s picture

Lets get rid of this __construct(), passes locally without it and I can imagine that could lead to weird results.

Status: Needs review » Needs work

The last submitted patch, 22: 2907728-22.patch, failed testing. View results

Anonymous’s picture

Status: Needs work » Needs review
FileSize
49.99 KB
3.6 KB

#17: xD
#19: First green! 🎉
#22: Yep, in #4 I added a lot of garbage :(

Revert __construct(), ad the attempt to clean anything else.

Status: Needs review » Needs work

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

Anonymous’s picture

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

Status: Needs review » Needs work

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

Anonymous’s picture

Random fail: miss
PHP versions: hit

Status: Needs review » Needs work

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

Status: Needs review » Needs work

The last submitted patch, 31: 2907728-31.patch, failed testing. View results

Anonymous’s picture

#31 bad patch, sorry. Continue search in #2920081: Ignore: patch testing issue . Current results:

dawehner’s picture

@vaplas
That sounds like the user is not logged in after the installation.

Anonymous’s picture

@dawehner, thanks for hint! Perhaps it is true. But not only logged is problem here. Because we would get an "Access denied" instead of "Page not found". In any case, I'm starting to hunt for the account instance in the ignore-issue :) I hope to catch something else 🎣

dawehner’s picture

Keep up the great work!

Anonymous’s picture

Status: Needs work » Needs review
FileSize
52.02 KB
2 KB

Thank you!

It seems the stability is violated by cache bin 'config' last_write_timestamp_cache_config record. Unfortunately, I do not know how to take advantage of this yet.. So, while just delete it.

Anonymous’s picture

Comparing last_write_timestamp_cache_config values:

d:1509618497.0820000171661376953125; # fail
d:1509618497.131000041961669921875; # fail
d:1509618497.0820000171661376953125; # fail
d:1509618497.0820000171661376953125; # fail
d:1509618497.131999969482421875; # pass

Nanoseconds round problem?

Anonymous’s picture

dawehner’s picture

I tried to compare what is different to this patch from before, they are reallly similar at this point!

+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
@@ -0,0 +1,280 @@
+    // Setup Mink.
+    $this->initMink();

One part of the initMink call is

    $session = $this->getSession();
    $session->visit($this->baseUrl);

, so I'm wondering whether skipping this here makes any difference. I think it is worth giving it a try

Lendude’s picture

Lendude’s picture

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

Anonymous’s picture

#40: Brilliant point!
#41: For some reason, I was not smart enough to understand how to implement it.
#42: Both green!


#43: I wanted to check that without this correction tests are still falling.
Lendude’s picture

dawehner’s picture

@lendude++ I'm glad you actually tried it out :)

+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
@@ -205,37 +205,9 @@
+  protected function initFrontPage() {
+    // We don't want to visit the front page with the installer when
+    // initializing Mink, so we do nothing here.
   }

👍 Nice method name and excellent documentation.

#43: I wanted to check that without this correction tests are still falling.

Did you tried that already out in a test only issue?
@vaplas I would rely on you on

  1. +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
    @@ -43,31 +43,28 @@ protected function setUp() {
    -    $path = $this->siteDirectory . '/profiles/mydistro';
    +    $path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/mydistro';
    ...
    +    // Place a custom local translation in the translations directory.
    +    mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    

    Note: One is using \Drupal::root() and one $this->root, but mostly i'm wondering whether why we cannot keep the code in visitInstaller

  2. +++ b/core/tests/Drupal/Tests/Core/Test/SkippedDeprecationsInheritanceTest.php
    @@ -0,0 +1,25 @@
    +class SkippedDeprecationsInheritanceTest extends UnitTestCase {
    

    Does this belong in this patch?

Anonymous’s picture

Did you tried that already out in a test only issue?

Yep. I restarted the #29, after I saw the green DistributionProfileExistingSettingsTest in #41. And this restart ended in failure.

Not that I doubted your great proposal, just for an additional check ) 🙏

Lendude’s picture

Bit of a clean up.

#46.1 I moved everything that used to be in setup() to prepareEnvironment() in all tests. I'm sure there are some other places we could put that code in certain tests but this keeps it a little sane for reviewing purposes.
#46.2 oops! mixin up patches, took it out.

dawehner’s picture

  1. +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
    @@ -43,22 +43,19 @@ protected function setUp() {
    +    $path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/mydistro';
    ...
    +    mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.fr.po', $this->getPo('fr'));
    

    I think we have more examples of \Drupal::root() vs. $this->root. What about creating a follow up: #2928710: Eliminate usages of \Drupal::root() in tests

  2. +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
    @@ -43,31 +43,28 @@ protected function setUp() {
    +    // Place a custom local translation in the translations directory.
    +    mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    ...
    -    // Place a custom local translation in the translations directory.
    -    mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    -    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    

    Can I be naive and ask why this moving is needed in the first place?

Lendude’s picture

Sorry it took me a while to get back to this one. Needed a reroll so no interdiff.

#49.1 yeah doing a clean up sounds like a good idea. Changed the usage of \Drupal::root() where we we already using $this->root to prevent mixing them inside the same method.
#49.2 It was mostly because in a lot of cases we needed the file system to be set up, and this happens in prepareEnvironment. So running this code before setup was run would lead to problems (see #10). So just for ease of conversion, everything that was in setUp() was moved to prepareEnvironment. I'm not sure it was needed in every case, but I think it's clearer to just use the same pattern for every test.

Status: Needs review » Needs work

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

Anonymous’s picture

@Lendude, thanks for continue! I do not know why, but I was knocked down for it. So it's great that you have a time for this again!

But why almost all the tests fail? Locally they are green. Let's check the contents of the page on which the fall occurs.

Anonymous’s picture

Status: Needs work » Needs review
FileSize
54.65 KB
3.51 KB

Your PHP installation is running version 7.0.26. Support for this version will be dropped in a future Drupal release. Upgrade to PHP version 7.1 or higher to ensure your site continues to receive Drupal updates and remains secure. See PHP's version support documentation and the Drupal 8 PHP requirements handbook page for more information.

:)

So, c/p changes in InstallerTestBase from #2670966-129: Warn users of old PHP versions with two bit difference in continueOnExpectedWarnings():

  • - $warnings[] = trim((string) $warning);
    + $warnings[] = trim($warning->getText());
    

    Mink specific.

  •   $this->clickLink('continue anyway');
    + $this->checkForMetaRefresh();

    Otherwise, the redirect does not work after the click.

Lendude’s picture

Issue summary: View changes

So the only thing left in the Installer dir after applying the patch is \Drupal\system\Tests\Installer\ConfigAfterInstallerTestBase.

We probably need to @deprecated that, and add a CR for that. Or do we want to leave it for #2932909: Convert web tests to browser tests for Simpletest module

Updated the IS a bit.

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.

Lendude’s picture

Added the deprecation for ConfigAfterInstallerTestBase, that takes care of everything in the installer dir.

Status: Needs review » Needs work

The last submitted patch, 56: 2907728-56.patch, failed testing. View results

Lendude’s picture

Status: Needs work » Needs review
FileSize
55.88 KB

needed a reroll for 8.6.x

Status: Needs review » Needs work

The last submitted patch, 58: 2907728-58.patch, failed testing. View results

Lendude’s picture

Status: Needs work » Needs review
FileSize
1.35 KB
55.69 KB

.....

jibran’s picture

Just some observations.

  1. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +    $this->setupBaseUrl();
    ...
    +    $this->prepareEnvironment();
    ...
    +    $this->setupBaseUrl();
    ...
    +    $this->prepareEnvironment();
    

    Why are we doing this twice?

  2. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +    // Note that WebTestBase::installParameters() returns form input values
    ...
    +    // @see WebTestBase::translatePostValues()
    

    The comment needs an update.

  3. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +    // BrowserTestBase::drupalPostForm() is to actually build the POST data string
    

    > 80 char

  4. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +   * WebTestBase::refreshVariables() tries to operate on persistent storage,
    

    Outdated comment.

  5. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +    $edit = $this->translatePostValues($this->parameters['forms']['install_configure_form']);
    

    Do we need this BTB as well?

  6. +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
    @@ -0,0 +1,349 @@
    +   * Transforms a nested array into a flat array suitable for BrowserTestBase::drupalPostForm().
    

    > 80 char.

Lendude’s picture

@jibran thanks for looking at this!

#61.1 nice catch! removed the __construct method from InstallerTestBase, we should not be setting up in __construct, that's what setUp is for. Tried a couple of tests locally and doesn't seem its needed, but lets see what the Bot thinks.
#62.5 Not sure what you mean. Do you think we should move the translatePostValues method to BrowserTestBase? It was on WebTestBase but in core its only used in installer tests, so my vote would be to keep BrowserTestBase as lean as possible.

Fixed the comments you found plus some other WebTestBase references that were floating around.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

nm #62.5. interdiff looks good to me so RTBC unless bot disagrees.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 62: 2907728-62.patch, failed testing. View results

Lendude’s picture

Status: Needs work » Needs review
FileSize
5.03 KB
58.99 KB

looks like the __construct was a left over from previous attempts to make tests pass while overriding setup(). This doesn't work for BrowserTestBase, so all tests now use prepareEnvironment() and not setup(). The failing tests in #62 were all still using setup().

Lets see if I got everything.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

That's even better.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 65: 2907728-65.patch, failed testing. View results

jibran’s picture

Status: Needs work » Reviewed & tested by the community
tstoeckler’s picture

Note that [2939753] actually deprecates ConfigAfterInstallerTestBase into a more generic ProfileTestBase. I just saw this issue now, otherwise would have coordinated earlier. Don't want to stop this going in, though, as that one is not yet RTBC. So just a heads up, maybe someone has thoughts on this...

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 65: 2907728-65.patch, failed testing. View results

Lendude’s picture

Status: Needs work » Needs review
FileSize
728 bytes
58.97 KB

Needed an update after #2927344: Specifically warn about end dates for PHP support for old versions landed. This gets the BrowserTestBase version of InstallerTestBase back in line with the Simpletest version.

jibran’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, for the update.

Anonymous’s picture

git diff HEAD:core/modules/simpletest/src/InstallerTestBase.php HEAD:core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php > interdiff-InstallerTestBase.txt
All changes looks good. Except

+ protected function translatePostValues(array $values) {

This method from in WebTestBase. What about idea move it to BTB too? This will also remove the duplicate from MigrateUpgradeTestBase::translatePostValues().

Anonymous’s picture

Status: Reviewed & tested by the community » Needs review
Related issues: +#2939753: Extract DemoUmamiProfileTest::testConfig() into a ProfileTestBase
FileSize
60.48 KB
3.81 KB

Added related issue from @tstoeckler (#69). If I understand correctly, whose issue will be commited the second, that it will be necessary to make correction. But not before?

#73: done (or it should be like follow-up?)

Lendude’s picture

Status: Needs review » Reviewed & tested by the community

@vaplas would have been fine to do in a follow up I think (this is big enough as it is), but we have it now, so that's fine too. Always good to reduce duplication like that.

Looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
@@ -0,0 +1,318 @@
+require_once __DIR__ . '/../../../../includes/bootstrap.inc';

Hmmmm... why? At the very least this needs a comment. I can comment it out and run \Drupal\FunctionalTests\Installer\StandardInstallerTest successfully so it's definitely not needed for every test.

If I run tests via run-tests.sh for some reason tests based on the new InstallerTestBase don't look right...

Drupal test run
---------------

Tests to be run:
  - \Drupal\FunctionalTests\Installer\StandardInstallerTest

Test run started:
  Wednesday, February 7, 2018 - 22:51

Test summary
------------


Test run duration: 40 sec

versus for a regular BTB test...

Drupal test run
---------------

Tests to be run:
  - \Drupal\FunctionalTests\Breadcrumb\Breadcrumb404Test

Test run started:
  Wednesday, February 7, 2018 - 22:52

Test summary
------------

Drupal\FunctionalTests\Breadcrumb\Breadcrumb404Test            1 passes

Test run duration: 4 sec

For some reason the test summary is missing.

Mile23’s picture

  1. +++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
    @@ -542,7 +542,7 @@ protected function installParameters() {
    -    global $base_url;
    +    global $base_url, $base_path;
    
    @@ -556,7 +556,7 @@ protected function setupBaseUrl() {
    -    $path = isset($parsed_url['path']) ? rtrim(rtrim($parsed_url['path']), '/') : '';
    +    $base_path = $path = isset($parsed_url['path']) ? rtrim(rtrim($parsed_url['path']), '/') : '';
    

    We've made it this far without adding globals to our functional tests, and we shouldn't do it now.

  2. +++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
    @@ -43,22 +43,19 @@ protected function setUp() {
    +    $path = $this->root . DIRECTORY_SEPARATOR . $this->siteDirectory . '/profiles/mydistro';
    ...
    +    mkdir(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations', 0777, TRUE);
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.de.po', $this->getPo('de'));
    +    file_put_contents(\Drupal::root() . '/' . $this->siteDirectory . '/files/translations/drupal-8.0.0.fr.po', $this->getPo('fr'));
    

    Normalize on $this->root.

  3. StandardInstallerTest shows up as a risky test, so apparently it's not making any assertions.

Also, you can't run --group Installer unless you've already installed a site in place. Try it:

$ cd root/drupal
$ sudo git clean -fdx sites/
$ SIMPLETEST_BASE_URL=http://your.url ./vendor/bin/phpunit -c core/ --testsuite functional --group Installer

That's an argument in favor of converting these tests to kernel tests instead of functional tests, but that might be out of scope here.

Lendude’s picture

Status: Needs work » Needs review
FileSize
3.83 KB
59.62 KB

@alexpott and @Mile23 thanks for the feedback.

#76.1 Took out bootstrap.inc, you are right, it makes no difference, no idea why that was in, probably some left over earlier attempt to get these things to pass
#76.2 run-tests.sh just spams me with deprecation notices and fails, but I think it might have something to do with #77.3, lets see it that fixes this

#77.1 removed $base_path, lets see if that was needed anywhere, left $base_url in since removing that seems out of scope here
#77.2 sorta violates our 'keep the changes minimal' policy, but yeah lets clean that up
#77.3 "it's not making any assertions", well to be precise, it's not making any PHPUnit assertions, just custom stuff so they don't show up for the PHPUnit count, added some calls to addToAssertionCount in what seems like good places to start.

That's an argument in favor of converting these tests to kernel tests instead of functional tests, but that might be out of scope here.

Yeah that seems a tad out of scope here :D

Lets see how this does on the bot.

Anonymous’s picture

#78: Excellent adjustments! +1 to RTBC.


I added bootstrap.inc in #4 because many tests failed without predefined path constants (and I was afraid that they might lack something else too). But after numerous adjustments from Lendude, the tests work like a charm without it. Cool!
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I added bootstrap.inc in #4 because many tests failed without predefined path constants (and I was afraid that they might lack something else too). But after numerous adjustments from Lendude, the tests work like a charm without it. Cool!

This is indeed some nice improvement!

Great catches by @Mile23 and @alexpott!

alexpott’s picture

Everything looks great here. I think we should open a follow-up (or search for an existing issue) to fix how run-tests.sh deals with risky tests. We might have some atm and we would not know.

One thing that gives me pause about committing this now is that this would represent a massive divergence in 8.5.x and 8.6.x testing and it some of our most important tests - ie. the installer tests. I'm going to tag this needs release manager review and see if we can get consensus to backport this to 8.5.1.

chr.fritsch’s picture

+++ b/core/tests/Drupal/FunctionalTests/Installer/ConfigAfterInstallerTestBase.php
@@ -0,0 +1,44 @@
+    $default_install_path = 'core/profiles/' . $this->profile . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;

Would it make sense to make this configurable so that distributions could use this test as well?

I am thinking about ThunderInstallerTest that currently extends InstallerTestBase.

https://cgit.drupalcode.org/thunder/tree/src/Tests/Installer/ThunderInst...

alexpott’s picture

@chr.fritsch I think that that might valid but in a separate issue.

alexpott’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 21dd263 and pushed to 8.6.x. Thanks!

Can we get an 8.5.x version of the patch without the deprecation (thanks @catch for the idea). So we can keep 8.5.x and 8.6.x in sync. We'll commit once 8.5.0 is out.

  • alexpott committed 21dd263 on 8.6.x
    Issue #2907728 by Lendude, vaplas, dawehner, jibran, alexpott, Mile23:...
alexpott’s picture

Lendude’s picture

Thanks everybody for your work on this, very nice to get this in!

Here is the 8.5.x patch without the deprecation of \Drupal\system\Tests\Installer\ConfigAfterInstallerTestBase

Anonymous’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
1.08 KB

Excellent news! Many thanks! 🎉🎉🎉

Made an interdiff for insurance.

jibran’s picture

I think we should open a follow-up (or search for an existing issue) to fix how run-tests.sh deals with risky tests. We might have some atm and we would not know.

We already have #2905007: Allow run-tests.sh to report skipped/risky/incomplete PHPUnit-based tests. Do we still need a dedicated issue for risky tests?

alexpott’s picture

@jibran it's not the same as a skipped test - so I would say yes. Obviously the issues are related though so should be linked.

Anonymous’s picture

Mile23’s picture

I'll update the scope for #2905007: Allow run-tests.sh to report skipped/risky/incomplete PHPUnit-based tests because they're different categories but the same solution.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 578b093 and pushed to 8.5.x. Thanks!

  • alexpott committed 578b093 on 8.5.x
    Issue #2907728 by Lendude, vaplas, dawehner, jibran, alexpott, Mile23:...

Status: Fixed » Closed (fixed)

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