Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCarden committed Oct 8, 2019
2 parents 413c025 + 37d4f66 commit 144f453
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 27 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cache:
directories:
- "$HOME/.composer/cache"
- "$HOME/.drush/cache"
- "$HOME/.rvm"
- "${TMPDIR:-/tmp}/phpstan/cache"

branches:
Expand Down
7 changes: 6 additions & 1 deletion bin/orca.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
}
require __DIR__ . '/../vendor/autoload.php';

ini_set('memory_limit', -1);
set_time_limit(0);

$input = new ArgvInput();
Expand All @@ -40,7 +41,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;
}

Expand Down
8 changes: 7 additions & 1 deletion bin/travis/after_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions bin/travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 16 additions & 4 deletions bin/travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"ext-dom": "*",
"ext-json": "*",
"ext-sqlite3": "*",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.0
v1.1.0
6 changes: 0 additions & 6 deletions config/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -95,9 +92,6 @@ drupal/lightning_api:
version: ~
version_dev: ~

#acquia/lightning_commerce:
# type: drupal-profile

drupal/lightning_core:
core_matrix:
8.7.x:
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<!-- https://www.tablesgenerator.com/markdown_tables -->

Expand All @@ -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).
Expand Down
1 change: 1 addition & 0 deletions example/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cache:
directories:
- "$HOME/.composer/cache"
- "$HOME/.drush/cache"
- "$HOME/.rvm"
- "${TMPDIR:-/tmp}/phpstan/cache"

env:
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<description>PHP CodeSniffer configuration for analyzing packages with ORCA.</description>

<arg name="colors"/>
<arg name="cache" value="var/.phpcs-cache"/>
<arg name="cache" value="var/cache/phpcs.json"/>
<arg name="parallel" value="10"/>

<file>.</file>
Expand Down
22 changes: 19 additions & 3 deletions src/Fixture/FixtureInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -40,6 +41,13 @@ class FixtureInspector {
*/
private $fixture;

/**
* The output decorator.
*
* @var \Symfony\Component\Console\Style\SymfonyStyle
*/
private $output;

/**
* The package manager.
*
Expand All @@ -66,15 +74,18 @@ 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
* The process runner.
* @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;
Expand Down Expand Up @@ -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];
}
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Task/DeprecatedCodeScanner/PhpStanTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Task/StaticAnalysisTool/PhpCodeSnifferTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/Task/StaticAnalysisTool/PhpLocTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
File renamed without changes.
Empty file added var/cache/.gitkeep
Empty file.
Empty file added var/log/.gitkeep
Empty file.

0 comments on commit 144f453

Please sign in to comment.