Skip to content

Commit

Permalink
Merge branch 'release/1.0.0-alpha11'
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCarden committed May 3, 2019
2 parents ff07472 + 30a148f commit 45f334a
Show file tree
Hide file tree
Showing 17 changed files with 370 additions and 123 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ matrix:
fast_finish: true
include:
- { name: "Static code analysis", env: ORCA_JOB=STATIC_CODE_ANALYSIS }
- { name: "Deprecated code scan w/ SUT", env: ORCA_JOB=DEPRECATED_CODE_SCAN_SUT }
- { name: "Deprecated code scan w/ dependencies", env: ORCA_JOB=DEPRECATED_CODE_SCAN_CONTRIB }
- { name: "Deprecated code scan of SUT only", env: ORCA_JOB=DEPRECATED_CODE_SCAN_SUT }
- { name: "Deprecated code scan of SUT plus contrib", env: ORCA_JOB=DEPRECATED_CODE_SCAN_CONTRIB }
- { name: "Isolated test w/ recommended package versions", env: ORCA_JOB=ISOLATED_RECOMMENDED }
- { name: "Integrated test w/ recommended package versions", env: ORCA_JOB=INTEGRATED_RECOMMENDED }
- { name: "Previous minor version of Drupal core", env: ORCA_JOB=CORE_PREVIOUS }
- { name: "Integrated test w/ recommended package versions & previous minor release of Drupal core", env: ORCA_JOB=CORE_PREVIOUS }
- { name: "Isolated test w/ dev package versions", env: ORCA_JOB=ISOLATED_DEV }
- { name: "Integrated test w/ dev package versions", env: ORCA_JOB=INTEGRATED_DEV }
- { name: "Next pre-release of Drupal core", env: ORCA_JOB=CORE_NEXT }
- { name: "Integrated test w/ dev package versions & next minor dev version of Drupal core", env: ORCA_JOB=CORE_NEXT }
allow_failures:
- env: ORCA_JOB=DEPRECATED_CODE_SCAN_CONTRIB

Expand All @@ -46,6 +46,8 @@ install:
- ../orca/bin/travis/self-test/install.sh
- ../orca/bin/travis/install.sh

before_script: ../orca/bin/travis/before_script.sh

script:
- ../orca/bin/travis/self-test/script.sh
- ../orca/bin/travis/script.sh
Expand Down
4 changes: 4 additions & 0 deletions bin/travis/_includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ assert "$TRAVIS" "This script is meant to run on Travis CI only."
# Set environment variables.
export ORCA_ROOT="$(cd "$(dirname "$BASH_SOURCE")/../.." && pwd)"
export ORCA_FIXTURE_DIR=${ORCA_FIXTURE_DIR:="${ORCA_ROOT}/../orca-build"}
export ORCA_FIXTURE_DOCROOT=${ORCA_FIXTURE_DIR}/docroot
export ORCA_SUT_DIR=${ORCA_SUT_DIR:=${TRAVIS_BUILD_DIR}}

# Add binary directories to PATH.
Expand All @@ -41,6 +42,9 @@ export PATH="$ORCA_ROOT/vendor/bin:$PATH"
export PATH="$ORCA_FIXTURE_DIR/vendor/bin:$PATH"
export PATH="$TRAVIS_BUILD_DIR/vendor/bin:$PATH"

# Add convenient aliases.
alias drush="drush -r ${ORCA_FIXTURE_DOCROOT}"

# Exit as soon as one command returns a non-zero exit code and make the shell
# print all lines in the script before executing them.
# @see https://docs.travis-ci.com/user/job-lifecycle/#complex-build-commands
Expand Down
3 changes: 3 additions & 0 deletions bin/travis/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

cd "$(dirname "$0")"; source _includes.sh

# Display the Google Chrome version.
google-chrome-stable --version

# Disable Xdebug.
phpenv config-rm xdebug.ini

Expand Down
25 changes: 25 additions & 0 deletions bin/travis/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

# NAME
# before_script.sh - Display details about the fixture.
#
# SYNOPSIS
# before_script.sh
#
# DESCRIPTION
# Displays information about installed Composer packages and Drupal
# projects.

