diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ac76ad2..0329cedb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,6 +51,11 @@ jobs: echo "phpstan for tasks" vendor/bin/phpstan analyse src --level=2 + # Run internal tests + - run: + name: Test custom phing commands + command: ./run-tests.sh + # Install a drupal test project. - run: name: Create artifacts directory diff --git a/.gitignore b/.gitignore index 0dca1458..b53fe74e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ .idea +tests/*.txt \ No newline at end of file diff --git a/.the-build/build.yml b/.the-build/build.yml new file mode 100644 index 00000000..be8c9d5a --- /dev/null +++ b/.the-build/build.yml @@ -0,0 +1,61 @@ +# @file +# Default build configuration properties. +# +# This file may be customized for your project. The full set of default values can be +# found in the-build's repository. +# @see https://github.com/palantirnet/the-build/blob/release-2.0/defaults.yml + +projectname: the-build-test + +# These properties are used when building the settings.php and settings.yml for your +# Drupal site, and by some of the targets in the default build.xml file. +# @see .the-build/drupal/services.build.yml +# @see .the-build/drupal/settings.build.php +build: + host: acquia + +drupal: + root: docroot + + twig: + debug: true + + sites: + default: + # REQUIRED: Name of the sites subdirectory where the `settings.php` file + # should live. + dir: default + + # REQUIRED: Your site's URI; the default should be the URI of your local + # development environment. + uri: "localhost" + + # OPTIONAL: Drupal hash salt defaults to "temporary". + hash_salt: "12345" + + # OPTIONAL: The Drupal database name defaults to the site's "dir" value. + database: + database: "drupal" + + # Multisites created by `phing drupal-add-multisite` will be automatically added here. + # @multisite_placeholder@ + + # Defaults for all sites; these can be overridden for individual sites. + _defaults: + database: + username: "test" + password: "test" + host: "localhost" + +# Putting these flags in configuration allows you to vary the behat configuration per +# environment. Sometimes, there are tests that are appropriate to skip on CI. Compare +# these values to the defaults in build.circleci.yml. +behat: + args: "--suite=default --strict" + +# To build an artifact from your code, add the URL to your artifact git repository. +# @see https://github.com/palantirnet/the-build/blob/release-2.0/defaults.yml +# +# artifact: +# git: +# remote: diff --git a/build.xml b/build.xml new file mode 100644 index 00000000..6fd11e66 --- /dev/null +++ b/build.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + the-build test passed + + + --Expected-- + [${expected}] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + set-site test passed + + + + Checking ${prop_name} + + + + ${prop_name} test failed + --Expected-- + ${expected} + --Actual-- + ${actual} + + + + + + \ No newline at end of file diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 00000000..cfdfae2a --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Setup tests that read output before testing. +test='the-build' +vendor/bin/phing -logfile "tests/$test.txt" $test +vendor/bin/phing run-tests diff --git a/tests/.gitkeep b/tests/.gitkeep new file mode 100644 index 00000000..e69de29b