8000 Updated Drupal fixture to 10.2. by AlexSkrypnyk · Pull Request #214 · drevops/behat-steps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Updated Drupal fixture to 10.2. #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account 8000 related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,22 @@ commands:
&& ahoy cli "cd /app/build && ./vendor/bin/phpmd ../src text phpmd.xml" \
&& ahoy cli "cd /app/build && ./vendor/bin/phpmd ../tests/behat/bootstrap text phpmd.xml" \
&& ahoy cli "cd /app/build && ./vendor/bin/phpstan" \
&& ahoy cli "cd /app/build && ./vendor/bin/rector process ../src --dry-run && cd .."
&& ahoy cli "cd /app/build && ./vendor/bin/rector process ../src --clear-cache --dry-run || true"

lint-fix:
usage: Fix code.
cmd: |
ahoy cli "cd /app/build && ./vendor/bin/phpcbf" \
&& ahoy cli "cp -Rf phpcs.xml phpstan.neon build > /dev/null" \
&& ahoy cli "cd /app/build && ./vendor/bin/rector process ../src && cd .."
ahoy cli "cp -Rf phpcs.xml phpstan.neon build > /dev/null" \
&& ahoy cli "cd /app/build && ./vendor/bin/rector process ../src --clear-cache" \
&& ahoy cli "cd /app/build && ./vendor/bin/phpcbf"

test-bdd:
usage: Run BDD tests.
cmd: ahoy cli "cd /app/build && vendor/bin/behat -c /app/behat.yml --strict --colors --profile=d${DRUPAL_VERSION} $@"

debug:
usage: Enable PHP Xdebug.
cmd: ahoy cli php -v | grep -q Xdebug || XDEBUG_ENABLE=true ahoy up cli php nginx && ahoy cli php -v | grep -q Xdebug && echo "Enabled debug confguration. Use 'ahoy up' to disable."
cmd: ahoy cli php -v | grep -q Xdebug || XDEBUG_ENABLE=true ahoy up cli php nginx && ahoy cli php -v | grep -q Xdebug && echo "Enabled debug configuration. Use 'ahoy up' to disable."

update-fixtures:
usage: Update fixture files for Drupal.
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ aliases:
no_output_timeout: 30m
- run:
name: Lint code
command: ahoy lint
command: ahoy lint || [ "${CI_LINT_IGNORE_FAILURE:-0}" -eq 1 ]
- run:
name: Run tests
command: ahoy test-bdd
command: ahoy test-bdd || [ "${CI_TEST_IGNORE_FAILURE:-0}" -eq 1 ]
- run:
name: Process artifacts
command: |
Expand Down
1 change: 1 addition & 0 deletions .circleci/install-site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo " > Validating fixture Composer configuration."
composer validate --ansi --no-check-all

echo " > Merging configuration from module's composer.json."
# Do not add `JSON_UNESCAPED_SLASHES` as it will break the relative path replacement below.
php -r "echo json_encode(array_replace_recursive(json_decode(file_get_contents('/app/composer.json'), true),json_decode(file_get_contents('/app/build/composer.json'), true)),JSON_PRETTY_PRINT);" > "/app/build/composer2.json" && mv -f "/app/build/composer2.json" "/app/build/composer.json"

echo " > Updating relative paths in build composer.json."
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1",
"drevops/behat-screenshot": "^1",
"drevops/behat-screenshot": "^1.5",
"drupal/coder": "^8.3",
"mglaman/phpstan-drupal": "^1.2",
"palantirnet/drupal-rector": "^0.20",
Expand Down
9 changes: 4 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# For reference, @see https://github.com/drevops/drupal-dev/blob/8.x/docker-compose.yml
version: '2.3'

# For reference, @see https://github.com/drevops/scaffold/blob/main/docker-compose.yml
x-project:
&project ${PROJECT:-behat-steps}

Expand Down Expand Up @@ -28,11 +26,12 @@ x-environment:
DRUPAL_VERSION: ${DRUPAL_VERSION:-9}
BEHAT_SCREENSHOT_DIR: ${BEHAT_SCREENSHOT_DIR:-/app/screenshots}
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
PHP_MEMORY_LIMIT: 2048M

services:

cli:
image: uselagoon/php-8.1-cli-drupal:24.3.1
image: uselagoon/php-8.2-cli-drupal:24.3.1
<<: *default-volumes
user: root
environment:
Expand All @@ -41,7 +40,7 @@ services:
- container:amazeeio-ssh-agent ### Local overrides to mount host SSH keys. Automatically removed in CI.

php:
image: uselagoon/php-8.1-fpm:24.3.1
image: uselagoon/php-8.2-fpm:24.3.1
<<: [*default-volumes, *default-user]
environment:
<<: *default-environment
Expand Down
16 changes: 0 additions & 16 deletions tests/behat/fixtures/d10/.rsync-exclude

This file was deleted.

