Skip to content

Commit fc804cb

Browse files
author
ffranr
authored
Merge pull request #1371 from lightninglabs/chantools-local
make+itest: don't use locally installed chantools
2 parents ab2d70d + e43aa58 commit fc804cb

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ build:
9292
$(GOBUILD) -tags="$(DEV_TAGS)" -o tapcli-debug $(DEV_GCFLAGS) $(DEV_LDFLAGS) $(PKG)/cmd/tapcli
9393

9494
build-itest:
95-
@if ! command -v chantools > /dev/null; then \
95+
@if [ ! -f itest/chantools/chantools ]; then \
9696
$(call print, "Building itest chantools."); \
9797
rm -rf itest/chantools; \
9898
git clone --depth 1 --branch v0.13.5 https://github.com/lightninglabs/chantools.git itest/chantools; \
99-
cd itest/chantools && make install; \
99+
cd itest/chantools && go build ./cmd/chantools; \
100100
else \
101-
$(call print, "Chantools is already installed and available in PATH."); \
101+
$(call print, "Chantools is already installed and available in itest/chantools."); \
102102
fi
103103

104104
@$(call print, "Building itest btcd.")

itest/chantools_harness.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package itest
22

33
import (
44
"bytes"
5+
"fmt"
56
"os"
67
"os/exec"
78
"path/filepath"
@@ -48,8 +49,9 @@ type ChantoolsHarness struct {
4849

4950
// NewChantoolsHarness creates a new instance of the ChantoolsHarness struct.
5051
func NewChantoolsHarness(t *testing.T) ChantoolsHarness {
51-
path, err := exec.LookPath("chantools")
52-
require.NoError(t, err, "chantools is not installed or not in PATH")
52+
wd, err := os.Getwd()
53+
require.NoError(t, err)
54+
path := fmt.Sprintf("%s/chantools/chantools", wd)
5355

5456
t.Logf("Using chantools binary at: %v", path)
5557

0 commit comments

Comments
 (0)