Skip to content

Commit

Permalink
Use Git to manage xdmod-test-artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
tyearke committed May 17, 2017
1 parent 58b2bb8 commit 02cae49
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 38 deletions.
3 changes: 3 additions & 0 deletions .travis.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ elif [ "$TEST_SUITE" = "style" ]; then
fi
done
elif [ "$TEST_SUITE" = "unit" ]; then
echo "Copying test artifacts from cached mirror..."
git clone "$TEST_ARTIFACTS_MIRROR" "open_xdmod/modules/xdmod/tests/xdmod-test-artifacts"

open_xdmod/modules/xdmod/tests/runtests.sh
if [ $? != 0 ]; then
build_exit_value=2
Expand Down
13 changes: 13 additions & 0 deletions .travis.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,16 @@ source ~/.nvm/nvm.sh
nvm install "$NODE_VERSION"
nvm use "$NODE_VERSION"
npm install

# Create or update a mirror of the XDMoD test artifacts.
#
# Travis will create any directories that are set up for caching if they do
# not exist, so check if the directory has contents instead of checking for
# the existence of the directory.
if [ -n "$(ls -A "$TEST_ARTIFACTS_MIRROR")" ]; then
echo "Updating XDMoD test artifacts mirror..."
git -C "$TEST_ARTIFACTS_MIRROR" remote update
else
echo "Creating mirror of XDMoD test artifacts..."
git clone --mirror "$TEST_ARTIFACTS_SOURCE" "$TEST_ARTIFACTS_MIRROR"
fi
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ php:
env:
global:
- NODE_VERSION=6
- TEST_ARTIFACTS_SOURCE="https:/ubccr/xdmod-test-artifacts.git"
- TEST_ARTIFACTS_MIRROR="$HOME/xdmod-test-artifacts.git"
matrix:
- TEST_SUITE=syntax
- TEST_SUITE=style
Expand All @@ -25,6 +27,7 @@ cache:
- $HOME/.npm
- $HOME/.composer/cache
- /tmp/pear/cache
- $TEST_ARTIFACTS_MIRROR

# Delegate the installation step to the custom Travis installation script
install: ./.travis.install.sh
Expand Down
5 changes: 0 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
},
"require-dev": {
"phpunit/phpunit": "4.8.*",
"ubccr/xdmod-test-artifacts": "@dev",
"squizlabs/php_codesniffer": "2.8.0"
},
"repositories": [
Expand Down Expand Up @@ -369,10 +368,6 @@
"installer-name": "commons-logging"
}
}
},
{
"type": "vcs",
"url": "https:/ubccr/xdmod-test-artifacts.git"
}
],
"extra": {
Expand Down
27 changes: 2 additions & 25 deletions composer.lock

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

1 change: 1 addition & 0 deletions open_xdmod/modules/xdmod/tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/xdmod-test-artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class ConfigurationTest extends \PHPUnit_Framework_TestCase
{
const TEST_ARTIFACT_INPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/output";
const TEST_ARTIFACT_INPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/output";

/**
* Test JSON parse errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

class EtlConfigurationTest extends \PHPUnit_Framework_TestCase
{
const TEST_ARTIFACT_INPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/output";
const TEST_ARTIFACT_INPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/output";
const TMPDIR = '/tmp/xdmod-etl-configuration-test';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

class Rfc6901Test extends \PHPUnit_Framework_TestCase
{
const TEST_ARTIFACT_INPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/configuration/output";
const TEST_ARTIFACT_INPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/configuration/output";

private $config = null;
private $transformer = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

class DbModelTest extends \PHPUnit_Framework_TestCase
{
const TEST_ARTIFACT_INPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/dbmodel/input";
const TEST_ARTIFACT_OUTPUT_PATH = "../../../../vendor/ubccr/xdmod-test-artifacts/xdmod/etlv2/dbmodel/output";
const TEST_ARTIFACT_INPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/dbmodel/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./xdmod-test-artifacts/xdmod/etlv2/dbmodel/output";
private $logger = null;

public function __construct()
Expand Down
7 changes: 7 additions & 0 deletions open_xdmod/modules/xdmod/tests/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ if [ ! -x "$phpunit" ]; then
exit 127
fi

artifacts_dir="./xdmod-test-artifacts"
if [ -d "$artifacts_dir" ]; then
git -C "$artifacts_dir" pull
else
git clone "https:/ubccr/xdmod-test-artifacts.git" "$artifacts_dir"
fi

$phpunit ${PHPUNITARGS} .
exit $?

0 comments on commit 02cae49

Please sign in to comment.