28 changes: 17 additions & 11 deletions tests/behat/fixtures/d10/composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"name": "myorg/mysite",
"description": "Drupal 9 site for MYSITE",
"description": "Drupal 10 site for MYSITE",
"license": "proprietary",
"require": {
"php": ">=8.1",
"php": ">=8.2",
"composer/installers": "^2.1",
"cweagans/composer-patches": "^1.7",
"drupal/core-composer-scaffold": "^10",
"drupal/core-project-message": "^10",
"drupal/core-recommended": "^10",
"drupal/core-composer-scaffold": "~10.2",
"drupal/core-project-message": "~10.2",
"drupal/core-recommended": "~10.2",
"drupal/paragraphs": "^1.15",
"drupal/pathauto": "^1.11",
"drupal/scheduled_transitions": "^2.3",
"drupal/search_api": "^1.26",
"drush/drush": "^11",
"drush/drush": "^12",
"drupal/testmode": "^2",
"oomphinc/composer-installers-extender": "^2.0",
"vlucas/phpdotenv": "^5.4",
"webflo/drupal-finder": "dev-master#2663b117878f4a45ca56df028460350c977f92c0 as 1.2",
"webflo/drupal-finder": "dev-master#ba98770d652a280933da0dbd7e3ac78db93f8567 as 1.2",
"webmozart/path-util": "^2.3"
},
"require-dev": {
"drupal/core-dev": "^10"
"drupal/core-dev": "~10.2"
},
"config": {
"process-timeout": 0,
Expand All @@ -34,7 +34,8 @@
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"oomphinc/composer-installers-extender": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"php-http/discovery": true
}
},
"autoload": {
Expand All @@ -51,7 +52,7 @@
"url": "https://packages.drupal.org/8"
}
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true,
"extra": {
"enable-patching": true,
Expand Down Expand Up @@ -96,7 +97,12 @@
"installer-types": [
"bower-asset",
"npm-asset"
]
],
"patches": {
"drush/drush": {
"DrupalFinder drush replacement PR did not fully replaced it in Preflight": "patches/drush-5965.patch"
}
}
},
"scripts": {
"post-install-cmd": [
Expand Down
13 changes: 13 additions & 0 deletions tests/behat/fixtures/d10/patches/drush-5965.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Preflight/Preflight.php b/src/Preflight/Preflight.php
index c22ed3f73..da47bec01 100644
--- a/src/Preflight/Preflight.php
+++ b/src/Preflight/Preflight.php
@@ -307,7 +307,7 @@ class Preflight

// Check to see if the alias on the command line points at
// a local Drupal site that is not the site at $root
- $localAliasDrupalFinder = new DrupalFinder($this->environment());
+ $localAliasDrupalFinder = new DrupalFinder($this->environment()->cwd());
$foundAlternateRoot = $localAliasDrupalFinder->locateRoot($selfSiteAlias->localRoot());
if ($foundAlternateRoot) {
$alteredRoot = Path::canonicalize($localAliasDrupalFinder->getDrupalRoot());
37 changes: 36 additions & 1 deletion tests/behat/fixtures/d10/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,41 @@
use DrupalRector\Set\Drupal10SetList;
use DrupalRector\Set\Drupal8SetList;
use DrupalRector\Set\Drupal9SetList;
use Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector;
use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector;
use Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector;
use Rector\Config\RectorConfig;
use Rector\DeadCode\Rector\If_\RemoveAlwaysTrueIfConditionRector;
use Rector\Set\ValueObject\SetList;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->sets([
// Provided by Rector.
SetList::PHP_80,
SetList::PHP_81,
SetList::PHP_82,
SetList::CODE_QUALITY,
SetList::CODING_STYLE,
SetList::DEAD_CODE,
SetList::INSTANCEOF,
SetList::TYPE_DECLARATION,
// Provided by Drupal Rector.
Drupal8SetList::DRUPAL_8,
Drupal9SetList::DRUPAL_9,
Drupal10SetList::DRUPAL_10,
]);

$rectorConfig->rule(DeclareStrictTypesRector::class);

$drupalFinder = new DrupalFinder();
$drupalFinder->locateRoot(__DIR__);

$drupalRoot = $drupalFinder->getDrupalRoot();
$rectorConfig->autoloadPaths([
$drupalRoot . '/core',
Expand All @@ -40,6 +60,16 @@
]);

$rectorConfig->skip([
// Rules added by Rector's rule sets.
ArraySpreadInsteadOfArrayMergeRector::class,
CountArrayToEmptyArrayComparisonRector::class,
DisallowedEmptyRuleFixerRector::class,
InlineArrayReturnAssignRector::class,
NewlineAfterStatementRector::class,
NewlineBeforeNewAssignSetRector::class,
PostIncDecToPreIncDecRector::class,
RemoveAlwaysTrueIfConditionRector::class,
SimplifyEmptyCheckOnEmptyArrayRector::class,
// Dependencies.
'*/vendor/*',
'*/node_modules/*',
Expand All @@ -48,9 +78,14 @@
'*/modules/contrib/*',
'*/themes/contrib/*',
'*/profiles/contrib/*',
'*/sites/default/default.settings.php',
// Files.
'*/sites/simpletest/*',
'*/sites/default/files/*',
'*/sites/simpletest/*',
// Scaffold files.
'*/autoload.php',
'*/index.php',
'*/update.php',
// Composer scripts.
'*/scripts/composer/*',
]);
Expand Down
0