summaryrefslogtreecommitdiffstats
path: root/.circleci
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-03-28 17:39:33 +0200
committerDylan William Hardison <dylan@hardison.net>2018-03-28 18:01:48 +0200
commitb14d36c66500ca6d57df8cfe310557204eccc5f2 (patch)
tree37ff02dde07970e0ae4a789d59ecf7f0d8d7a8f7 /.circleci
parentdd25bafd4c4db015e9d98a9a022932840459699e (diff)
downloadbugzilla-b14d36c66500ca6d57df8cfe310557204eccc5f2.tar.gz
bugzilla-b14d36c66500ca6d57df8cfe310557204eccc5f2.tar.xz
no bug - skip tests if the only thing changed is the version
Diffstat (limited to '.circleci')
-rw-r--r--.circleci/config.yml50
1 files changed, 42 insertions, 8 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 5de22d587..e30304b63 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -61,6 +61,7 @@ defaults:
run:
name: default qa setup
command: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
perl -MSys::Hostname -i -pE 's/bmo.test/hostname() . ":$ENV{PORT}"/ges' $BZ_QA_CONF_FILE
perl checksetup.pl --no-database --default-localconfig
@@ -93,6 +94,22 @@ jobs:
echo "tag $tag does not exist"
echo yes > build_info/publish.txt
fi
+ - run:
+ name: check if only version changed
+ command: |
+ if git diff 'HEAD~..HEAD' --name-only | grep -qv '^Bugzilla.pm'; then
+ echo "more files than just Bugzilla.pm changed."
+ exit 0
+ fi
+ if git diff 'HEAD~..HEAD' |grep '^[+-][^+-]' | grep -qv '^[+-]our $VERSION'; then
+ echo "Something other than the version number changed."
+ exit 0
+ fi
+ if [[ "$CIRCLE_BRANCH" == "master" ]]; then
+ echo "Can't cut corners on the master branch"
+ exit 0
+ fi
+ echo yes > build_info/only_version_changed.txt
- persist_to_workspace:
root: /app/build_info
paths: ["*.txt"]
@@ -145,13 +162,19 @@ jobs:
environment: *bmo_env
steps:
- checkout
+ - attach_workspace:
+ at: /app/build_info
- run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
mkdir artifacts
- - run: perl Makefile.PL
+ - run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
+ perl Makefile.PL
- run:
name: run sanity tests
command: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl prove -qf $(circleci tests glob 't/*.t' | circleci tests split) | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -162,12 +185,15 @@ jobs:
docker: *docker_oldtests
steps:
- checkout
+ - attach_workspace:
+ at: /app/build_info
- *default_qa_setup
- run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl load_test_data
- - run:
- command: |
- /app/scripts/entrypoint.pl test_webservices | tee artifacts/$CIRCLE_JOB.txt
+ - run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
+ /app/scripts/entrypoint.pl test_webservices | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -177,12 +203,15 @@ jobs:
docker: *docker_oldtests
steps:
- checkout
+ - attach_workspace:
+ at: /app/build_info
- *default_qa_setup
- run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
/app/scripts/entrypoint.pl load_test_data --legacy
- - run:
- command: |
- /app/scripts/entrypoint.pl test_selenium | tee artifacts/$CIRCLE_JOB.txt
+ - run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
+ /app/scripts/entrypoint.pl test_selenium | tee artifacts/$CIRCLE_JOB.txt
- store_artifacts:
path: /app/artifacts
@@ -203,12 +232,17 @@ jobs:
- image: selenium/standalone-firefox:2.53.1
steps:
- checkout
+ - attach_workspace:
+ at: /app/build_info
- run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
mv /opt/bmo/local /app/local
perl checksetup.pl --no-database
/app/scripts/entrypoint.pl load_test_data
mkdir artifacts
- - run: /app/scripts/entrypoint.pl test_bmo -q -f t/bmo/*.t
+ - run: |
+ [[ -f build_info/only_version_changed.txt ]] && exit 0
+ /app/scripts/entrypoint.pl test_bmo -q -f t/bmo/*.t
workflows:
version: 2