Skip to content

Commit

Permalink
Added D9 fixture and CI config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Skrypnyk authored Aug 9, 2021
1 parent 9df62d0 commit 2c9db0d
Show file tree
Hide file tree
Showing 306 changed files with 18,755 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ commands:
cmd: |
ahoy cli "mkdir -p \$APP/\$BUILD"
[ ${CI+x} ] && docker cp -L . $(docker-compose ps -q cli):$APP/ || true
docker cp -L behat.yml $(docker-compose ps -q cli):$APP/$BUILD/
docker cp -L tests $(docker-compose ps -q cli):$APP/$BUILD/
docker cp -L tests $(docker-compose ps -q cli):$APP/
docker cp -L phpcs.xml $(docker-compose ps -q cli):$APP/
# Copy file to the $BUILD to run Behat from within the $BUILD fixture directory.
docker cp -L behat.yml $(docker-compose ps -q cli):$APP/$BUILD/
ahoy cli "COMPOSER_MEMORY_LIMIT=-1 composer install -n --ansi --prefer-dist --no-suggest"
hide: true

Expand Down
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ jobs:
build_d8:
<<: *build

build_d9:
<<: *build
docker:
- image: drevops/ci-builder
environment:
DRUPAL_VERSION: 9

workflows:
version: 2
main:
jobs:
- build_d7
- build_d8
- build_d9
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ For example, to skip `beforeScenario` hook from `JsTrait`, add
- Make sure that all local web development services are shut down (Apache/Nginx, Mysql, MAMP etc).
- Checkout project repository (in one of the [supported Docker directories](https://docs.docker.com/docker-for-mac/osxfs/#access-control)).
- `pygmy up`
- `ahoy build` for Drupal 8 build or `DRUPAL_VERSION=7 ahoy build` for Drupal 7.
- `ahoy build` for Drupal 8 build, or `DRUPAL_VERSION=9 ahoy build` for Drupal 9, or `DRUPAL_VERSION=7 ahoy build` for Drupal 7.
- Access built site at http://behat-steps.docker.amazee.io/

Please note that you will need to rebuild to work on a different Drupal version.
Expand All @@ -86,5 +86,5 @@ To debug tests from CLI:

To update fixtures:
- Make required changes in the installed fixture site
- Run `ahoy drush cex -y` for Drupal 8 or `ahoy drush fua -y` for Drupal 7
- Run `ahoy update-fixtures` for Drupal 8 or `DRUPAL_VERSION=7 ahoy update-fixtures` for Drupal 7 to export configuration changes from build directory to the fixtures directory.
- Run `ahoy drush cex -y` for Drupal 8/9 or `ahoy drush fua -y` for Drupal 7
- Run `ahoy update-fixtures` for Drupal 8, or `DRUPAL_VERSION=9 ahoy update-fixtures` for Drupal 9, or `DRUPAL_VERSION=7 ahoy update-fixtures` for Drupal 7 to export configuration changes from build directory to the fixtures directory.
9 changes: 8 additions & 1 deletion behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ default:
Drupal\MinkExtension:
goutte: ~
base_url: http://nginx:8080
files_path: '%paths.base%/tests/behat/fixtures'
# This file is copied into "build" directory, but runs tests from the root of the project.
files_path: '%paths.base%/../tests/behat/fixtures'
browser_name: chrome
selenium2:
wd_host: "http://chrome:4444/wd/hub"
Expand Down Expand Up @@ -54,6 +55,12 @@ d8:
filters:
tags: "@d8&&~@skipped"

d9:
gherkin:
cache: '/tmp/behat_gherkin_cache'
filters:
tags: "@d9&&~@skipped"

d7:
gherkin:
cache: '/tmp/behat_gherkin_cache'
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/features/behat.smoke.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Behat feature context smoke tests

Basically, tests for tests, which are testing our steps provided by this package.

@api @d8
@api @d8 @d9
Scenario: Assert that a module can be installed and uninstalled
Given I am logged in as a user with the "administer site configuration, administer modules" permissions
When I go to "/admin/modules"
Expand All @@ -24,7 +24,7 @@ Feature: Behat feature context smoke tests
And the response status code should be 200
Then the "modules[book][enable]" checkbox should be unchecked

@api @d8
@api @d8 @d9
Scenario: Assert that a cookie presence and absence assertions work
Given I am logged in as a user with the "administer site configuration" permissions
Then cookie "testcookiename" exists
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/behatcli.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d7 @d8 @behatcli
@d7 @d8 @d9 @behatcli
Feature: Behat CLI context

Tests for BehatCliContext functionality that is used to test Behat Steps traits
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/behatcli.steps.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d7 @d8 @behatcli
@d7 @d8 @d9 @behatcli
Feature: Behat CLI context additional steps

@trait:PathTrait
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.big_pipe.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that BigPipeTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.content.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that ContentTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.email.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that email assertions work for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.file-download.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that FileDownloadTrait works for D8

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.file.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that FileTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.media.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that MediaTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.menu.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that MenuTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.override.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that OverrideTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.paragraphs.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that ParagraphsTrait works for D8

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.role.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that RoleTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.search.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8 @search
@d8 @d9 @search
Feature: Ensure Search work.

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.taxonomy.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that TaxonomyTrait works for D8

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.testmode.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8 @wip11
@d8
Feature: Ensure TestmodeTrait works.

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.user.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that UserTrait works for D8

Background:
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.watchdog.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8 @errorcleanup
@d8 @d9 @errorcleanup
Feature: Check that WatchdogTrait works for D8

@trait:D8\WatchdogTrait
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.wysisywg.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that WysiwygTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/d8.wysiwyg.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d8
@d8 @d9
Feature: Check that WysiywgTrait works for D8

@api
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/homepage.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@d7 @d8
@d7 @d8 @d9 @homepage
Feature: Homepage

Ensure that homepage is displayed as expected.
Expand Down
17 changes: 17 additions & 0 deletions tests/behat/fixtures/d9/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Drupal editor configuration normalization
# @see http://editorconfig.org/

# This is the top-most .editorconfig file; do not search in parent directories.
root = true

# All files.
[*]
end_of_line = LF
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[composer.{json,lock}]
indent_size = 4
13 changes: 13 additions & 0 deletions tests/behat/fixtures/d9/.rsync-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- .rsync-exclude
- vendor/
- node_modules/
- composer.lock
- README.txt
- example*
+ config
+ docroot
+ docroot/modules
+ docroot/modules/custom
- docroot/modules/contrib
- docroot/modules/*
- docroot/*
104 changes: 104 additions & 0 deletions tests/behat/fixtures/d9/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"name": "myorg/mysite",
"description": "Drupal 9 site for MYSITE",
"license": "proprietary",
"require": {
"composer/installers": "^1.2.0",
"drupal/coffee": "^1",
"drupal/core-composer-scaffold": "^9",
"drupal/core-recommended": "^9",
"drupal/paragraphs": "^1.9",
"drupal/pathauto": "^1.8",
"drupal/scheduled_transitions": "^2.1",
"drupal/search_api": "^1.16",
"drush/drush": "^10",
"webflo/drupal-finder": "^1.2",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"wikimedia/composer-merge-plugin": "^2"
},
"config": {
"platform": {
"php": "7.3"
},
"process-timeout": 0,
"sort-packages": true
},
"autoload": {
"classmap": [
"scripts/composer/"
]
},
"conflict": {
"drupal/core": "7.*"
},
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"extra": {
"merge-plugin": {
"include": [
"../composer.json"
]
},
"drupal-scaffold": {
"locations": {
"web-root": "./docroot"
},
"file-mapping": {
"[project-root]/.gitattributes": false,
"[web-root]/.htaccess": false,
"[web-root]/.ht.router.php": false,
"[web-root]/example.gitignore": false,
"[web-root]/INSTALL.txt": false,
"[web-root]/README.txt": false,
"[web-root]/sites/example.settings.local.php": false,
"[web-root]/sites/example.sites.php": false,
"[web-root]/web.config": false
}
},
"installer-paths": {
"docroot/core": [
"type:drupal-core"
],
"docroot/libraries/{$name}": [
"type:drupal-library",
"type:bower-asset",
"type:npm-asset"
],
"docroot/modules/contrib/{$name}": [
"type:drupal-module"
],
"docroot/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"docroot/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
]
},
"installer-types": [
"bower-asset",
"npm-asset"
]
},
"scripts": {
"post-install-cmd": [
"DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
"DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
],
"drupal-post-install": [
"chmod 644 docroot/sites/default/settings.php; echo \"\\$settings['config_sync_directory'] = '../config/sync';\" >> docroot/sites/default/settings.php; chmod 444 docroot/sites/default/settings.php",
"drush -r docroot config-set system.site uuid b74534f3-cac7-4fbf-b0a6-5cba2aa9bd1e -y --uri=http://nginx",
"drush -r docroot ev \"\\Drupal::entityTypeManager()->getStorage('shortcut_set')->load('default')->delete();\" --uri=http://nginx || true",
"drush -r docroot cim --source=../config/sync -y --uri=http://nginx",
"drush -r docroot pm:enable mysite_core -y --uri=http://nginx"
]
}
}
Empty file.
23 changes: 23 additions & 0 deletions tests/behat/fixtures/d9/config/sync/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
Deny from all
</IfModule>
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
# Override the handler again if we're run later in the evaluation list.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003
</Files>

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
1 change: 1 addition & 0 deletions tests/behat/fixtures/d9/config/sync/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains configuration to be imported into your Drupal site. To make this configuration active, visit admin/config/development/configuration/sync. For information about deploying configuration between servers, see https://www.drupal.org/documentation/administer/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interval: 10800
_core:
default_config_hash: fUksROt4FfkAU9BV4hV2XvhTBSS2nTNrZS4U7S-tKrs
Loading

0 comments on commit 2c9db0d

Please sign in to comment.