From 9d367ea89cd138163c98ed1b74227b2f2ae78b96 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Thu, 3 Oct 2019 15:26:48 -0400 Subject: [PATCH 01/10] Back to dev. [skip ci] --- config/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/VERSION b/config/VERSION index 0ec25f750..74a91a8f3 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -v1.0.0 +v1.0.0-dev From 92893bfb307672804e44999e79d43d96bd8564cb Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Fri, 4 Oct 2019 08:51:18 -0400 Subject: [PATCH 02/10] Organized var/ directory. --- bin/orca.php | 6 +++++- composer.json | 4 ++-- composer.lock | 2 +- phpcs.xml.dist | 2 +- src/Task/DeprecatedCodeScanner/PhpStanTask.php | 2 +- src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php | 2 +- src/Task/StaticAnalysisTool/PhpLocTask.php | 2 +- var/{ => backup}/.gitkeep | 0 var/cache/.gitkeep | 0 var/log/.gitkeep | 0 10 files changed, 12 insertions(+), 8 deletions(-) rename var/{ => backup}/.gitkeep (100%) create mode 100644 var/cache/.gitkeep create mode 100644 var/log/.gitkeep diff --git a/bin/orca.php b/bin/orca.php index 3fa5079db..e80cd67ec 100644 --- a/bin/orca.php +++ b/bin/orca.php @@ -40,7 +40,11 @@ // command because a stale or corrupted cache would render it unusable-- // precisely when it is needed. if (in_array($input->getFirstArgument(), ['cache:clear', 'cc'])) { - (new Filesystem())->remove($kernel->getCacheDir()); + $filesystem = new Filesystem(); + $cache_dir = $kernel->getCacheDir(); + $filesystem->remove($cache_dir); + $filesystem->mkdir($cache_dir); + $filesystem->touch("{$cache_dir}/.gitkeep"); exit; } diff --git a/composer.json b/composer.json index 5679044c0..5fbb4fb05 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "pre-commit": [ "set -e", "vendor/bin/parallel-lint --exclude vendor --no-progress .", - "vendor/bin/phpcs --cache=var/.phpcs-cache" + "vendor/bin/phpcs --cache=var/cache/phpcs.json" ], "pre-push": "vendor/bin/phpcs", "post-install-cmd": "vendor/bin/cghooks add --ignore-lock", @@ -88,7 +88,7 @@ ], "cghooks": "cghooks --ansi", "phpcbf": "phpcbf", - "phpcs": "phpcs -s --cache=var/.phpcs-cache", + "phpcs": "phpcs -s --cache=var/cache/phpcs.json", "phplint": "parallel-lint --exclude vendor --ignore-fails .", "phpmd": "phpmd . text phpmd.xml.dist --ignore-violations-on-exit", "phpunit": "phpunit" diff --git a/composer.lock b/composer.lock index 8ff5e0399..100cbdf4e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d68590d14e045343a7af5c02238212da", + "content-hash": "67213e05a6b6a2c3e9d44f9ae93369a8", "packages": [ { "name": "acquia/coding-standards", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 05f6ede67..911991f79 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -8,7 +8,7 @@ PHP CodeSniffer configuration for analyzing packages with ORCA. - + . diff --git a/src/Task/DeprecatedCodeScanner/PhpStanTask.php b/src/Task/DeprecatedCodeScanner/PhpStanTask.php index 641782654..e3adcc987 100644 --- a/src/Task/DeprecatedCodeScanner/PhpStanTask.php +++ b/src/Task/DeprecatedCodeScanner/PhpStanTask.php @@ -19,7 +19,7 @@ class PhpStanTask { use SutSettingsTrait; - public const JSON_LOG_PATH = 'var/phpstan.json'; + public const JSON_LOG_PATH = 'var/log/phpstan.json'; /** * The command array. diff --git a/src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php b/src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php index bb664fa50..8509fac81 100644 --- a/src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php +++ b/src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php @@ -12,7 +12,7 @@ */ class PhpCodeSnifferTask extends TaskBase { - public const JSON_LOG_PATH = 'var/phpcs.json'; + public const JSON_LOG_PATH = 'var/log/phpcs.json'; /** * The status code. diff --git a/src/Task/StaticAnalysisTool/PhpLocTask.php b/src/Task/StaticAnalysisTool/PhpLocTask.php index 0b3b9a04d..6f33a3630 100644 --- a/src/Task/StaticAnalysisTool/PhpLocTask.php +++ b/src/Task/StaticAnalysisTool/PhpLocTask.php @@ -9,7 +9,7 @@ */ class PhpLocTask extends TaskBase { - public const JSON_LOG_PATH = 'var/phploc.json'; + public const JSON_LOG_PATH = 'var/log/phploc.json'; /** * {@inheritdoc} diff --git a/var/.gitkeep b/var/backup/.gitkeep similarity index 100% rename from var/.gitkeep rename to var/backup/.gitkeep diff --git a/var/cache/.gitkeep b/var/cache/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/var/log/.gitkeep b/var/log/.gitkeep new file mode 100644 index 000000000..e69de29bb From 98a532105954564487d1cc45017a62c9d43d1c56 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Fri, 4 Oct 2019 09:28:00 -0400 Subject: [PATCH 03/10] Updated required PHP version. --- composer.json | 2 +- composer.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 5fbb4fb05..a25d01c1e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=7.1", + "php": ">=7.2", "ext-dom": "*", "ext-json": "*", "ext-sqlite3": "*", diff --git a/composer.lock b/composer.lock index 100cbdf4e..8215789df 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "67213e05a6b6a2c3e9d44f9ae93369a8", + "content-hash": "27053cd38b037f1804344109ede26597", "packages": [ { "name": "acquia/coding-standards", @@ -6076,7 +6076,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.1", + "php": ">=7.2", "ext-dom": "*", "ext-json": "*", "ext-sqlite3": "*" From ea7ac5700f8b5a344f57737bd31c23f3de71e1be Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Fri, 4 Oct 2019 09:45:00 -0400 Subject: [PATCH 04/10] Made fixture inspector tolerant of Drush failure. --- src/Fixture/FixtureInspector.php | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Fixture/FixtureInspector.php b/src/Fixture/FixtureInspector.php index b72ba8931..de1311b06 100644 --- a/src/Fixture/FixtureInspector.php +++ b/src/Fixture/FixtureInspector.php @@ -6,6 +6,7 @@ use Noodlehaus\Config; use Noodlehaus\Parser\Json; use Symfony\Component\Console\Helper\TableSeparator; +use Symfony\Component\Console\Style\SymfonyStyle; /** * Creates a fixture. @@ -40,6 +41,13 @@ class FixtureInspector { */ private $fixture; + /** + * The output decorator. + * + * @var \Symfony\Component\Console\Style\SymfonyStyle + */ + private $output; + /** * The package manager. * @@ -66,6 +74,8 @@ class FixtureInspector { * * @param \Acquia\Orca\Fixture\Fixture $fixture * The fixture. + * @param \Symfony\Component\Console\Style\SymfonyStyle $output + * The output decorator. * @param \Acquia\Orca\Fixture\PackageManager $package_manager * The package manager. * @param \Acquia\Orca\Utility\ProcessRunner $process_runner @@ -73,8 +83,9 @@ class FixtureInspector { * @param \Acquia\Orca\Fixture\SubextensionManager $subextension_manager * The subextension manager. */ - public function __construct(Fixture $fixture, PackageManager $package_manager, ProcessRunner $process_runner, SubextensionManager $subextension_manager) { + public function __construct(Fixture $fixture, SymfonyStyle $output, PackageManager $package_manager, ProcessRunner $process_runner, SubextensionManager $subextension_manager) { $this->fixture = $fixture; + $this->output = $output; $this->packageManager = $package_manager; $this->processRunner = $process_runner; $this->subextensionManager = $subextension_manager; @@ -213,12 +224,12 @@ private function getPackageStabilitySetting(): string { * The field name. * * @return string - * The field value. + * The field value if available or an exclamation mark (!) if not. */ private function getDrushStatusField(string $field): string { $json = $this->getDrushStatusJson(); if (!array_key_exists($field, $json) || !is_string($json[$field])) { - return '~'; + return '!'; } return $json[$field]; } @@ -248,6 +259,11 @@ private function getDrushStatusJson(): array { $this->drushStatus = $data; + if (!is_array($this->drushStatus)) { + $this->output->warning('Could not retrieve Drush status info. Some fixture details, denoted with an exclamation mark (!), are unavailable.'); + $this->drushStatus = []; + } + return $this->drushStatus; } From 98eb84c9013ac9822888aefcd49021c48041fc9b Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Fri, 4 Oct 2019 09:56:35 -0400 Subject: [PATCH 05/10] Removed PHP memory limit in front script. --- bin/orca.php | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/orca.php b/bin/orca.php index e80cd67ec..81313d44c 100644 --- a/bin/orca.php +++ b/bin/orca.php @@ -18,6 +18,7 @@ } require __DIR__ . '/../vendor/autoload.php'; +ini_set('memory_limit', -1); set_time_limit(0); $input = new ArgvInput(); From 342053f5ea8093df94ac0f0748fb25f1eeefb7cf Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Fri, 4 Oct 2019 17:13:28 -0400 Subject: [PATCH 06/10] Added upstream ORCA status to end of Travis CI output (#44) --- .travis.yml | 1 + bin/travis/after_script.sh | 8 +++++++- bin/travis/before_install.sh | 3 +++ example/.travis.yml | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 887ee83ca..e5f7b83f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ cache: directories: - "$HOME/.composer/cache" - "$HOME/.drush/cache" + - "$HOME/.rvm" - "${TMPDIR:-/tmp}/phpstan/cache" branches: diff --git a/bin/travis/after_script.sh b/bin/travis/after_script.sh index 151353e42..0242cac78 100755 --- a/bin/travis/after_script.sh +++ b/bin/travis/after_script.sh @@ -7,10 +7,16 @@ # after_script.sh # # DESCRIPTION -# Logs the job on cron if telemetry is enabled. +# Conditionally logs the job and displays upstream ORCA status. cd "$(dirname "$0")" || exit; source _includes.sh +# Log the job on cron if telemetry is enabled. if [[ "$TRAVIS_EVENT_TYPE" = "cron" && "$ORCA_TELEMETRY_ENABLE" && "$ORCA_AMPLITUDE_API_KEY" && "$ORCA_AMPLITUDE_USER_ID" ]]; then orca internal:log-job fi + +# Show ORCA's own current build status. A failure may signify an upstream issue +# or service level outage that could have affected this build. +# @see https://travis-ci.org/acquia/orca/branches +travis history --no-interactive --repo=acquia/orca --branch=master --limit=1 --date diff --git a/bin/travis/before_install.sh b/bin/travis/before_install.sh index ff57a4c08..c71db9611 100755 --- a/bin/travis/before_install.sh +++ b/bin/travis/before_install.sh @@ -40,6 +40,9 @@ composer global require \ hirak/prestissimo \ zaporylie/composer-drupal-optimizations +# Install Travis command line client. +gem install travis + # Install ORCA. composer -d"$ORCA_ROOT" install diff --git a/example/.travis.yml b/example/.travis.yml index f3e62ef25..83d5f34c4 100644 --- a/example/.travis.yml +++ b/example/.travis.yml @@ -32,6 +32,7 @@ cache: directories: - "$HOME/.composer/cache" - "$HOME/.drush/cache" + - "$HOME/.rvm" - "${TMPDIR:-/tmp}/phpstan/cache" env: From fed133773dfa98cfab96c12ab747d530395c1ba1 Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Mon, 7 Oct 2019 09:09:31 -0400 Subject: [PATCH 07/10] Stopped running non-SUT Behat tests (#45) --- bin/travis/script.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/travis/script.sh b/bin/travis/script.sh index 73a8d1633..2b2e2a836 100755 --- a/bin/travis/script.sh +++ b/bin/travis/script.sh @@ -25,10 +25,22 @@ case "$ORCA_JOB" in "DEPRECATED_CODE_SCAN") eval "orca qa:deprecated-code-scan --sut=$ORCA_SUT_NAME" ;; "DEPRECATED_CODE_SCAN_CONTRIB") eval "orca qa:deprecated-code-scan --contrib" ;; "ISOLATED_RECOMMENDED") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only" ;; - "INTEGRATED_RECOMMENDED") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY" ;; - "CORE_PREVIOUS") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY" ;; + "INTEGRATED_RECOMMENDED") + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY --phpunit" + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only --behat" + ;; + "CORE_PREVIOUS") + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY --phpunit" + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only --behat" + ;; "ISOLATED_DEV") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only" ;; - "INTEGRATED_DEV") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY" ;; - "CORE_NEXT") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY" ;; + "INTEGRATED_DEV") + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY --phpunit" + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only --behat" + ;; + "CORE_NEXT") + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME $SUT_ONLY --phpunit" + eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME --sut-only --behat" + ;; "CUSTOM") eval "orca qa:automated-tests --sut=$ORCA_SUT_NAME ${ORCA_CUSTOM_TESTS_RUN_ARGS:=}" ;; esac From a917b3406585fe97e7425a943d4ca1f133f267f8 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Mon, 7 Oct 2019 09:23:51 -0400 Subject: [PATCH 08/10] Updated documentation on running automated tests. [skip ci] --- docs/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 8389e52de..cd907b7a7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -98,7 +98,7 @@ For more information on using Behat with Drupal, see [the Behat website](http:// ### Tagging/grouping -ORCA uses tags (for Behat) and groups (for PHPUnit) to determine which tests to run when, as depicted in the table below, where black indicates a test's being included and white indicates its being ignored: +ORCA uses tags (for Behat) and groups (for PHPUnit) to determine which tests to run when, as depicted in the table below: @@ -110,7 +110,7 @@ ORCA uses tags (for Behat) and groups (for PHPUnit) to determine which tests to The default behavior is to run a test only when the package providing it is the SUT--not when it is merely included in another package's test fixture. Any test not designated public or ignored is so treated. Such tests are referred to as "private tests". This should be considered the correct choice for most tests--particularly for features that involve little or no risk of conflict with other Acquia packages, including [isolated unit tests](http://wiki.c2.com/?UnitTestIsolation) by definition. -Public tests (`orca_public`) are _always_ run, including when testing packages other than the one providing them. For example, a public test provided by Lightning API will also be run during tests of Acquia Commerce Manager, Acquia Lift, and the rest. Public tests thus lengthen builds for _all Acquia packages_ and should be used judiciously. Reserve them for high value features with meaningful risk of being broken by other packages, and make them as fast as possible. +Public PHPUnit tests (`orca_public`) are _always_ run, including when testing packages other than the one providing them. (Behat has proved a source of too much instability to inflict across the board, so the default Travis CI jobs _never_ run non-SUT Behat tests.) For example, a public PHPUnit test provided by Lightning API will also be run during tests of Acquia Commerce Manager, Acquia Lift, and the rest. Public tests thus lengthen builds for _all Acquia packages_ and should be used judiciously. Reserve them for high value features with meaningful risk of being broken by other packages, and make them as fast as possible. Ignored tests (`orca_ignore`) are "ignored" and _never_ run by ORCA. Tests should be ignored when they depend upon setup or preconditions that ORCA doesn't provide, such as a fixture with unique dependencies or a database populated by SQL dump. Once ignored, such tests can be scripted to run apart from ORCA after custom setup. In practice, it should rarely be necessary to ignore a test, as most setup and teardown can be accomplished through [Behat hooks](http://behat.org/en/latest/user_guide/context/hooks.html) and [PHPUnit template methods](https://phpunit.de/manual/6.5/en/fixtures.html). From 7c9a31a8cd294c8d77ba7a4762aea35bce75fba6 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Mon, 7 Oct 2019 15:56:09 -0400 Subject: [PATCH 09/10] Removed commented out profiles from packages.yml. [skip ci] --- config/packages.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/packages.yml b/config/packages.yml index d65ad4112..96339fb3d 100644 --- a/config/packages.yml +++ b/config/packages.yml @@ -74,9 +74,6 @@ drupal/cog: acquia/drupal-spec-tool: type: behat-extension -#drupal/lightning: -# type: drupal-profile - drupal/lightning_api: core_matrix: 8.7.x: @@ -95,9 +92,6 @@ drupal/lightning_api: version: ~ version_dev: ~ -#acquia/lightning_commerce: -# type: drupal-profile - drupal/lightning_core: core_matrix: 8.7.x: From 37d4f66e8b8dee39cb86a915309fb4aa9b42f546 Mon Sep 17 00:00:00 2001 From: TravisCarden Date: Tue, 8 Oct 2019 08:22:13 -0400 Subject: [PATCH 10/10] Bumped version number. --- config/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/VERSION b/config/VERSION index 74a91a8f3..795460fce 100644 --- a/config/VERSION +++ b/config/VERSION @@ -1 +1 @@ -v1.0.0-dev +v1.1.0