Problem/Motivation

In #3031379-114: Add a new test type to do real update testing, it was discovered that we set the base_url, but then don't use that value to relocate the installed site again. This is a problem and bug.

    $base_url = $input->getOption('base-url');

then later... we should use it (currently it isn't used) so we find the right install again.

    $parsed = parse_url($base_url);
    $port = $parsed['port'] ?? 80;
    $host = $parsed['host'] ?? 'localhost';
    // Remove 'sites/' from the beginning of the path.
    $site_path = substr($this->siteDirectory, 6);
    $fs->appendToFile($root . '/sites/sites.php', "\$sites['$port.$host'] = '$site_path';");

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heddn created an issue. See original summary.

heddn’s picture

While looking to updating the IS to include some more details I think I stumbled on a different issue. Possibly out of scope, but an interesting dilemma is that we have a single ENV variable. If two tests are using the same ENV variable and utilizing TestSiteInstallCommand, that could be a bit of a race condition.

    putenv("SIMPLETEST_DB=$db_url");
    putenv("SIMPLETEST_BASE_URL=$base_url");

The last submitted patch, 2: 3087862-tests_only.patch, failed testing. View results

heddn’s picture

re #2 and the interesting find about ENV variables...

TLDR; It shouldn't be a concern since the variables are locally scoped. Back to just looking at the documented IS and patches.

heddn:mtech: 5 minutes ago
build tests all run in the same docker container. and until we had a thing called build tests, you only had a need for a single set of ENV variables.

mixologic:drupalcon: 5 minutes ago
Right, same docker container, but thats not same ENV

heddn:mtech: 5 minutes ago
ENV is global, no?

heddn:mtech: 4 minutes ago
global for the container

mixologic:drupalcon: 4 minutes ago
its per shell instance

heddn:mtech: 4 minutes ago
so if 2+ build tests are running at the same time, oops, one just overwrote the other one's ENV variables

mixologic:drupalcon: 4 minutes ago
I think

mixologic:drupalcon: 4 minutes ago
ENV's are per shell

mixologic:drupalcon: 4 minutes ago
not global

heddn:mtech: 3 minutes ago
hmm... interesting thought. I hadn't considered that perspective. Yes, that would be true. They are local per shell

mixologic:drupalcon: 3 minutes ago
each test is getting spun up into its own shell right?

heddn:mtech: 3 minutes ago
yes

mixologic:drupalcon: 3 minutes ago
a shell spawned by a shell will inherit its parent env, so if the testrunner is setting them, that could be an issue

heddn:mtech: 2 minutes ago
I'll have to look at it from that angle

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

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should 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.

quietone’s picture

Component: simpletest.module » phpunit

Triaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.

This looks like it a Phpunit issue, changing component.

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

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

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

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Issue tags: +Bug Smash Initiative

Queueing up #2 for 9.5 tests

smustgrave’s picture

Version: 9.4.x-dev » 9.5.x-dev
Status: Needs review » Reviewed & tested by the community

#2 still passes 9.5.x

Includes a test-only patch that fails.
Looks like good additional tests which is great!

Am moving to 9.5.x

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 16097ece55 to 10.1.x and 3660b1697d to 10.0.x and ec5cf9f6de to 9.5.x. Thanks!

Nice fix and looks safe to back port to 9.5.x. Thanks @heddn.

  • alexpott committed 16097ec on 10.1.x
    Issue #3087862 by heddn: TestSiteInstallCommand doesn't work with build...

  • alexpott committed 3660b16 on 10.0.x
    Issue #3087862 by heddn: TestSiteInstallCommand doesn't work with build...

  • alexpott committed ec5cf9f on 9.5.x
    Issue #3087862 by heddn: TestSiteInstallCommand doesn't work with build...

Status: Fixed » Closed (fixed)

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