Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

itest: add integration tests for integrated and remote modes #294

Merged
merged 9 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ env:
# go needs absolute directories, using the $HOME variable doesn't work here.
DOWNLOAD_CACHE: /home/runner/work/download_cache

# If you change this value, please change it in the following files as well:
# /Dockerfile
# /dev.Dockerfile
GO_VERSION: 1.17.6

jobs:
frontend:
name: frontend tests on ${{ matrix.os }}
Expand Down Expand Up @@ -171,3 +176,56 @@ jobs:

- name: compile rpc for golang
run: make rpc

itest:
name: integration test
runs-on: ubuntu-latest
steps:
- name: set git config
run: |
git config --global core.eol lf
git config --global core.autocrlf false

- name: git checkout
uses: actions/checkout@v2

- name: setup nodejs v${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: download cache
uses: actions/cache@v1
with:
path: /home/runner/work/download_cache
key: lnd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
restore-keys: |
lnd-${{ runner.os }}-download-${{ hashFiles('**/install_protoc.sh') }}
lnd-${{ runner.os }}-download-

- name: get yarn cache dir
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-${{ matrix.node_version }}-
${{ runner.os }}-yarn-

- name: install dependencies
working-directory: ./app
run: yarn

- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'

- name: run check
run: make itest
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,11 @@ litcli-debug
/lightning-terminal-*

# MacOS junk
.DS_Store
.DS_Store

itest/btcd-itest
itest/litd-itest
itest/lnd-itest
itest/itest.test
itest/.logs
itest/*.log
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ RUN apk add --no-cache --update alpine-sdk \

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

# Instead of checking out from git again, we just copy the whole working
# directory of the previous stage that includes the generated static assets.
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ESCPKG := github.com\/lightninglabs\/lightning-terminal
LND_PKG := github.com/lightningnetwork/lnd
LOOP_PKG := github.com/lightninglabs/loop
POOL_PKG := github.com/lightninglabs/pool
BTCD_PKG := github.com/btcsuite/btcd

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

ITEST_TAGS := rpctest itest $(LND_RELEASE_TAGS)
ITEST_LDFLAGS := $(call make_ldflags, $(ITEST_TAGS))

GREEN := "\\033[0;32m"
NC := "\\033[0m"
define print
Expand Down Expand Up @@ -160,6 +164,21 @@ travis-cover: lint unit-cover goveralls

travis-itest: lint

build-itest: app-build
@$(call print, "Building itest btcd and litd.")
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/btcd-itest -ldflags "$(ITEST_LDFLAGS)" $(BTCD_PKG)
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/lnd-itest -ldflags "$(ITEST_LDFLAGS)" $(LND_PKG)/cmd/lnd

itest-only:
@$(call print, "Building itest binary.")
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/litd-itest -ldflags "$(ITEST_LDFLAGS)" $(PKG)/cmd/litd
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(ITEST_TAGS)" -c -o itest/itest.test

@$(call print, "Running integration tests.")
rm -rf itest/*.log itest/.logs*; date
scripts/itest_part.sh $(ITEST_FLAGS)

itest: build-itest itest-only

# =============
# FLAKE HUNTING
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ Lightning Terminal is backwards compatible with `lnd` back to version v0.13.3-be
## Daemon Versions packaged with LiT

| LiT | LND | Loop | Faraday | Pool |
|------------------| ------------ | ----------- | ------------ |--------------|
|------------------|--------------| ----------- | ------------ |--------------|
| **v0.6.3-alpha** | v0.14.2-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.4-alpha |
| **v0.6.2-alpha** | v0.14.1-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.4-alpha |
| **v0.6.1-alpha** | v0.14.1-beta | v0.15.1-beta | v0.2.7-alpha | v0.5.2-alpha |
| **v0.5.3-alpha** | v0.13.3-beta | v0.14.1-beta | v0.2.6-alpha | v0.5.0-alpha |
Expand Down
5 changes: 4 additions & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ RUN cd /go/src/github.com/lightninglabs/lightning-terminal/app \

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

# Instead of checking out from git again, we just copy the whole working
# directory of the previous stage that includes the generated static assets.
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ require (
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcutil v1.0.3-0.20210527170813-e2ba6805a890
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/go-errors/errors v1.0.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0
github.com/improbable-eng/grpc-web v0.12.0
github.com/jessevdk/go-flags v1.4.0
Expand All @@ -13,16 +14,18 @@ require (
github.com/lightninglabs/lndclient v0.14.0-7
github.com/lightninglabs/loop v0.15.1-beta
github.com/lightninglabs/pool v0.5.4-alpha.0.20220114202858-525fe156d240
github.com/lightninglabs/pool/auctioneerrpc v1.0.5
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display
github.com/lightningnetwork/lnd v0.14.1-beta
github.com/lightningnetwork/lnd v0.14.2-beta
github.com/lightningnetwork/lnd/cert v1.1.0
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76
github.com/rs/cors v1.7.0 // indirect
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.20.0
github.com/urfave/cli v1.22.4
go.etcd.io/bbolt v1.3.6
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
google.golang.org/grpc v1.39.0
google.golang.org/protobuf v1.27.1
Expand Down
Loading