mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
multi: add new build tag integration
This commit adds a new build tag `integration` and removes the old tag `rpctest` for clarity. Multiple unnecessary usages of `build !rpctest` is also removed.
This commit is contained in:
parent
d730797880
commit
edba938996
@ -27,6 +27,7 @@ run:
|
||||
- kvdb_etcd
|
||||
- kvdb_postgres
|
||||
- kvdb_sqlite
|
||||
- integration
|
||||
|
||||
linters-settings:
|
||||
govet:
|
||||
|
8
Makefile
8
Makefile
@ -93,19 +93,19 @@ build:
|
||||
|
||||
build-itest:
|
||||
@$(call print, "Building itest btcd and lnd.")
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="rpctest" -o itest/btcd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(BTCD_PKG)
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="integration" -o itest/btcd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(BTCD_PKG)
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="$(ITEST_TAGS)" -o itest/lnd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(PKG)/cmd/lnd
|
||||
|
||||
@$(call print, "Building itest binary for ${backend} backend.")
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o itest/itest.test$(EXEC_SUFFIX)
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(RPC_TAGS) integration $(backend)" -c -o itest/itest.test$(EXEC_SUFFIX)
|
||||
|
||||
build-itest-race:
|
||||
@$(call print, "Building itest btcd and lnd with race detector.")
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="rpctest" -o itest/btcd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(BTCD_PKG)
|
||||
CGO_ENABLED=0 $(GOBUILD) -tags="integration" -o itest/btcd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(BTCD_PKG)
|
||||
CGO_ENABLED=1 $(GOBUILD) -race -tags="$(ITEST_TAGS)" -o itest/lnd-itest$(EXEC_SUFFIX) $(DEV_LDFLAGS) $(PKG)/cmd/lnd
|
||||
|
||||
@$(call print, "Building itest binary for ${backend} backend.")
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)" -c -o itest/itest.test$(EXEC_SUFFIX)
|
||||
CGO_ENABLED=0 $(GOTEST) -v ./itest -tags="$(DEV_TAGS) $(RPC_TAGS) integration $(backend)" -c -o itest/itest.test$(EXEC_SUFFIX)
|
||||
|
||||
install:
|
||||
@$(call print, "Installing lnd and lncli.")
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
//go:build integration
|
||||
|
||||
package aezeed
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package contractcourt
|
||||
|
||||
import (
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package contractcourt
|
||||
|
||||
import (
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package contractcourt
|
||||
|
||||
import (
|
||||
|
@ -1,4 +1,4 @@
|
||||
//go:build rpctest
|
||||
//go:build integration
|
||||
|
||||
package funding
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package funding
|
||||
|
||||
import (
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
//go:build !integration
|
||||
|
||||
package itest
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
//go:build integration
|
||||
|
||||
package itest
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
|
||||
package itest
|
||||
|
||||
import (
|
||||
|
@ -57,7 +57,7 @@ var (
|
||||
func TestLightningNetworkDaemon(t *testing.T) {
|
||||
// If no tests are registered, then we can exit early.
|
||||
if len(allTestCases) == 0 {
|
||||
t.Skip("integration tests not selected with flag 'rpctest'")
|
||||
t.Skip("integration tests not selected with flag 'integration'")
|
||||
}
|
||||
|
||||
// Get the test cases to be run in this tranche.
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package lncfg
|
||||
|
||||
import (
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
//go:build !integration
|
||||
|
||||
package lncfg
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
//go:build integration
|
||||
|
||||
package lncfg
|
||||
|
||||
@ -7,6 +6,8 @@ package lncfg
|
||||
// compatibility of protocol additions, while defaulting to the latest within
|
||||
// lnd, or to enable experimental protocol changes.
|
||||
//
|
||||
// TODO(yy): delete this build flag to unify with `lncfg/protocol.go`.
|
||||
//
|
||||
//nolint:lll
|
||||
type ProtocolOptions struct {
|
||||
// LegacyProtocol is a sub-config that houses all the legacy protocol
|
@ -1,5 +1,4 @@
|
||||
//go:build rpctest || lowscrypt
|
||||
// +build rpctest lowscrypt
|
||||
//go:build integration || lowscrypt
|
||||
|
||||
package btcwallet
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
//go:build !integration
|
||||
|
||||
package lnwallet
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
//go:build integration
|
||||
|
||||
package lnwallet
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package macaroons
|
||||
|
||||
import "github.com/btcsuite/btcwallet/snacl"
|
||||
|
@ -1,15 +1,14 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
//go:build integration
|
||||
|
||||
package macaroons
|
||||
|
||||
import "github.com/btcsuite/btcwallet/waddrmgr"
|
||||
|
||||
var (
|
||||
func init() {
|
||||
// Below are the reduced scrypt parameters that are used when creating
|
||||
// the encryption key for the macaroon database with snacl.NewSecretKey.
|
||||
// We use very low values for our itest/rpctest to speed things up.
|
||||
scryptN = waddrmgr.FastScryptOptions.N
|
||||
scryptR = waddrmgr.FastScryptOptions.R
|
||||
scryptP = waddrmgr.FastScryptOptions.P
|
||||
)
|
||||
}
|
@ -115,4 +115,4 @@ backend = btcd
|
||||
endif
|
||||
|
||||
# Construct the integration test command with the added build flags.
|
||||
ITEST_TAGS := $(DEV_TAGS) $(RPC_TAGS) rpctest $(backend)
|
||||
ITEST_TAGS := $(DEV_TAGS) $(RPC_TAGS) integration $(backend)
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package lnd
|
||||
|
||||
import (
|
||||
|
@ -1,6 +1,3 @@
|
||||
//go:build !rpctest
|
||||
// +build !rpctest
|
||||
|
||||
package sweep
|
||||
|
||||
import (
|
||||
|
@ -1,18 +0,0 @@
|
||||
//go:build rpctest
|
||||
// +build rpctest
|
||||
|
||||
package sweep
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// DefaultBatchWindowDuration specifies duration of the sweep batch
|
||||
// window. The sweep is held back during the batch window to allow more
|
||||
// inputs to be added and thereby lower the fee per input.
|
||||
//
|
||||
// To speed up integration tests waiting for a sweep to happen, the
|
||||
// batch window is shortened.
|
||||
DefaultBatchWindowDuration = 8 * time.Second
|
||||
)
|
Loading…
Reference in New Issue
Block a user