Skip to content

Commit

Permalink
run unit tests in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Aug 12, 2023
1 parent be192ee commit 930efee
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get ./itest
- name: Run and Process Test State
uses: ./.github/actions/test-lspd
with:
Expand Down Expand Up @@ -148,6 +152,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get ./itest
- name: Run and Process Test State
uses: ./.github/actions/test-lspd
with:
Expand All @@ -158,3 +166,20 @@ jobs:
CLIENT_REF: ${{ env.CLIENT_REF }}
GO_VERSION: ${{ env.GO_VERSION }}
CLN_VERSION: ${{ env.CLN_VERSION }}

run-unit-tests:
runs-on: ubuntu-22.04
name: Run unit tests
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get dependencies
run: |
go get github.com/breez/lspd
go get github.com/breez/lspd/cln_plugin
go get github.com/breez/lspd/itest
- name: Test
run: go test -short `go list ./... | grep -v /itest`

2 changes: 1 addition & 1 deletion cln/cln_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func encodePayloadWithNextHop(payload []byte, channelId uint64, amountToForward
tlvRecords := tlv.MapToRecords(uTlvMap)
s, err = tlv.NewStream(tlvRecords...)
if err != nil {
return nil, fmt.Errorf("tlv.NewStream(%x) error: %v", tlvRecords, err)
return nil, fmt.Errorf("tlv.NewStream(%v) error: %v", tlvRecords, err)
}
var newPayloadBuf bytes.Buffer
err = s.Encode(&newPayloadBuf)
Expand Down
4 changes: 4 additions & 0 deletions itest/lspd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
var defaultTimeout time.Duration = time.Second * 120

func TestLspd(t *testing.T) {
if testing.Short() {
t.Skip()
return
}
testCases := allTestCases
runTests(t, testCases, "LND-lspd", lndLspFunc, lndClientFunc)
runTests(t, testCases, "CLN-lspd", clnLspFunc, clnClientFunc)
Expand Down

0 comments on commit 930efee

Please sign in to comment.