Problem/Motivation

There are two errors showing for the phpunit output coming from the Gitlab CI testing.

There were 2 errors:

1) Drupal\Tests\domain_path\Functional\DomainPathDomainTest::testDomainPathGet
GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: one.localhost (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://one.localhost/web//cQFSUSNT
[ ... ]
2) Drupal\Tests\domain_path\Functional\DomainPathNodeAliasTest::testDomainPathNodeAliasesFill
Error: Call to undefined method Drupal\Tests\domain_path\Functional\DomainPathNodeAliasTest::drupalPostForm()

Steps to reproduce

View output of testing: https://git.drupalcode.org/issue/domain_path-3409798/-/jobs/508410

Proposed resolution

Resolve issues in code so all phpunit tests are passing.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

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

ddavisboxleitner created an issue. See original summary.

ddavisboxleitner’s picture

I resolved the first error by adding some /etc/hosts entries for the test queries to target. Added settings to gitlab-ci.yml file.

################
# Customize phpunit stage to:
#  * Add test domains
################
phpunit:
  extends: .phpunit-base
  services:
    # Include the normal containers.
    - !reference [.with-database]
    - !reference [.with-chrome]
  before_script:
      - echo "127.0.0.1  one.localhost" >> /etc/hosts
      - echo "127.0.0.1  two.localhost" >> /etc/hosts
      - echo "127.0.0.1  three.localhost" >> /etc/hosts
      - echo "127.0.0.1  four.localhost" >> /etc/hosts
      - echo "127.0.0.1  five.localhost" >> /etc/hosts
      - echo "127.0.0.1  six.localhost" >> /etc/hosts
      - echo "127.0.0.1  seven.localhost" >> /etc/hosts
      - echo "127.0.0.1  eight.localhost" >> /etc/hosts
      - echo "127.0.0.1  nine.localhost" >> /etc/hosts
      - echo "127.0.0.1  ten.localhost" >> /etc/hosts

The second error will need an update. The function drupalPostForm() is being used and is being deprecated.

Details about the change heeded described here: https://www.drupal.org/node/3168858

ddavisboxleitner’s picture

PHPunit tests are now passing.

I had to add some error checking in DomainPathHelper class on the alterEntityForm() function. We can't assume pathauto will be installed.

      if (array_key_exists('pathauto', $form['path']['widget'][0])) {
        $form_state->addBuildInfo('pathauto_checkbox', $form['path']['widget'][0]['pathauto']['#type'] === 'checkbox');
      }
ddavisboxleitner’s picture

Status: Active » Needs review
raywalters’s picture

Reviewed and verified that phpunit tests are passing in the pipeline.

raywalters’s picture

Status: Needs review » Reviewed & tested by the community

i-trokhanenko made their first commit to this issue’s fork.

i-trokhanenko’s picture

Status: Reviewed & tested by the community » Fixed

Merged. Thanks!

i-trokhanenko’s picture

Status: Fixed » Closed (fixed)

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