diff --git a/automatic_updates.info.yml b/automatic_updates.info.yml index 923883316d37879a516ecdfbce9fb3e994eadf3e..27a6926201bcbdd3662f983590e2012a1efec667 100644 --- a/automatic_updates.info.yml +++ b/automatic_updates.info.yml @@ -3,5 +3,5 @@ type: module description: 'Experimental module to develop automatic updates. Currently the module provides checks for update readiness but does not yet provide update functionality.' core_version_requirement: ^9 dependencies: - - automatic_updates_9_3_shim - - update + - drupal:automatic_updates_9_3_shim + - drupal:update diff --git a/drupalci.yml b/drupalci.yml new file mode 100644 index 0000000000000000000000000000000000000000..232228cdb25efb40021f8fc990fecc61023515d6 --- /dev/null +++ b/drupalci.yml @@ -0,0 +1,73 @@ +# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing +# Copied from https://git.drupalcode.org/project/ckeditor5/-/blob/c68be57fbc2c29969e9726ec932af3f0e80c3dd9/drupalci.yml +# cspell:disable +build: + assessment: + validate_codebase: + # automatic_updates code quality checking matches that of Drupal core: it is checked by container_command.commit_checks. + testing: + # Run code quality checks. + container_command.commit-checks: + commands: + # Copy core's checking script into this contrib module. + - "cp /var/www/html/core/scripts/dev/commit-code-check.sh modules/contrib/automatic_updates/" + # Comply with core's checking script file permissions expectations. + - chmod 644 modules/contrib/automatic_updates/ + # Rewrite $TOP_LEVEL/core since $TOP_LEVEL now refers to the contrib module. + - sed -i "s/\$TOP_LEVEL\/core/\/var\/www\/html\/core/" modules/contrib/automatic_updates/commit-code-check.sh + # Ensure the remainder of the script runs from the script's directory and not the current working directory. + - sed -i "s/# Gets list of files to check./cd \"\$\(dirname \"\$0\"\)\";/" modules/contrib/automatic_updates/commit-code-check.sh + # When constructing $FILES, ignore the `commit-code-check.sh` file we just copied. + - sed -i "s/--exclude=vendor/--exclude=vendor --exclude=commit-code-check.sh/" modules/contrib/automatic_updates/commit-code-check.sh + # vendor/bin/phpcs now needs to be prefixed. And $TOP_LEVEL/vendor needs to be rewritten. + - sed -i "s/vendor\/bin\/phpcs/\/var\/www\/html\/vendor\/bin\/phpcs/" modules/contrib/automatic_updates/commit-code-check.sh + - sed -i "s/\$TOP_LEVEL\/vendor/\/var\/www\/html\/vendor/" modules/contrib/automatic_updates/commit-code-check.sh + # Disable all JS compile checks until we've matched core's build process. + # @todo Remove this in https://www.drupal.org/project/automatic_updates/issues/3221082. + - sed -i "s/COMPILE_CHECK=1/COMPILE_CHECK=0/" modules/contrib/automatic_updates/commit-code-check.sh + - sed -i "s/core\/scripts\/js/js/" modules/contrib/automatic_updates/commit-code-check.sh + # Uncomment to Check all files + #- sed -i "s/git diff --name-only HEAD~1 HEAD/find \* -type f -not -path \"\.\/\.git\*\"/" modules/contrib/automatic_updates/commit-code-check.sh + # Add our words to the dictionary + - sed -i "s/abiword/updater's/" core/misc/cspell/dictionary.txt + - sed -i "s/absolutezero/stager's/" core/misc/cspell/dictionary.txt + # After all of the shenanigans above, we're finally ready to run core's `commit-code-check.sh`! :) + - "modules/contrib/automatic_updates/commit-code-check.sh --drupalci" + # Restore the original permissions. + - chmod 777 modules/contrib/automatic_updates/ + halt-on-fail: true + # run_tests task is executed several times in order of performance speeds. + # halt-on-fail can be set on the run_tests tasks in order to fail fast. + # suppress-deprecations is false in order to be alerted to usages of + # deprecated code. + # @todo Uncomment in https://www.drupal.org/i/3228125 +# run_tests.build: +# # Limit concurrency due to disk space concerns. +# concurrency: 15 +# types: 'PHPUnit-Build' +# testgroups: '--all' +# suppress-deprecations: false +# halt-on-fail: false + run_tests.phpunit: + types: 'PHPUnit-Unit' + testgroups: '--all' + suppress-deprecations: false + halt-on-fail: false + run_tests.kernel: + types: 'PHPUnit-Kernel' + testgroups: '--all' + suppress-deprecations: false + halt-on-fail: false + run_tests.functional: + types: 'PHPUnit-Functional' + testgroups: '--all' + suppress-deprecations: false + halt-on-fail: false + # Functional JavaScript tests require a concurrency of 1 because there is + # only one instance of PhantomJS on the testbot machine. + #run_tests.javascript: + # concurrency: 1 + # types: 'PHPUnit-FunctionalJavascript' + # testgroups: '--all' + # suppress-deprecations: false + # halt-on-fail: false diff --git a/tests/fixtures/project_staged_validation/new_project_added/active/composer.lock b/tests/fixtures/project_staged_validation/new_project_added/active/composer.lock index 94120e7e010dc5a3836ce092a68c5a43b7cee69e..a98bc9cad77679e2f11d6cab1778199d4f5fbc53 100644 --- a/tests/fixtures/project_staged_validation/new_project_added/active/composer.lock +++ b/tests/fixtures/project_staged_validation/new_project_added/active/composer.lock @@ -1,7 +1,7 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.0", "type": "drupal-module" }, @@ -14,7 +14,7 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.0", "type": "drupal-module" }, diff --git a/tests/fixtures/project_staged_validation/new_project_added/staged/composer.lock b/tests/fixtures/project_staged_validation/new_project_added/staged/composer.lock index 4f13ff8c3459d1799f89f9bccf5ff90c2afd9c3c..a5b3e1c62aea2142e215a712b998cd3d0bc360f1 100644 --- a/tests/fixtures/project_staged_validation/new_project_added/staged/composer.lock +++ b/tests/fixtures/project_staged_validation/new_project_added/staged/composer.lock @@ -1,12 +1,12 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.0", "type": "drupal-module" }, { - "name": "drupal/testmodule2", + "name": "drupal/test_module2", "version": "1.3.1", "type": "drupal-module" }, @@ -19,12 +19,12 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.0", "type": "drupal-module" }, { - "name": "drupal/dev-testmodule2", + "name": "drupal/dev-test_module2", "version": "1.3.1", "type": "drupal-custom-module" }, diff --git a/tests/fixtures/project_staged_validation/no_errors/active/composer.lock b/tests/fixtures/project_staged_validation/no_errors/active/composer.lock index 9130122783c74ee3c1018879419e60df9a1127b4..0eeceb0c96066f250b7f55664f6258c5914f0bef 100644 --- a/tests/fixtures/project_staged_validation/no_errors/active/composer.lock +++ b/tests/fixtures/project_staged_validation/no_errors/active/composer.lock @@ -1,7 +1,7 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.0", "type": "drupal-module" }, @@ -20,7 +20,7 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.0", "type": "drupal-module" }, diff --git a/tests/fixtures/project_staged_validation/no_errors/staged/composer.lock b/tests/fixtures/project_staged_validation/no_errors/staged/composer.lock index 07411d7f7d27c917f890a2d652c72ef884f6a0e3..93ef0ebbc5f7d459dad93e4361c0bdb7336ae38d 100644 --- a/tests/fixtures/project_staged_validation/no_errors/staged/composer.lock +++ b/tests/fixtures/project_staged_validation/no_errors/staged/composer.lock @@ -1,7 +1,7 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.0", "type": "drupal-module" }, @@ -20,7 +20,7 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.0", "type": "drupal-module" }, diff --git a/tests/fixtures/project_staged_validation/project_removed/active/composer.lock b/tests/fixtures/project_staged_validation/project_removed/active/composer.lock index d42425d52dddda11d818dfb6ae01479a74d77aed..ef2f849c66139908f83fe4c0579e967ade4228fe 100644 --- a/tests/fixtures/project_staged_validation/project_removed/active/composer.lock +++ b/tests/fixtures/project_staged_validation/project_removed/active/composer.lock @@ -6,7 +6,7 @@ "type": "drupal-theme" }, { - "name": "drupal/testmodule2", + "name": "drupal/test_module2", "version": "1.3.1", "type": "drupal-module" }, @@ -24,7 +24,7 @@ "type": "drupal-custom-theme" }, { - "name": "drupal/dev-testmodule2", + "name": "drupal/dev-test_module2", "version": "1.3.1", "type": "drupal-module" }, diff --git a/tests/fixtures/project_staged_validation/project_removed/staged/composer.lock b/tests/fixtures/project_staged_validation/project_removed/staged/composer.lock index 49ef1a451efe8337bb533657f86271e1014a7064..d8a60b12647d7d1c0d40a27dca5296b95d84886e 100644 --- a/tests/fixtures/project_staged_validation/project_removed/staged/composer.lock +++ b/tests/fixtures/project_staged_validation/project_removed/staged/composer.lock @@ -1,14 +1,14 @@ { "packages": [ { - "name": "drupal/testmodule2", + "name": "drupal/test_module2", "version": "1.3.1", "type": "drupal-module" } ], "packages-dev": [ { - "name": "drupal/dev-testmodule2", + "name": "drupal/dev-test_module2", "version": "1.3.1", "type": "drupal-module" } diff --git a/tests/fixtures/project_staged_validation/version_changed/active/composer.lock b/tests/fixtures/project_staged_validation/version_changed/active/composer.lock index ed424c59307f92489fb2a03d1bc84e08c4585e31..5da8f50209cd3a1afca10a4572651140c9751980 100644 --- a/tests/fixtures/project_staged_validation/version_changed/active/composer.lock +++ b/tests/fixtures/project_staged_validation/version_changed/active/composer.lock @@ -1,7 +1,7 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.0", "type": "drupal-module" }, @@ -14,7 +14,7 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.0", "type": "drupal-module" }, diff --git a/tests/fixtures/project_staged_validation/version_changed/staged/composer.lock b/tests/fixtures/project_staged_validation/version_changed/staged/composer.lock index 033fbec94d721230b7ff328a7959345544b0ef0a..129f0ffdc1c914e95763bb34b9c61180d58d1754 100644 --- a/tests/fixtures/project_staged_validation/version_changed/staged/composer.lock +++ b/tests/fixtures/project_staged_validation/version_changed/staged/composer.lock @@ -1,7 +1,7 @@ { "packages": [ { - "name": "drupal/testmodule", + "name": "drupal/test_module", "version": "1.3.1", "type": "drupal-module" }, @@ -14,7 +14,7 @@ ], "packages-dev": [ { - "name": "drupal/dev-testmodule", + "name": "drupal/dev-test_module", "version": "1.3.1", "type": "drupal-module" }, diff --git a/tests/modules/automatic_updates_test/automatic_updates_test.info.yml b/tests/modules/automatic_updates_test/automatic_updates_test.info.yml index eee46d1e2aae41883f2a94314afa10209b1ea3e3..ad42f727c2e6ae4397d18e9e1bc305b6bfa44bed 100644 --- a/tests/modules/automatic_updates_test/automatic_updates_test.info.yml +++ b/tests/modules/automatic_updates_test/automatic_updates_test.info.yml @@ -2,6 +2,5 @@ name: 'Automatic Updates Test module 1' type: module description: 'Module for testing Automatic Updates.' package: Testing -version: VERSION dependencies: - drupal:automatic_updates diff --git a/tests/modules/automatic_updates_test2/automatic_updates_test2.info.yml b/tests/modules/automatic_updates_test2/automatic_updates_test2.info.yml index c6029d2b96031b7e6073421e556b9256f57d46ee..89f9ae2276477065b1abf987acf5ad2e98519f2d 100644 --- a/tests/modules/automatic_updates_test2/automatic_updates_test2.info.yml +++ b/tests/modules/automatic_updates_test2/automatic_updates_test2.info.yml @@ -2,6 +2,5 @@ name: 'Automatic Updates Test module 2' type: module description: 'Test module to provide an additional readiness checker.' package: Testing -version: VERSION dependencies: - drupal:automatic_updates_test diff --git a/tests/src/Functional/UpdaterFormTest.php b/tests/src/Functional/UpdaterFormTest.php index abe90381ebb1b875dc15af93b1199ae0d7ea1083..2354113d17435d786a0db4480f0f7f484aa7fc46 100644 --- a/tests/src/Functional/UpdaterFormTest.php +++ b/tests/src/Functional/UpdaterFormTest.php @@ -48,7 +48,7 @@ class UpdaterFormTest extends BrowserTestBase { /** * {@inheritdoc} */ - protected function setUp() { + protected function setUp(): void { parent::setUp(); $this->config('update_test.settings') diff --git a/tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php b/tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php index cebf09f39a2cc9b1d1d5bb35a32adb0c332d1241..a8e5dc869d38f2c0c9de77a8244f134702f4b1a7 100644 --- a/tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php +++ b/tests/src/Kernel/ReadinessValidation/ReadinessValidationManagerTest.php @@ -1,6 +1,6 @@ <?php -namespace Drupal\Tests\automatic_updates\Kernel\Validation; +namespace Drupal\Tests\automatic_updates\Kernel\ReadinessValidation; use Drupal\automatic_updates_test\ReadinessChecker\TestChecker1; use Drupal\automatic_updates_test2\ReadinessChecker\TestChecker2; diff --git a/tests/src/Unit/StagedProjectsValidationTest.php b/tests/src/Unit/StagedProjectsValidationTest.php index 1596f0e9dc0cbd9e88d2833adafe89ecf08eda1d..c3b256bfa7d5bb1ab0c8bbfb7577f5acfbeaa238 100644 --- a/tests/src/Unit/StagedProjectsValidationTest.php +++ b/tests/src/Unit/StagedProjectsValidationTest.php @@ -91,8 +91,8 @@ class StagedProjectsValidationTest extends UnitTestCase { "$fixtures_folder/new_project_added", 'The update cannot proceed because the following Drupal projects were installed during the update.', [ - "module 'drupal/testmodule2' installed.", - "custom module 'drupal/dev-testmodule2' installed.", + "module 'drupal/test_module2' installed.", + "custom module 'drupal/dev-test_module2' installed.", ], ], 'project_removed' => [ @@ -107,8 +107,8 @@ class StagedProjectsValidationTest extends UnitTestCase { "$fixtures_folder/version_changed", 'The update cannot proceed because the following Drupal projects were unexpectedly updated. Only Drupal Core updates are currently supported.', [ - "module 'drupal/testmodule' from 1.3.0 to 1.3.1.", - "module 'drupal/dev-testmodule' from 1.3.0 to 1.3.1.", + "module 'drupal/test_module' from 1.3.0 to 1.3.1.", + "module 'drupal/dev-test_module' from 1.3.0 to 1.3.1.", ], ], ];