Skip to content

Commit 5cf26cb

Browse files
authored
Merge pull request #294 from lightninglabs/itest-harness
itest: add integration tests for integrated and remote modes
2 parents 2ca94d2 + 73f51e3 commit 5cf26cb

19 files changed

+4699
-18
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ env:
1212
# go needs absolute directories, using the $HOME variable doesn't work here.
1313
DOWNLOAD_CACHE: /home/runner/work/download_cache
1414

15+
# If you change this value, please change it in the following files as well:
16+
# /Dockerfile
17+
# /dev.Dockerfile
18+
GO_VERSION: 1.17.6
19+
1520
jobs:
1621
frontend:
1722
name: frontend tests on ${{ matrix.os }}
@@ -171,3 +176,56 @@ jobs:
171176

172177
- name: compile rpc for golang
173178
run: make rpc
179+
180+
itest:
181+
name: integration test
182+
runs-on: ubuntu-latest
183+
steps:
184+
- name: set git config
185+
run: |
186+
git config --global core.eol lf
187+
git config --global core.autocrlf false
188+
189+
- name: git checkout
190+
uses: actions/checkout@v2
191+
192+
- name: setup nodejs v${{ matrix.node_version }}
193+
uses: actions/setup-node@v1
194+
with:
195+
node-version: 12.x
196+
197+
- name: download cache
198+
uses: actions/cache@v1
199+
with:
200+
path: /home/runner/work/download_cache
201+
key: lnd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
202+
restore-keys: |
203+
lnd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
204+
lnd-${{ runner.os }}-download-
205+
206+
- name: get yarn cache dir
207+
id: yarn-cache-dir
208+
run: echo "::set-output name=dir::$(yarn cache dir)"
209+
210+
- name: yarn cache
211+
uses: actions/cache@v2
212+
id: yarn-cache
213+
with:
214+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
215+
key: ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
216+
restore-keys: |
217+
${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
218+
${{ runner.os }}-yarn-${{ matrix.node_version }}-
219+
${{ runner.os }}-yarn-
220+
221+
- name: install dependencies
222+
working-directory: ./app
223+
run: yarn
224+
225+
- name: setup go ${{ env.GO_VERSION }}
226+
uses: actions/setup-go@v2
227+
with:
228+
go-version: '${{ env.GO_VERSION }}'
229+
230+
- name: run check
231+
run: make itest

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,11 @@ litcli-debug
66
/lightning-terminal-*
77

88
# MacOS junk
9-
.DS_Store
9+
.DS_Store
10+
11+
itest/btcd-itest
12+
itest/litd-itest
13+
itest/lnd-itest
14+
itest/itest.test
15+
itest/.logs
16+
itest/*.log

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ RUN apk add --no-cache --update alpine-sdk \
3333

3434
# The first stage is already done and all static assets should now be generated
3535
# in the app/build sub directory.
36-
FROM golang:1.16.0-alpine as golangbuilder
36+
# If you change this value, please also update:
37+
# /dev.Dockerfile
38+
# /.github/workflows/main.yml
39+
FROM golang:1.17.6-alpine as golangbuilder
3740

3841
# Instead of checking out from git again, we just copy the whole working
3942
# directory of the previous stage that includes the generated static assets.

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ESCPKG := github.com\/lightninglabs\/lightning-terminal
33
LND_PKG := github.com/lightningnetwork/lnd
44
LOOP_PKG := github.com/lightninglabs/loop
55
POOL_PKG := github.com/lightninglabs/pool
6+
BTCD_PKG := github.com/btcsuite/btcd
67

78
LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
89
GOVERALLS_PKG := github.com/mattn/goveralls
@@ -68,6 +69,9 @@ LDFLAGS := $(call make_ldflags, $(LND_RELEASE_TAGS))
6869
# and omit the DWARF symbol table (-w). Also we clear the build ID.
6970
RELEASE_LDFLAGS := $(call make_ldflags, $(LND_RELEASE_TAGS), -s -w -buildid=)
7071

72+
ITEST_TAGS := rpctest itest $(LND_RELEASE_TAGS)
73+
ITEST_LDFLAGS := $(call make_ldflags, $(ITEST_TAGS))
74+
7175
GREEN := "\\033[0;32m"
7276
NC := "\\033[0m"
7377
define print
@@ -160,6 +164,21 @@ travis-cover: lint unit-cover goveralls
160164

161165
travis-itest: lint
162166

167+
build-itest: app-build
168+
@$(call print, "Building itest btcd and litd.")
169+
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/btcd-itest -ldflags "$(ITEST_LDFLAGS)" $(BTCD_PKG)
170+
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/lnd-itest -ldflags "$(ITEST_LDFLAGS)" $(LND_PKG)/cmd/lnd
171+
172+
itest-only:
173+
@$(call print, "Building itest binary.")
174+
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/litd-itest -ldflags "$(ITEST_LDFLAGS)" $(PKG)/cmd/litd
175+
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(ITEST_TAGS)" -c -o itest/itest.test
176+
177+
@$(call print, "Running integration tests.")
178+
rm -rf itest/*.log itest/.logs*; date
179+
scripts/itest_part.sh $(ITEST_FLAGS)
180+
181+
itest: build-itest itest-only
163182

164183
# =============
165184
# FLAKE HUNTING

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.13.3-be
8888
## Daemon Versions packaged with LiT
8989

9090
| LiT | LND | Loop | Faraday | Pool |
91-
|------------------| ------------ | ----------- | ------------ |--------------|
91+
|------------------|--------------| ----------- | ------------ |--------------|
92+
| **v0.6.3-alpha** | v0.14.2-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.4-alpha |
9293
| **v0.6.2-alpha** | v0.14.1-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.4-alpha |
9394
| **v0.6.1-alpha** | v0.14.1-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.2-alpha |
9495
| **v0.5.3-alpha** | v0.13.3-beta | v0.14.1-beta | v0.2.6-alpha | v0.5.0-alpha |

dev.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \
1010

1111
# The first stage is already done and all static assets should now be generated
1212
# in the app/build sub directory.
13-
FROM golang:1.16.0-alpine as golangbuilder
13+
# If you change this value, please also update:
14+
# /Dockerfile
15+
# /.github/workflows/main.yml
16+
FROM golang:1.17.6-alpine as golangbuilder
1417

1518
# Instead of checking out from git again, we just copy the whole working
1619
# directory of the previous stage that includes the generated static assets.

go.mod

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ require (
55
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
66
github.com/btcsuite/btcutil v1.0.3-0.20210527170813-e2ba6805a890
77
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
8+
github.com/go-errors/errors v1.0.1
89
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
910
github.com/improbable-eng/grpc-web v0.12.0
1011
github.com/jessevdk/go-flags v1.4.0
@@ -13,16 +14,18 @@ require (
1314
github.com/lightninglabs/lndclient v0.14.0-7
1415
github.com/lightninglabs/loop v0.15.1-beta
1516
github.com/lightninglabs/pool v0.5.4-alpha.0.20220114202858-525fe156d240
17+
github.com/lightninglabs/pool/auctioneerrpc v1.0.5
1618
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display
17-
github.com/lightningnetwork/lnd v0.14.1-beta
19+
github.com/lightningnetwork/lnd v0.14.2-beta
1820
github.com/lightningnetwork/lnd/cert v1.1.0
1921
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
2022
github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76
2123
github.com/rs/cors v1.7.0 // indirect
2224
github.com/stretchr/testify v1.7.0
23-
github.com/urfave/cli v1.20.0
25+
github.com/urfave/cli v1.22.4
2426
go.etcd.io/bbolt v1.3.6
2527
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
28+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
2629
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
2730
google.golang.org/grpc v1.39.0
2831
google.golang.org/protobuf v1.27.1

0 commit comments

Comments
 (0)