From d25f9ab4146dd77483e632c3a2501e167eb7b309 Mon Sep 17 00:00:00 2001 From: andrea-frittoli Date: Fri, 6 Jun 2014 11:43:15 +0100 Subject: [PATCH] Support for alternate trunk name (not master) Commit 537a2926745a2acbacfa682295f06fa44c42716a introduced support for having trunk named something other than master. The name "master" is still hardcoded in the test-matrix, and in the list of allowed branches. Adding support for an arbitrary features file via DEVSTACK_GATE_FEATURE_MATRIX env variable. The list of allowed branches is now parsed from the feature matrix. Change-Id: Ic07c958e1630f7e62d9ff35b0add40a5d2b1548b --- devstack-vm-gate-wrap.sh | 3 +++ devstack-vm-gate.sh | 2 +- features.yaml | 6 ++++++ test-matrix.py | 6 ++++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index 331cf19b..b6cf3cab 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -121,6 +121,9 @@ fi rm -rf $WORKSPACE/logs mkdir -p $WORKSPACE/logs +# The feature matrix to select devstack-gate components +export DEVSTACK_GATE_FEATURE_MATRIX=${DEVSTACK_GATE_FEATURE_MATRIX:-features.yaml} + # Set to 1 to run the Tempest test suite export DEVSTACK_GATE_TEMPEST=${DEVSTACK_GATE_TEMPEST:-0} diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index 607d0f6c..15fc1d86 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -33,7 +33,7 @@ function setup_localrc() { rm -f localrc fi - MY_ENABLED_SERVICES=`cd $BASE/new/devstack-gate && ./test-matrix.py -b $LOCALRC_BRANCH` + MY_ENABLED_SERVICES=`cd $BASE/new/devstack-gate && ./test-matrix.py -b $LOCALRC_BRANCH -f $DEVSTACK_GATE_FEATURE_MATRIX` # Allow optional injection of ENABLED_SERVICES from the calling context if [ ! -z $ENABLED_SERVICES ] ; then diff --git a/features.yaml b/features.yaml index d4e70141..f635f830 100644 --- a/features.yaml +++ b/features.yaml @@ -33,6 +33,12 @@ config: zeromq: features: [zeromq] +branches: + # The value of ""default" is the name of the "trunk" branch + default: master + # Normalized branch names only here, e.g. stable/icehouse => icehouse + allowed: [master, icehouse, havana] + features: default: base: diff --git a/test-matrix.py b/test-matrix.py index e363c2a6..b7950814 100755 --- a/test-matrix.py +++ b/test-matrix.py @@ -21,7 +21,7 @@ import sys import yaml GRID = None -ALLOWED_BRANCHES = ('havana', 'icehouse', 'master') +ALLOWED_BRANCHES = [] FORMAT = '%(asctime)s %(levelname)s: %(message)s' logging.basicConfig(format=FORMAT) @@ -37,7 +37,7 @@ def normalize_branch(branch): if branch.startswith("feature/"): # Feature branches chase master and should be tested # as if they were the master branch. - branch = 'master' + branch = GRID['branches']['default'] elif branch.startswith("stable/"): branch = branch[len("stable/"):] if branch not in ALLOWED_BRANCHES: @@ -112,8 +112,10 @@ of environmental feature definitions and flags. def main(): global GRID + global ALLOWED_BRANCHES opts = get_opts() GRID = parse_features(opts.features) + ALLOWED_BRANCHES = GRID['branches']['allowed'] branch = normalize_branch(opts.branch) features = calc_features(branch, configs_from_env())