Skip to content

Commit

Permalink
feat(test): add integration test for jiva upgrades (#100)
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
  • Loading branch information
shubham14bajpai authored Mar 30, 2021
1 parent 78ace22 commit 86e5949
Show file tree
Hide file tree
Showing 19 changed files with 721 additions and 131 deletions.
129 changes: 114 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
- name: Set tag
run: |
BRANCH="${GITHUB_REF##*/}"
Expand All @@ -48,10 +54,28 @@ jobs:
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Set Build Date
id: date
run: |
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/upgrade
quay.io/${{ env.IMAGE_ORG }}/upgrade
tag-latest: false
tag-custom-only: true
tag-custom: |
${{ env.TAG }}
- name: Print Tag info
run: |
echo "BRANCH: ${BRANCH}"
echo "TAG: ${TAG}"
echo "${{ steps.docker_meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -70,12 +94,27 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build & Push Image
env:
IMAGE_ORG: ${{ secrets.IMAGE_ORG}}
run: |
make docker.buildx.upgrade
make buildx.push.upgrade
uses: docker/build-push-action@v2
with:
context: .
file: ./build/upgrade/upgrade.Dockerfile
push: true
platforms: linux/amd64, linux/arm64
tags: |
${{ steps.docker_meta.outputs.tags }}
build-args: |
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/upgrade
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}
migrate:
runs-on: ubuntu-latest
Expand All @@ -84,6 +123,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
- name: Set tag
run: |
BRANCH="${GITHUB_REF##*/}"
Expand All @@ -93,11 +138,29 @@ jobs:
fi
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Set Build Date
id: date
run: |
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/migrate
quay.io/${{ env.IMAGE_ORG }}/migrate
tag-latest: false
tag-custom-only: true
tag-custom: |
${{ env.TAG }}
- name: Print Tag info
run: |
echo "BRANCH: ${BRANCH}"
echo "TAG: ${TAG}"
echo "${{ steps.docker_meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -116,12 +179,27 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Build & Push Image
env:
IMAGE_ORG: ${{ secrets.IMAGE_ORG}}
run: |
make docker.buildx.migrate
make buildx.push.migrate
uses: docker/build-push-action@v2
with:
context: .
file: ./build/migrate/migrate.Dockerfile
push: true
platforms: linux/amd64, linux/arm64
tags: |
${{ steps.docker_meta.outputs.tags }}
build-args: |
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/upgrade
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}
unit-tests:
name: unit tests
Expand Down Expand Up @@ -183,7 +261,7 @@ jobs:
strategy:
fail-fast: true
matrix:
kubernetes: [v1.18.6]
engine: [cstor, jiva]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -192,8 +270,14 @@ jobs:
uses: manusa/actions-setup-minikube@v2.3.0
with:
minikube version: v1.9.2
kubernetes version: ${{ matrix.kubernetes }}
kubernetes version: v1.18.6
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
- name: Set tag
run: |
Expand All @@ -204,6 +288,21 @@ jobs:
fi
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Build image locally
uses: docker/build-push-action@v2
with:
context: .
file: ./build/upgrade/upgrade.Dockerfile
push: false
load: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_ORG }}/upgrade:${{ env.TAG }}
build-args: |
DBUILD_REPO_URL=https://github.com/openebs/upgrade
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}
- name: Running tests
run: ./ci/upgrade/sanity.sh
run: ./ci/upgrade/${{ matrix.engine }}/sanity.sh
49 changes: 40 additions & 9 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ jobs:
version: v0.5.1

- name: Build Image
env:
IMG_RESULT: cache
run: make docker.buildx.upgrade
uses: docker/build-push-action@v2
with:
context: .
file: ./build/upgrade/upgrade.Dockerfile
push: false
platforms: linux/amd64, linux/arm64
tags: |
openebs/upgrade:ci
migrate:
runs-on: ubuntu-latest
Expand All @@ -79,9 +84,14 @@ jobs:
version: v0.5.1

- name: Build Image
env:
IMG_RESULT: cache
run: make docker.buildx.migrate
uses: docker/build-push-action@v2
with:
context: .
file: ./build/migrate/migrate.Dockerfile
push: false
platforms: linux/amd64, linux/arm64
tags: |
openebs/migrate:ci
unit-tests:
name: unit tests
Expand Down Expand Up @@ -140,7 +150,7 @@ jobs:
strategy:
fail-fast: true
matrix:
kubernetes: [v1.18.6]
engine: [cstor, jiva]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -149,8 +159,14 @@ jobs:
uses: manusa/actions-setup-minikube@v2.3.0
with:
minikube version: v1.9.2
kubernetes version: ${{ matrix.kubernetes }}
kubernetes version: v1.18.6
github token: ${{ secrets.GITHUB_TOKEN }}

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
- name: Set tag
run: |
Expand All @@ -159,5 +175,20 @@ jobs:
echo "TAG=${CI_TAG}" >> $GITHUB_ENV
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
- name: Build image locally
uses: docker/build-push-action@v2
with:
context: .
file: ./build/upgrade/upgrade.Dockerfile
push: false
load: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_ORG }}/upgrade:${{ env.TAG }}
build-args: |
DBUILD_REPO_URL=https://github.com/openebs/upgrade
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}
- name: Running tests
run: ./ci/upgrade/sanity.sh
run: ./ci/upgrade/${{ matrix.engine }}/sanity.sh
Loading

0 comments on commit 86e5949

Please sign in to comment.