Skip to content
Snippets Groups Projects
Commit 45b5c3c1 authored by Daniel Davis-Boxleitner's avatar Daniel Davis-Boxleitner Committed by Ken Rickard
Browse files

Issue #3388682 by ddavisboxleitner, agentrickard: Move automated testing to GitLab

parent fb5aa79e
No related branches found
No related tags found
2 merge requests!61phpcs error,!57Issue #3388682 configure Gitlab CI
Pipeline #69274 passed
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include, here in gitlab-ci.yml
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
################
# Variable overrides for domain testing.
################
.test-variables:
variables:
SIMPLETEST_BASE_URL: "http://example.local/$_WEB_ROOT"
.phpunit-base:
before_script:
- echo "127.0.0.1 example.local" >> /etc/hosts
- echo "127.0.0.1 one.example.local" >> /etc/hosts
- echo "127.0.0.1 two.example.local" >> /etc/hosts
- echo "127.0.0.1 three.example.local" >> /etc/hosts
- echo "127.0.0.1 four.example.local" >> /etc/hosts
- echo "127.0.0.1 five.example.local" >> /etc/hosts
- echo "127.0.0.1 six.example.local" >> /etc/hosts
- echo "127.0.0.1 seven.example.local" >> /etc/hosts
- echo "127.0.0.1 eight.example.local" >> /etc/hosts
- echo "127.0.0.1 nine.example.local" >> /etc/hosts
- echo "127.0.0.1 ten.example.local" >> /etc/hosts
variables:
SKIP_ESLINT: '1'
SKIP_PHPCS: '1'
SKIP_PHPSTAN: '1'
......@@ -160,7 +160,7 @@ class DomainStorage extends ConfigEntityStorage implements DomainStorageInterfac
}
$values += [
'scheme' => $this->getDefaultScheme(),
'status' => 1,
'status' => '1',
'weight' => count($domains) + 1,
'is_default' => (int) empty($default),
];
......
......@@ -191,9 +191,11 @@ trait DomainTestTrait {
foreach ($required as $key) {
$edit[$key] = $domain->get($key);
}
// URL validation has issues on Travis, so only do it when requested.
$edit['validate_url'] = 0;
$edit['id'] = \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($edit['hostname']);
// Validation requires extra test steps, so do not do it by default.
$edit['validate_url'] = 0;
return $edit;
}
......
......@@ -52,7 +52,7 @@ class DomainAliasActionsTest extends DomainAliasTestBase {
$i++;
}
$path = $domain->getScheme() . 'five.' . $base . '/admin/config/domain';
$path = $domain->getScheme() . 'five.' . $base . $GLOBALS['base_path'] . 'admin/config/domain';
// Visit the domain overview administration page.
$this->drupalGet($path);
......
......@@ -87,7 +87,7 @@ class DomainAliasEnvironmentTest extends DomainAliasTestBase {
$this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath());
}
// For an aliased request (four.example.com), the list should be aliased.
$url = $domain->getScheme() . $alias->getPattern();
$url = $domain->getScheme() . $alias->getPattern() . $GLOBALS['base_path'];
$this->drupalGet($url);
foreach ($matches as $match) {
$this->assertSession()->assertEscaped($match->getPattern());
......
......@@ -66,7 +66,7 @@ class DomainAliasListHostnameTest extends DomainAliasTestBase {
$this->drupalLogin($admin);
// Load an aliased domain.
$this->drupalGet($domain->getScheme() . 'five.' . $base . '/admin/config/domain');
$this->drupalGet($domain->getScheme() . 'five.' . $base . $GLOBALS['base_path'] . 'admin/config/domain');
$this->assertSession()->statusCodeEquals(200);
// Save the form.
......
......@@ -76,7 +76,7 @@ class DomainAliasWildcardTest extends DomainAliasTestBase {
$this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath());
}
// For an aliased request (four.example.com), the list should be aliased.
$url = $domain->getScheme() . str_replace('*', $this->baseTLD, $alias->getPattern());
$url = $domain->getScheme() . str_replace('*', $this->baseTLD, $alias->getPattern()) . $GLOBALS['base_path'];
$this->drupalGet($url);
foreach ($matches as $match) {
$this->assertSession()->assertEscaped(str_replace('*', $this->baseTLD, $match->getPattern()));
......
parameters:
ignoreErrors:
-
message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#"
count: 2
path: domain_source/src/Plugin/views/filter/DomainSource.php
# Configuration file for PHPStan static code checking, see https://phpstan.org.
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
- phpstan-baseline.neon
parameters:
level: 2
paths:
- .
ignoreErrors:
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static#"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment