Skip to content

Commit

Permalink
test: add unit-test.yaml (#15)
Browse files Browse the repository at this point in the history
* test: add unit-test.yaml

* ethclient: ensure the close of canceled context
  • Loading branch information
bendanzhentan authored Oct 18, 2023
1 parent 72b9dcd commit ca5cc98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Unit Test

on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches: [main, develop]

jobs:
unit_test:
name: unit_test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '^1.21.3'
- run: make test
1 change: 1 addition & 0 deletions ethclient/ethclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) {
// Test tx in block interrupted.
ctx, cancel := context.WithCancel(context.Background())
cancel()
<-ctx.Done()
tx, err := ec.TransactionInBlock(ctx, block.Hash(), 0)
if tx != nil {
t.Fatal("transaction should be nil")
Expand Down

0 comments on commit ca5cc98

Please sign in to comment.