run unit tests in CI

This commit is contained in:
Jesse de Wit
2023-08-12 21:23:16 +02:00
parent b406d8ea53
commit ecd98d0975
3 changed files with 22 additions and 1 deletions

View File

@@ -163,3 +163,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`

View File

@@ -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)

View File

@@ -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-lsp-CLN-client", lndLspFunc, clnClientFunc)
runTests(t, testCases, "LND-lsp-LND-client", legacyOnionLndLspFunc, lndClientFunc)