Utilize Ginkgo and replace testing library. #9

Merged
abdulrabbani00 merged 27 commits from feature/7-testing-with-ginko+cicd into develop 2022-04-22 12:28:01 +00:00
2 changed files with 51 additions and 11 deletions
Showing only changes of commit 1888b9c98a - Show all commits

View File

@ -1,6 +1,8 @@
name: Test Application
on: [pull_request]
on:
pull_request:
jobs:
build:
name: Run docker build
@ -11,13 +13,58 @@ jobs:
run: make docker-build
test:
name: Run unit tests
env:
GOPATH: /tmp/go
runs-on: ubuntu-latest
env:
foundry-test-ref: feature/build-stack
ipld-eth-db-ref: main
GOPATH: /tmp/go
steps:
- name: Create GOPATH
run: mkdir -p /tmp/go
- uses: actions/checkout@v2
with:
path: "./ipld-ethcl-indexer"
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tags }}
ref: ${{ env.foundry-test-ref }}
path: "./foundry-test/"
repository: vulcanize/foundry-test
fetch-depth: 0
- uses: actions/checkout@v3
with:
ref: ${{ env.ipld-eth-db-ref }}
repository: vulcanize/ipld-eth-db
path: "./ipld-eth-db/"
fetch-depth: 0
- name: Create config file
run: |
echo vulcanize_ipld_eth_db=$GITHUB_WORKSPACE/ipld-eth-db/ > ./config.sh
echo vulcanize_ipld_ethcl_indexer=$GITHUB_WORKSPACE/ipld-ethcl-indexer >> ./config.sh
cat ./config.sh
- name: Run docker compose
run: |
docker-compose \
-f "$GITHUB_WORKSPACE/foundry-test/docker/local/docker-compose-db.yml" \
-f "$GITHUB_WORKSPACE/foundry-test/docker/latest/docker-compose-lighthouse.yml" \
--env-file ./config.sh \
up -d --build
- uses: actions/setup-go@v3
with:
go-version: ">=1.17.0"
check-latest: true
- name: Install packages
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@latest
which ginkgo
- name: Run the tests using Make
run: |
cd ipld-ethcl-indexer
make test

View File

@ -71,13 +71,6 @@ jobs:
go install github.com/onsi/ginkgo/v2/ginkgo@latest
which ginkgo
- name: Run the tests
run: |
cd ipld-ethcl-indexer
go vet ./...
go fmt ./...
$(which ginkgo) -r
- name: Run the tests using Make
run: |
cd ipld-ethcl-indexer