Skip to content

Commit

Permalink
Merge pull request #1412 from scwhitehouse/dot-in-project
Browse files Browse the repository at this point in the history
Attempt to deal with rose-stem project name for shared repository
  • Loading branch information
matthewrmshin committed Oct 2, 2014
2 parents 7a64950 + 4cea7b1 commit 9c31e56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions lib/python/rose/stem.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ def _get_project_from_url(self, source_dict):
if kpresult:
project = kpresult.group(1)
break
# Remove anything after a point
project = re.sub(r'\..*', r'', project)
return project

def _ascertain_project(self, item):
Expand Down
20 changes: 10 additions & 10 deletions t/rose-stem/00-run-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ BASEINSTALL=$(mktemp -d --tmpdir=$PWD)
(cd $BASEINSTALL; mkdir -p trunk/rose-stem; svn import -q -m "" $URL)
#Keywords for the foo repository
mkdir -p conf
echo "location{primary}[foo]=$URL" >conf/keyword.cfg
echo "location{primary}[foo.xm]=$URL" >conf/keyword.cfg
export FCM_CONF_PATH=$PWD/conf
cd $TEST_DIR
#-------------------------------------------------------------------------------
#Check out a copy of the repository
WORKINGCOPY=$(mktemp -d --tmpdir=$PWD)
SUITENAME=$(basename $WORKINGCOPY)
fcm checkout -q fcm:foo_tr $WORKINGCOPY
fcm checkout -q fcm:foo.xm_tr $WORKINGCOPY
#-------------------------------------------------------------------------------
#Copy suite into working copy
cp $TEST_SOURCE_DIR/00-run-basic/suite.rc $WORKINGCOPY/rose-stem
Expand All @@ -57,15 +57,15 @@ tests $N_TESTS
TEST_KEY=$TEST_KEY_BASE-basic-check
run_pass "$TEST_KEY" \
rose stem --group=earl_grey --task=milk,sugar --group=spoon,cup,milk \
--source=$WORKINGCOPY --source=fcm:foo_tr@head --no-gcontrol \
--source=$WORKINGCOPY --source=fcm:foo.xm_tr@head --no-gcontrol \
--name $SUITENAME -- --debug
#Test output
OUTPUT=$HOME/cylc-run/$SUITENAME/log/job/1/my_task_1/01/job.out
TEST_KEY=$TEST_KEY_BASE-basic-groups-to-run
file_grep $TEST_KEY "RUN_NAMES=\[earl_grey, milk, sugar, spoon, cup, milk\]" \
$OUTPUT
TEST_KEY=$TEST_KEY_BASE-basic-source
file_grep $TEST_KEY "SOURCE_FOO=$WORKINGCOPY fcm:foo_tr@head" $OUTPUT
file_grep $TEST_KEY "SOURCE_FOO=$WORKINGCOPY fcm:foo.xm_tr@head" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-basic-source-base
file_grep $TEST_KEY "SOURCE_FOO_BASE=$WORKINGCOPY\$" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-basic-source-rev
Expand All @@ -74,16 +74,16 @@ file_grep $TEST_KEY "SOURCE_FOO_REV=\$" $OUTPUT
# Second test, using suite redirection
TEST_KEY=$TEST_KEY_BASE-suite-redirection
run_pass "$TEST_KEY" \
rose stem --group=lapsang -C $WORKINGCOPY/rose-stem --source=fcm:foo_tr@head\
rose stem --group=lapsang -C $WORKINGCOPY/rose-stem --source=fcm:foo.xm_tr@head\
--no-gcontrol --name $SUITENAME -- --debug
#Test output
OUTPUT=$HOME/cylc-run/$SUITENAME/log/job/1/my_task_1/01/job.out
TEST_KEY=$TEST_KEY_BASE-suite-redirection-groups-to-run
file_grep $TEST_KEY "RUN_NAMES=\[lapsang\]" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-suite-redirection-source
file_grep $TEST_KEY "SOURCE_FOO=fcm:foo_tr@head\$" $OUTPUT
file_grep $TEST_KEY "SOURCE_FOO=fcm:foo.xm_tr@head\$" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-suite-redirection-source-base
file_grep $TEST_KEY "SOURCE_FOO_BASE=fcm:foo_tr\$" $OUTPUT
file_grep $TEST_KEY "SOURCE_FOO_BASE=fcm:foo.xm_tr\$" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-suite-redirection-source-rev
file_grep $TEST_KEY "SOURCE_FOO_REV=@1\$" $OUTPUT
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -133,15 +133,15 @@ EOF
TEST_KEY=$TEST_KEY_BASE-check-with-config
run_pass "$TEST_KEY" \
rose stem --group=earl_grey --task=milk,sugar --group=spoon,cup,milk \
--source=$WORKINGCOPY --source=fcm:foo_tr@head --no-gcontrol \
--source=$WORKINGCOPY --source=fcm:foo.xm_tr@head --no-gcontrol \
--name $SUITENAME -- --debug
#Test output
OUTPUT=$HOME/cylc-run/$SUITENAME/log/job/1/my_task_1/01/job.out
TEST_KEY=$TEST_KEY_BASE-check-with-config-groups-to-run
file_grep $TEST_KEY "RUN_NAMES=\[earl_grey, milk, sugar, spoon, cup, milk\]" \
$OUTPUT
TEST_KEY=$TEST_KEY_BASE-check-with-config-source
file_grep $TEST_KEY "SOURCE_FOO=$WORKINGCOPY fcm:foo_tr@head" $OUTPUT
file_grep $TEST_KEY "SOURCE_FOO=$WORKINGCOPY fcm:foo.xm_tr@head" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-check-with-config-source-base
file_grep $TEST_KEY "SOURCE_FOO_BASE=$WORKINGCOPY\$" $OUTPUT
TEST_KEY=$TEST_KEY_BASE-check-with-config-source-rev
Expand Down Expand Up @@ -171,7 +171,7 @@ cp $TEST_SOURCE_DIR/00-run-basic/rose-suite2.conf $WORKINGCOPY/rose-stem/rose-su
TEST_KEY=$TEST_KEY_BASE-incompatible_versions
run_fail "$TEST_KEY" \
rose stem --group=earl_grey --task=milk,sugar --group=spoon,cup,milk \
--source=$WORKINGCOPY --source=fcm:foo_tr@head --no-gcontrol \
--source=$WORKINGCOPY --source=fcm:foo.xm_tr@head --no-gcontrol \
--name $SUITENAME -- --debug
OUTPUT=$TEST_DIR/${TEST_KEY}.err
TEST_KEY=$TEST_KEY_BASE-incompatible-versions-correct_error
Expand Down

0 comments on commit 9c31e56

Please sign in to comment.