Skip to content

Commit

Permalink
Merge branch 'avital-springboard-test' into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
avital committed Apr 24, 2013
2 parents 3ff6df2 + c6c24df commit 37bc849
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 12 deletions.
17 changes: 13 additions & 4 deletions scripts/cli-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
# NOTE: by default this tests the working copy, not the installed
# meteor. To test the installed meteor, pass in --global. To test a
# version of meteor installed in a specific directory, set the
# METEOR_WAREHOUSE_DIR environment variable.
# METEOR_TOOLS_TREE_DIR and METEOR_WAREHOUSE_DIR environment variable.

set -e -x

cd `dirname $0`/..

METEOR="$(pwd)/meteor"
# METEOR_TOOLS_TREE_DIR is set in run-tools-tests.sh in order to test
# running an installed version of Meteor (though notably without
# testing springboarding, which is separately tested by
# tools-springboard-test.sh)
if [ -z "$METEOR_TOOLS_TREE_DIR" ]; then
METEOR="`pwd`/meteor"
else
METEOR="$METEOR_TOOLS_TREE_DIR/bin/meteor"
fi

if [ -z "$NODE" ]; then
NODE="$(pwd)/scripts/node.sh"
Expand Down Expand Up @@ -42,13 +52,12 @@ OUTPUT="$TEST_TMPDIR/output"
trap 'echo "[...]"; tail -25 $OUTPUT; echo FAILED ; rm -rf "$TEST_TMPDIR" >/dev/null 2>&1' EXIT

cd "$TEST_TMPDIR"
set -e -x


## Begin actual tests

if [ -n "$INSTALLED_METEOR" ]; then
if [ -n "$TEST_RELEASE" ]; then
if [ -n "$TEST_RELEASE" ]; then
$METEOR --version | grep $TEST_RELEASE >> $OUTPUT
else
$METEOR --version >> $OUTPUT
Expand Down
26 changes: 18 additions & 8 deletions scripts/run-tools-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,37 @@ make_temp_dir() {
mktemp -d -t $1.XXXXXX
}

## Test the Meteor CLI from an installed tools (tests loading packages
## into the warehouse). Notably
###
### Test the Meteor CLI from an installed tools (tests loading
### packages into the warehouse).
###
TEST_TMPDIR=$(make_temp_dir meteor-installed-cli-tests)
TOOLS_DIR="$TEST_TMPDIR/tools-tree"
TARGET_DIR="$TOOLS_DIR" admin/build-tools-tree.sh
export METEOR_TOOLS_TREE_DIR="$TEST_TMPDIR/tools-tree" # used in cli-test.sh and tools-springboard-test.sh
TARGET_DIR="$METEOR_TOOLS_TREE_DIR" admin/build-tools-tree.sh

# Create a warehouse.
export METEOR_WAREHOUSE_DIR=$(make_temp_dir meteor-installed-cli-tests-warehouse)
# Download a bootstrap tarball into it. (launch-meteor recreates the directory.)
rmdir "$METEOR_WAREHOUSE_DIR"
admin/launch-meteor --version # downloads the bootstrap tarball
export METEOR_DIR="$TOOLS_DIR/bin"

# Test springboarding specifically
./tools-springboard-test.sh
# CLI tests (without springboarding, but with a warehouse)
./cli-test.sh

unset METEOR_TOOLS_TREE_DIR
unset METEOR_WAREHOUSE_DIR
unset METEOR_DIR


## Bundler unit tests
###
### Bundler unit tests
###
./bundler-test.sh

## Test the Meteor CLI from a checkout. We do this last because it is least likely to fail.
###
### Test the Meteor CLI from a checkout. We do this last because it is least likely to fail.
###
./cli-test.sh


Expand Down
15 changes: 15 additions & 0 deletions scripts/tools-springboard-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e -x

if [ -z "$METEOR_TOOLS_TREE_DIR" ]; then
echo "\$METEOR_TOOLS_TREE_DIR must be set"
exit 1
fi

METEOR="$METEOR_TOOLS_TREE_DIR/bin/meteor"

# This release was built from the
# 'release/release-used-to-test-springboarding' tag in GitHub. All it
# does is print this string and exit.
$METEOR --release release/used-to-test-springboarding | grep "THIS IS A FAKE RELEASE ONLY USED TO TEST ENGINE SPRINGBOARDING"

0 comments on commit 37bc849

Please sign in to comment.