From 41b7e8564622802fda4e5e6addf0d4b2c745e1ad Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Thu, 15 Jul 2021 10:04:10 +1000 Subject: [PATCH] DCD-1313: Parallelise branch testing, and also check for pipelines config freshness. --- bitbucket-pipelines.yml | 55 +++++++++++++++++++++----------------- bitbucket-pipelines.yml.j2 | 55 +++++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 48 deletions(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 039f2e2..1319e3e 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -344,31 +344,38 @@ pipelines: ###################################################################### '**': - step: - name: Run unit tests - image: python:3.7-alpine3.9 - services: - - docker + name: Check if pipelines config is up-to-date... script: - - apk add --no-cache git - - git submodule update --init --recursive - - pip install -q -r shared-components/tests/requirements.txt - - export PYTHONPATH=./shared-components/tests:$PYTHONPATH - - export DOCKERFILE='Dockerfile' - - export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION' - - export MAC_PRODUCT_KEY='confluence' - - py.test -v tests/ - - py.test -v shared-components/tests/ - - step: - name: Run integration tests - services: - - docker - script: - - apk add --no-cache git docker-compose jq curl - - git submodule update --init --recursive - - export CONFLUENCE_VERSION=`curl -s https://marketplace.atlassian.com/rest/2/products/key/confluence/versions/latest | jq -r .name` - - docker build --build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} -t test-image . - - export IS_RELEASE=false - - /usr/src/app/post_build.sh test-image $IS_RELEASE + - python3 pipelines-generator.py > bitbucket-piplines.yml.expected && diff bitbucket-pipelines.yml bitbucket-piplines.yml.expected + + - parallel: + - step: + name: Run unit tests + image: python:3.7-alpine3.9 + services: + - docker + script: + - apk add --no-cache git + - git submodule update --init --recursive + - pip install -q -r shared-components/tests/requirements.txt + - export PYTHONPATH=./shared-components/tests:$PYTHONPATH + - export DOCKERFILE='Dockerfile' + - export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION' + - export MAC_PRODUCT_KEY='confluence' + - py.test -v tests/ + - py.test -v shared-components/tests/ + + - step: + name: Run integration tests + services: + - docker + script: + - apk add --no-cache git docker-compose jq curl + - git submodule update --init --recursive + - export CONFLUENCE_VERSION=`curl -s https://marketplace.atlassian.com/rest/2/products/key/confluence/versions/latest | jq -r .name` + - docker build --build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} -t test-image . + - export IS_RELEASE=false + - /usr/src/app/post_build.sh test-image $IS_RELEASE custom: ###################################################################### diff --git a/bitbucket-pipelines.yml.j2 b/bitbucket-pipelines.yml.j2 index 5193b43..05db677 100644 --- a/bitbucket-pipelines.yml.j2 +++ b/bitbucket-pipelines.yml.j2 @@ -77,31 +77,38 @@ pipelines: ###################################################################### '**': - step: - name: Run unit tests - image: python:3.7-alpine3.9 - services: - - docker + name: Check if pipelines config is up-to-date... script: - - apk add --no-cache git - - git submodule update --init --recursive - - pip install -q -r shared-components/tests/requirements.txt - - export PYTHONPATH=./shared-components/tests:$PYTHONPATH - - export DOCKERFILE='Dockerfile' - - export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION' - - export MAC_PRODUCT_KEY='confluence' - - py.test -v tests/ - - py.test -v shared-components/tests/ - - step: - name: Run integration tests - services: - - docker - script: - - apk add --no-cache git docker-compose jq curl - - git submodule update --init --recursive - - export CONFLUENCE_VERSION=`curl -s https://marketplace.atlassian.com/rest/2/products/key/confluence/versions/latest | jq -r .name` - - docker build --build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} -t test-image . - - export IS_RELEASE=false - - /usr/src/app/post_build.sh test-image $IS_RELEASE + - python3 pipelines-generator.py > bitbucket-piplines.yml.expected && diff bitbucket-pipelines.yml bitbucket-piplines.yml.expected + + - parallel: + - step: + name: Run unit tests + image: python:3.7-alpine3.9 + services: + - docker + script: + - apk add --no-cache git + - git submodule update --init --recursive + - pip install -q -r shared-components/tests/requirements.txt + - export PYTHONPATH=./shared-components/tests:$PYTHONPATH + - export DOCKERFILE='Dockerfile' + - export DOCKERFILE_VERSION_ARG='CONFLUENCE_VERSION' + - export MAC_PRODUCT_KEY='confluence' + - py.test -v tests/ + - py.test -v shared-components/tests/ + + - step: + name: Run integration tests + services: + - docker + script: + - apk add --no-cache git docker-compose jq curl + - git submodule update --init --recursive + - export CONFLUENCE_VERSION=`curl -s https://marketplace.atlassian.com/rest/2/products/key/confluence/versions/latest | jq -r .name` + - docker build --build-arg CONFLUENCE_VERSION=${CONFLUENCE_VERSION} -t test-image . + - export IS_RELEASE=false + - /usr/src/app/post_build.sh test-image $IS_RELEASE custom: ######################################################################