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 Jun 7, 2017
1 parent 386350e commit fb82376
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ php:
env:
global:
- NODE_VERSION=6
- XDMOD_TEST_ARTIFACTS_MIRROR="$HOME/xdmod-test-artifacts.git"
matrix:
- TEST_SUITE=syntax
- TEST_SUITE=style
Expand All @@ -25,6 +26,7 @@ cache:
- $HOME/.npm
- $HOME/.composer/cache
- /tmp/pear/cache
- $XDMOD_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/artifacts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/xdmod-test-artifacts
37 changes: 37 additions & 0 deletions open_xdmod/modules/xdmod/tests/artifacts/update-artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

xdmod_test_artifacts_source="https:/ubccr/xdmod-test-artifacts.git"
using_xdmod_test_artifacts_mirror="false"; [ -n "$XDMOD_TEST_ARTIFACTS_MIRROR" ] && using_xdmod_test_artifacts_mirror="true"

# Change directory to this script's directory.
cd "$(dirname $0)" || exit 1

# If using a mirror of the xdmod-test-artifacts repo, create or update it.
#
# Travis will create any directories that are set up for caching if they do
# not exist, so also check if the directory has contents.
if "$using_xdmod_test_artifacts_mirror"; then
if [ -d "$XDMOD_TEST_ARTIFACTS_MIRROR" ] && [ -n "$(ls -A "$XDMOD_TEST_ARTIFACTS_MIRROR")" ]; then
echo "Updating xdmod-test-artifacts mirror..."
git -C "$XDMOD_TEST_ARTIFACTS_MIRROR" remote update
else
echo "Creating mirror of xdmod-test-artifacts..."
git clone --mirror "$xdmod_test_artifacts_source" "$XDMOD_TEST_ARTIFACTS_MIRROR"
fi
fi

# If the xdmod-test-artifacts repo already exists locally, update it.
# Otherwise, clone it.
artifacts_dir="./xdmod-test-artifacts"
if [ -d "$artifacts_dir" ]; then
echo "Updating local xdmod-test-artifacts clone..."
git -C "$artifacts_dir" pull
else
echo "Cloning xdmod-test-artifacts into local directory..."
if "$using_xdmod_test_artifacts_mirror"; then
local_clone_source="$XDMOD_TEST_ARTIFACTS_MIRROR"
else
local_clone_source="$xdmod_test_artifacts_source"
fi
git clone "$local_clone_source" "$artifacts_dir"
fi
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 = "./artifacts/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./artifacts/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 = "./artifacts/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./artifacts/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 = "./artifacts/xdmod-test-artifacts/xdmod/etlv2/configuration/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./artifacts/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 @@ -17,8 +17,8 @@

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

public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

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

public function __construct()
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 = "./artifacts/xdmod-test-artifacts/xdmod/etlv2/dbmodel/input";
const TEST_ARTIFACT_OUTPUT_PATH = "./artifacts/xdmod-test-artifacts/xdmod/etlv2/dbmodel/output";
private $logger = null;

public function __construct()
Expand Down
2 changes: 2 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,7 @@ if [ ! -x "$phpunit" ]; then
exit 127
fi

./artifacts/update-artifacts.sh

$phpunit ${PHPUNITARGS} .
exit $?

0 comments on commit fb82376

Please sign in to comment.