cd "$(dirname "$0")"; source _includes.sh

# Exit early in the absence of a fixture.
[[ -d "$ORCA_FIXTURE_DIR" ]] || exit 0

# Display installed Composer packages.
composer -d${ORCA_FIXTURE_DIR} show

# Display the list of available Drupal extensions (modules and themes).
drush --no-ansi pm:list || true

# Display basic Drupal site details.
drush core-status
6 changes: 3 additions & 3 deletions bin/travis/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# NAME
# install.sh - Install Travis CI dependencies
# install.sh - Install Travis CI dependencies.
#
# SYNOPSIS
# install.sh
Expand All @@ -21,10 +21,10 @@ assert_env_vars

[[ "$ORCA_JOB" != "INTEGRATED_RECOMMENDED" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME}

[[ "$ORCA_JOB" != "CORE_PREVIOUS" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --core=PREVIOUS_MINOR
[[ "$ORCA_JOB" != "CORE_PREVIOUS" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --core=PREVIOUS_RELEASE

[[ "$ORCA_JOB" != "ISOLATED_DEV" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --sut-only --dev

[[ "$ORCA_JOB" != "INTEGRATED_DEV" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --dev

[[ "$ORCA_JOB" != "CORE_NEXT" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --core=LATEST_PRERELEASE --dev
[[ "$ORCA_JOB" != "CORE_NEXT" ]] || orca fixture:init -f --sut=${ORCA_SUT_NAME} --core=NEXT_DEV --dev
2 changes: 1 addition & 1 deletion bin/travis/script.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# NAME
# script.sh - Run ORCA tests
# script.sh - Run ORCA tests.
#
# SYNOPSIS
# script.sh
Expand Down
2 changes: 1 addition & 1 deletion config/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.0-alpha10
v1.0.0-alpha11
19 changes: 12 additions & 7 deletions config/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
# place. Defaults to a directory adjacent to the fixture root named the
# Composer project name, e.g., "../example" for a "drupal/example" project.
# - "version": (optional) The recommended package version to require via
# Composer. Defaults to "*".
# Composer. Defaults to "*". Any version string Composer understands is
# acceptable. @see https://getcomposer.org/doc/articles/versions.md
# - "version_dev": (required) The dev package version to require via Composer.
# Any version string Composer understands is acceptable.
# @see https://getcomposer.org/doc/articles/versions.md
# - "enable": (internal) TRUE if the package is a Drupal module that should be
# automatically enabled or FALSE if not. Defaults to TRUE for modules. Always
# FALSE for anything else.
Expand All @@ -27,6 +30,7 @@
# or merged in using the "ORCA_PACKAGES_CONFIG_ALTER" environment variable. See
# config/services.yml for the relevant code or bin/self-test for a usage
# example.

#drupal/acquia_commercemanager:
# url: ../commerce-manager
# version_dev: 1.x-dev
Expand All @@ -47,7 +51,8 @@ drupal/acquia_purge:
version_dev: 1.x-dev

#drupal/acsf:
# version_dev: "*"
# version: ~1.0
# version_dev: 1.x-dev

acquia/blt:
type: composer-plugin
Expand All @@ -70,23 +75,23 @@ acquia/drupal-spec-tool:

drupal/lightning_api:
url: ../lightning-api
version_dev: 3.x-dev
version_dev: '3.x-dev || 4.x-dev'

drupal/lightning_core:
url: ../lightning-core
version_dev: 3.x-dev
version_dev: '3.x-dev || 4.x-dev'

drupal/lightning_layout:
url: ../lightning-layout
version_dev: 1.x-dev
version_dev: '1.x-dev || 2.x-dev'

drupal/lightning_media:
url: ../lightning-media
version_dev: 3.x-dev
version_dev: '3.x-dev || 4.x-dev'

drupal/lightning_workflow:
url: ../lightning-workflow
version_dev: 3.x-dev
version_dev: '2.x-dev || 3.x-dev'

#drupal/media_acquiadam:
# version_dev: 1.x-dev
2 changes: 2 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Invoke ORCA from the terminal (`bin/orca`). Use the `--help` command option to l
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:

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

| | (Default) | `orca_public` | `orca_ignore` |
|----------------------------|:--------------:|:--------------:|:--------------:|
| Isolated tests (own) | :black_circle: | :black_circle: | :white_circle: |
Expand Down
20 changes: 11 additions & 9 deletions docs/understanding-orca.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ See [Designing automated tests](getting-started.md#designing-automated-tests).

ORCA includes out-of-the-box support for Travis CI for continuous integration. The default implementation runs the following concurrent jobs per build:

| | #1<br />Static code<br />analysis | #2<br />Deprecated<br />code scan<br />w/ SUT | #3<br />Deprecated<br />code scan w/<br />dependencies | #4<br />Isolated/<br />recommended | #5<br />Integrated/<br />recommended | #6<br />Previous core<br />version | #7<br />Isolated/<br />dev | #8<br />Integrated/<br />dev | #9<br />Next core<br />version |
|----------------------|:---------------------------------:|:---------------------------------------------:|:------------------------------------------------------:|:----------------------------------:|:------------------------------------:|:----------------------------------:|:--------------------------:|:----------------------------:|:------------------------------:|
| Fixture type | None | SUT-only | SUT-only | SUT-only | Standard | Standard | SUT-only | Standard | Standard |
| Package stability | n/a | Stable | Stable | Stable | Stable | Stable | Dev | Dev | Dev |
| Drupal core version | n/a | Current | Current | Current | Current | Previous<br />minor | Current | Current | Latest pre-<br />release |
| Static analysis | :black_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: |
| Deprecated code scan | :white_circle: | :black_circle: | :black_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: |
| Automated tests | :white_circle: | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Allow failure | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: |
<!-- https://www.tablesgenerator.com/markdown_tables -->

| | #1<br />Static code<br />analysis | #2<br />Deprecated<br />code scan<br />of SUT only | #3<br />Deprecated<br />code scan<br />w/ contrib | #4<br />Isolated/<br />recommended | #5<br />Integrated/<br />recommended | #6<br /> Integrated/<br />recommended/<br />previous core | #7<br />Isolated/<br />dev | #8<br />Integrated/<br />dev | #9<br />Integrated/<br />dev/next core<br />dev |
|----------------------|:---------------------------------:|:--------------------------------------------------:|:-------------------------------------------------:|:----------------------------------:|:------------------------------------:|:---------------------------------------------------------:|:--------------------------:|:----------------------------:|:-----------------------------------------------:|
| Fixture type | None | SUT-only | SUT-only | SUT-only | Standard | Standard | SUT-only | Standard | Standard |
| Package stability | n/a | Stable | Stable | Stable | Stable | Stable | Dev | Dev | Dev |
| Drupal core version | n/a | Current | Current | Current | Current | Previous<br />minor dev | Current | Current | Next<br />minor dev |
| Static analysis | :black_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: |
| Deprecated code scan | :white_circle: | :black_circle: | :black_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: |
| Automated tests | :white_circle: | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: | :black_circle: |
| Allow failure | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :white_circle: | :black_circle: | :black_circle: | :black_circle: |

See [Configuring Travis CI](getting-started.md#configuring-travis-ci).

Expand Down
7 changes: 5 additions & 2 deletions example/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ matrix:
- { name: "Deprecated code scan of SUT plus contrib", env: ORCA_JOB=DEPRECATED_CODE_SCAN_CONTRIB }
- { name: "Isolated test w/ recommended package versions", env: ORCA_JOB=ISOLATED_RECOMMENDED }
- { name: "Integrated test w/ recommended package versions", env: ORCA_JOB=INTEGRATED_RECOMMENDED }
- { name: "Previous minor version of Drupal core", env: ORCA_JOB=CORE_PREVIOUS }
- { name: "Integrated test w/ recommended package versions & previous minor release of Drupal core", env: ORCA_JOB=CORE_PREVIOUS }
- { name: "Isolated test w/ dev package versions", env: ORCA_JOB=ISOLATED_DEV }
- { name: "Integrated test w/ dev package versions", env: ORCA_JOB=INTEGRATED_DEV }
- { name: "Next pre-release of Drupal core", env: ORCA_JOB=CORE_NEXT }
- { name: "Integrated test w/ dev package versions & next minor dev version of Drupal core", env: ORCA_JOB=CORE_NEXT }
# For various reasons, some jobs are allowed to fail without failing the whole
# build. They should still be watched for advance notice of future problems.
# @see https://docs.travis-ci.com/user/customizing-the-build#rows-that-are-allowed-to-fail
Expand All @@ -86,6 +86,9 @@ before_install:
# Create the test fixture and place the SUT.
install: ../orca/bin/travis/install.sh

# Display details about the fixture.
before_script: ../orca/bin/travis/before_script.sh

# Run the test script.
script: ../orca/bin/travis/script.sh

Expand Down
117 changes: 117 additions & 0 deletions src/Command/Debug/DebugCoreVersionsCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php

namespace Acquia\Orca\Command\Debug;

use Acquia\Orca\Command\Fixture\FixtureInitCommand;
use Acquia\Orca\Command\StatusCodes;
use Acquia\Orca\Utility\DrupalCoreVersionFinder;
use Acquia\Orca\Utility\StatusTable;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Provides a command.
*/
class DebugCoreVersionsCommand extends Command {

/**
* The default command name.
*
* @var string
*/
protected static $defaultName = 'debug:core-versions';

/**
* The Drupal core version finder.
*
* @var \Acquia\Orca\Utility\DrupalCoreVersionFinder
*/
private $drupalCoreVersionFinder;

/**
* Constructs an instance.
*
* @param \Acquia\Orca\Utility\DrupalCoreVersionFinder $drupal_core_version_finder
* The Drupal core version finder.
*/
public function __construct(DrupalCoreVersionFinder $drupal_core_version_finder) {
$this->drupalCoreVersionFinder = $drupal_core_version_finder;
parent::__construct(self::$defaultName);
}

/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setAliases(['core'])
->setDescription('Provides an overview of Drupal Core versions');
}

/**
* {@inheritdoc}
*/
public function execute(InputInterface $input, OutputInterface $output): int {
$output->writeln('Getting version data via Composer. This takes a while.');

$overview = [
$this->getRow(FixtureInitCommand::PREVIOUS_RELEASE),
$this->getRow(FixtureInitCommand::PREVIOUS_DEV),
$this->getRow(FixtureInitCommand::CURRENT_RECOMMENDED),
$this->getRow(FixtureInitCommand::CURRENT_DEV),
$this->getRow(FixtureInitCommand::NEXT_RELEASE),
$this->getRow(FixtureInitCommand::NEXT_DEV),
];

(new StatusTable($output))
->setRows($overview)
->render();
return StatusCodes::OK;
}

/**
* Gets a table row for a given version constant.
*
* @param string $version_constant
* The version constant.
*
* @return array
* A table row.
*/
private function getRow(string $version_constant): array {
$row = [$version_constant];
try {
switch ($version_constant) {
case FixtureInitCommand::PREVIOUS_RELEASE:
$row[] = $this->drupalCoreVersionFinder->getPreviousMinorRelease();
break;

case FixtureInitCommand::PREVIOUS_DEV:
$row[] = $this->drupalCoreVersionFinder->getPreviousDevVersion();
break;

case FixtureInitCommand::CURRENT_RECOMMENDED:
$row[] = $this->drupalCoreVersionFinder->getCurrentRecommendedRelease();
break;

case FixtureInitCommand::CURRENT_DEV:
$row[] = $this->drupalCoreVersionFinder->getCurrentDevVersion();
break;

case FixtureInitCommand::NEXT_RELEASE:
$row[] = $this->drupalCoreVersionFinder->getNextRelease();
break;

case FixtureInitCommand::NEXT_DEV:
$row[] = $this->drupalCoreVersionFinder->getNextDevVersion();
break;
}
}
catch (\RuntimeException $e) {
$row[] = '~';
}
return $row;
}

}
Loading

0 comments on commit 45f334a

Please sign in to comment.