Skip to content

Commit

Permalink
Merge pull request #890 from lightninglabs/random-improvements
Browse files Browse the repository at this point in the history
Build improvements
  • Loading branch information
guggero authored Nov 7, 2024
2 parents 5aa68f9 + f50fb91 commit cb6977f
Show file tree
Hide file tree
Showing 6 changed files with 270 additions and 92 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:

strategy:
matrix:
node_version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
node_version: [ 16.x ]
os: [ ubuntu-latest, windows-latest, macOS-latest ]

steps:
- name: git checkout
Expand Down Expand Up @@ -63,8 +63,8 @@ jobs:

strategy:
matrix:
go_version: [1.18.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
go_version: [ 1.18.x ]
os: [ ubuntu-latest, windows-latest, macOS-latest ]

steps:
- name: git checkout
Expand All @@ -84,7 +84,7 @@ jobs:

- name: build backend binary
run: make build

- name: build CLI binaries
run: make go-install-cli

Expand Down Expand Up @@ -244,6 +244,19 @@ jobs:
- name: run check
run: make itest

- name: Zip log files on failure
if: ${{ failure() }}
timeout-minutes: 5
run: 7z a logs-itest.zip itest/**/*.log

- name: Upload log files on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: logs-itest
path: logs-itest.zip
retention-days: 5

########################
# check PR updates release notes
########################
Expand All @@ -256,4 +269,4 @@ jobs:
uses: actions/checkout@v3

- name: release notes check
run: scripts/check-release-notes.sh
run: scripts/check-release-notes.sh
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ DOCKER_TOOLS = docker run \
-v $(shell bash -c "mkdir -p /tmp/go-lint-cache; echo /tmp/go-lint-cache"):/root/.cache/golangci-lint \
-v $$(pwd):/build litd-tools

ITEST_TAGS := integration itest $(LND_RELEASE_TAGS)
ITEST_TAGS := dev integration itest lowscrypt $(LND_RELEASE_TAGS)
ITEST_LDFLAGS := $(call make_ldflags, $(ITEST_TAGS))

GREEN := "\\033[0;32m"
Expand Down Expand Up @@ -238,6 +238,10 @@ flake-unit:
@$(call print, "Flake hunting unit tests.")
while [ $$? -eq 0 ]; do GOTRACEBACK=all $(UNIT) -count=1; done

flake-itest-only:
@$(call print, "Flake hunting integration tests.")
while [ $$? -eq 0 ]; do make itest-only icase='${icase}'; done

# =========
# UTILITIES
# =========
Expand Down
21 changes: 12 additions & 9 deletions accounts/checkers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,14 @@ func testSendPayment(t *testing.T, uri string) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -615,7 +616,7 @@ func testSendPayment(t *testing.T, uri string) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -646,7 +647,7 @@ func testSendPayment(t *testing.T, uri string) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down Expand Up @@ -708,13 +709,14 @@ func TestSendPaymentV2(t *testing.T) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -808,7 +810,7 @@ func TestSendPaymentV2(t *testing.T) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -836,7 +838,7 @@ func TestSendPaymentV2(t *testing.T) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down Expand Up @@ -894,13 +896,14 @@ func TestSendToRouteV2(t *testing.T) {
}

lndMock := newMockLnd()
routerMock := newMockRouter()
errFunc := func(err error) {
lndMock.mainErrChan <- err
}
service, err := NewService(t.TempDir(), errFunc)
require.NoError(t, err)

err = service.Start(lndMock, lndMock, chainParams)
err = service.Start(lndMock, routerMock, chainParams)
require.NoError(t, err)

assertBalance := func(id AccountID, expectedBalance int64) {
Expand Down Expand Up @@ -998,7 +1001,7 @@ func TestSendToRouteV2(t *testing.T) {
require.NoError(t, err)
assertBalance(acct.ID, 4000)

lndMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
routerMock.assertPaymentRequests(t, map[lntypes.Hash]struct{}{
testHash: {},
})

Expand Down Expand Up @@ -1028,7 +1031,7 @@ func TestSendToRouteV2(t *testing.T) {
// was initiated.
assertBalance(acct.ID, 4000)

lndMock.assertNoPaymentRequest(t)
routerMock.assertNoPaymentRequest(t)

// The final test we will do is to have two send requests initiated
// before the response for the first one has been received.
Expand Down
Loading

0 comments on commit cb6977f

Please sign in to comment.