Skip to content

[Unit Tests]: SendTicketMessage #2213

[Unit Tests]: SendTicketMessage

[Unit Tests]: SendTicketMessage #2213

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- "*"
jobs:
test-go:
name: Go
runs-on:
- ubuntu-latest
steps:
- name: Enable docker.host.internal for Ubuntu
run: |
pwd && sudo bash -c 'echo "172.17.0.1 host.docker.internal" >> /etc/hosts'
- uses: actions/checkout@v2
# change_sphinx_bot_version
- name: Clone Stack
run: |
git clone --single-branch --branch change_v2_ports https://github.com/stakwork/sphinx-stack.git stackv2;
- name: Run Stack V2
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
GITACTION_ENV=gitactionenv docker compose -f ./stackv2/alts/v2.yml --project-directory ./stackv2 up -d;
sleep 240;
docker ps
docker logs alice.sphinx
docker logs bob.sphinx
docker wait stackv2-v2setup-1
docker logs mixer.sphinx
- name: Starting DB
run: docker compose -f ./docker/testdb-docker-compose.yml -p test_db up -d
- name: Install cover
run: go get golang.org/x/tools/cmd/cover
- name: Run Tests with Race Detector and Generate Coverage (Excluding Mocks)
run: |
PKGS=$(sudo go list ./... | grep -v '/mocks' | tr '\n' ',')
TEST_PKGS=$(sudo go list ./... | grep -v '/mocks')
sudo V2_BOT_URL=http://localhost:3005 V2_BOT_TOKEN=xyzxyzxyz go test -race -coverprofile=coverage.out -coverpkg=$PKGS $TEST_PKGS
- name: Show Coverage Summary
run: |
sudo go tool cover -func=coverage.out
- name: Droping DB with docker compose
run: docker compose -f ./docker/testdb-docker-compose.yml -p test_db down
- name: Stop Stack
working-directory: ./stackv2
run: docker compose down