Commit d82bc56b authored by acouch's avatar acouch

Merge pull request #514 from NuCivic/dev-513-features-test-script

Issue #513: A bash script to check for overridden features or file ch…
parents 399b5a3a 27587c54
......@@ -35,6 +35,7 @@ before_script:
- cd drupal
- drush si dkan --sites-subdir=default --db-url=mysql://root:@127.0.0.1:3306/dkan_travis --account-name=admin --account-pass=admin --site-name="DKAN" install_configure_form.update_status_module='array(FALSE,FALSE)' --yes
- drush cc all --yes
- drush cc drush
- drush --quiet --yes --root=$PWD runserver :8888 > /dev/null 2>&1 &
- sleep 4
......@@ -49,6 +50,7 @@ before_script:
- sleep 5
script:
- bash features-tests.sh $TRAVIS_BUILD_DIR
- bin/behat features/panels.feature
- bin/behat features/groups.feature
- bin/behat features/dataset.feature
......
#!/bin/bash
set -e
echo "FEATURES TEST";
OLD_PATH=`pwd`
echo "Current directory: $OLD_PATH"
cd $1
NEW_PATH=`pwd`
echo "Changing to directory: $NEW_PATH";
# First check if any features are overridden.
if [ -n "$(drush fd | grep Overridden)" ]; then
echo "---> Error: Features are showing as overridden.";
drush fd;
cd $OLD_PATH;
exit 1
fi
# Then reexport all the features and make sure there aren't unexpected changes.
drush fua -y
# Note that this actually checks for ANY changes to files that git is tracking,
# not just features.
if [ -n "$(git status -uno --porcelain)" ]; then
#if ! git status --untracked-files=no --porcelain then
echo "---> Error: Features need to be re-exported, or you have some changes to other files in git. ";
git status;
git diff;
cd $OLD_PATH;
exit 1
fi
# Otherwise we should be good to go.
cd $OLD_PATH;
echo "---> Success: Features are up to date.";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment