Skip to content

fix: subscription goroutine leaks #284

fix: subscription goroutine leaks

fix: subscription goroutine leaks #284

Workflow file for this run

name: Unit tests
on:
pull_request:
push:
branches:
- master
jobs:
test-go:
name: Run unit and integration tests
runs-on: ubuntu-latest
permissions:
pull-requests: write
# Required: allow read access to the content for analysis.
contents: read
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
checks: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Install dependencies
run: |
go get -t -v ./...
go install ./...
- name: Setup integration test infrastructure
run: |
cd ./example/hasura
docker compose up -d
- name: Run Go unit tests for example/subscription
run: |
cd example/subscription
go get -t -v ./...
go test -v -race -timeout 3m ./...
- name: Run Go unit tests
run: go test -v -race -timeout 3m -coverprofile=coverage.out ./...
- name: Go coverage format
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }}
run: |
go get github.com/boumenot/gocover-cobertura
go install github.com/boumenot/gocover-cobertura
gocover-cobertura < coverage.out > coverage.xml
- name: Code Coverage Summary Report
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }}
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "60 80"
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && github.repository == 'hasura/go-graphql-client' }}
with:
path: code-coverage-results.md
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2