OSDN Git Service

move Phar building to ci/prepare.sh and rename ci/build.sh to ci/test.sh
authorscribu <mail@scribu.net>
Wed, 14 Aug 2013 21:47:58 +0000 (00:47 +0300)
committerscribu <mail@scribu.net>
Wed, 14 Aug 2013 21:52:45 +0000 (00:52 +0300)
.travis.yml
bin/ci/build.sh [deleted file]
bin/ci/prepare.sh
bin/ci/test.sh [new file with mode: 0755]

index 41ebe18..67e8d32 100644 (file)
@@ -18,7 +18,7 @@ matrix:
 
 before_script: ./bin/ci/prepare.sh
 
-script: ./bin/ci/build.sh
+script: ./bin/ci/test.sh
 
 notifications:
   email:
diff --git a/bin/ci/build.sh b/bin/ci/build.sh
deleted file mode 100755 (executable)
index 4c77a2b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-# Run the unit tests
-phpunit
-
-# Create the Phar file
-mkdir -p $WP_CLI_BIN_DIR
-php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet
-mv wp-cli.phar $WP_CLI_BIN_DIR/wp
-chmod +x $WP_CLI_BIN_DIR/wp
-
-# Run the functional tests
-php behat.phar --format progress
index 1b2e572..efb241c 100755 (executable)
@@ -4,15 +4,18 @@
 
 set -ex
 
-# install Behat
-curl http://behat.org/downloads/behat.phar > behat.phar
-
-# install dependencies
 composer install --no-interaction --prefer-source
 
-# set up WP install
+# the Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
+mkdir -p $WP_CLI_BIN_DIR
+php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --quiet
+mv wp-cli.phar $WP_CLI_BIN_DIR/wp
+chmod +x $WP_CLI_BIN_DIR/wp
+
+# Travis CI doesn't come with Behat pre-installed
+curl http://behat.org/downloads/behat.phar > behat.phar
+
 ./bin/wp core download --version=$WP_VERSION --path=/tmp/wp-cli-test-core-download-cache/
 
-# set up database
 mysql -e 'CREATE DATABASE wp_cli_test;' -uroot
 mysql -e 'GRANT ALL PRIVILEGES ON wp_cli_test.* TO "wp_cli_test"@"localhost" IDENTIFIED BY "password1"' -uroot
diff --git a/bin/ci/test.sh b/bin/ci/test.sh
new file mode 100755 (executable)
index 0000000..3a94100
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+set -ex
+
+# Run the unit tests
+phpunit
+
+# Run the functional tests
+php behat.phar --format progress