Skip to content

Commit

Permalink
chore: spilt bdd test runs into multi machines
Browse files Browse the repository at this point in the history
Signed-off-by: Firas Qutishat <firas.qutishat@securekey.com>
  • Loading branch information
fqutishat committed Aug 23, 2022
1 parent cecaf95 commit f0d3a9a
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 23 deletions.
62 changes: 57 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
with:
file: ./coverage.out

bddTest:
name: BDD test
bddTest-cas-local:
name: BDD test cas local
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
Expand All @@ -49,17 +49,69 @@ jobs:

- uses: actions/checkout@v2

- name: Run bdd test
- name: Run bdd test cas local
timeout-minutes: 60
run: |
echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts
echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts
make bdd-test
make bdd-test-cas-local
- uses: actions/upload-artifact@v2
if: always()
with:
name: logs
name: logs-cas-local
path: test/bdd/docker-compose.log

bddTest-cas-ipfs:
name: BDD test cas ipfs
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go

- uses: actions/checkout@v2

- name: Run bdd test cas ipfs
timeout-minutes: 60
run: |
echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts
echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts
make bdd-test-cas-ipfs
- uses: actions/upload-artifact@v2
if: always()
with:
name: logs-cas-ipfs
path: test/bdd/docker-compose.log

bddTest-protocol-versions:
name: BDD test protocol versions
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Setup Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go

- uses: actions/checkout@v2

- name: Run bdd test protocol versions
timeout-minutes: 60
run: |
echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts
echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts
make bdd-test-protocol-versions
- uses: actions/upload-artifact@v2
if: always()
with:
name: logs-protocol-versions
path: test/bdd/docker-compose.log

checks:
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,17 @@ extract-orb-cli-binaries:
@mkdir -p .build/extract;cd .build/dist/bin;tar -zxf orb-cli-linux-amd64.tar.gz;mv orb-cli-linux-amd64 ../../extract/
@mkdir -p .build/extract;cd .build/dist/bin;tar -zxf orb-cli-darwin-amd64.tar.gz;mv orb-cli-darwin-amd64 ../../extract/

.PHONY: bdd-test
bdd-test: generate-test-keys orb-docker orb-test-docker orb-driver-docker build-orb-cli-binaries extract-orb-cli-binaries
@scripts/integration.sh
.PHONY: bdd-test-cas-local
bdd-test-cas-local: generate-test-keys orb-docker orb-test-docker orb-driver-docker build-orb-cli-binaries extract-orb-cli-binaries
@scripts/integration_cas_local.sh

.PHONY: bdd-test-cas-ipfs
bdd-test-cas-ipfs: generate-test-keys orb-docker orb-test-docker orb-driver-docker build-orb-cli-binaries extract-orb-cli-binaries
@scripts/integration_cas_ipfs.sh

.PHONY: bdd-test-protocol versions
bdd-test-protocol-versions: generate-test-keys orb-docker orb-test-docker orb-driver-docker build-orb-cli-binaries extract-orb-cli-binaries
@scripts/integration_protocol_versions.sh

.PHONY: clean
clean:
Expand Down
25 changes: 25 additions & 0 deletions scripts/integration_cas_ipfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
set -e

echo "Running orb integration tests cas typeipfs..."
PWD=`pwd`

export DATABASE_TYPE=mongodb
export DATABASE_URL=mongodb://localhost:27017
export ORB_KMS_ENDPOINT=http://localhost:7878
export CAS_TYPE=ipfs
export COMPOSE_HTTP_TIMEOUT=120
export PGUSER=postgres
export PGPASSWORD=password
export DOCKER_COMPOSE_FILE=docker-compose.yml

cd test/bdd
go test -run all -count=1 -v -cover . -p 1 -timeout=30m -race

cd $PWD

24 changes: 24 additions & 0 deletions scripts/integration_cas_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
set -e

echo "Running orb integration tests cas type local..."
PWD=`pwd`

export DATABASE_TYPE=mongodb
export DATABASE_URL=mongodb://localhost:27017
export ORB_KMS_ENDPOINT=http://localhost:7878
export CAS_TYPE=local
export COMPOSE_HTTP_TIMEOUT=120
export PGUSER=postgres
export PGPASSWORD=password
export DOCKER_COMPOSE_FILE=docker-compose.yml

cd test/bdd
go test -run all,local_cas -count=1 -v -cover . -p 1 -timeout=30m -race

cd $PWD
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,20 @@
#
set -e

echo "Running orb integration tests..."
echo "Running orb integration tests protocol versions..."
PWD=`pwd`

export DATABASE_TYPE=mongodb
export DATABASE_URL=mongodb://localhost:27017
export ORB_KMS_ENDPOINT=http://localhost:7878
export CAS_TYPE=local
export COMPOSE_HTTP_TIMEOUT=120

export PGUSER=postgres
export PGPASSWORD=password

export DOCKER_COMPOSE_FILE=docker-compose.yml

cd test/bdd
go test -run all,local_cas -count=1 -v -cover . -p 1 -timeout=30m -race

export CAS_TYPE=ipfs

go test -run all -count=1 -v -cover . -p 1 -timeout=30m -race

export CAS_TYPE=local

export VERSION_TEST=true
export DOCKER_COMPOSE_FILE=docker-compose-testver.yml
export VERSION_TEST=true

cd test/bdd
go test -tags "testver" -run sidetree_protocol_versions -count=1 -v -cover . -p 1 -timeout=30m -race

cd $PWD
Expand Down

0 comments on commit f0d3a9a

Please sign in to comment.