Skip to content

Commit

Permalink
x - skip tests for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yyforyongyu committed Nov 8, 2024
1 parent 81821ae commit 770accf
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions itest/list_exclude_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//go:build integration

package itest

var excludedTestsWindows = []string{
"sweep cpfp anchor incoming timeout",
"sweep htlcs",
"listsweeps",
"lookup htlc resolution",
"async payments benchmark",
"coop close with external delivery",
"multihop htlc aggregation leased",
"multihop htlc aggregation anchor",
"multihop htlc aggregation simple taproot",
"channel force closure anchor",
"channel force closure simple taproot",
"query blinded route",
"remote signer",
"coop close with htlcs",
"invoice HTLC modifier basic",
}
22 changes: 22 additions & 0 deletions itest/list_on_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
package itest

import (
"fmt"

"github.com/lightningnetwork/lnd/fn"
"github.com/lightningnetwork/lnd/lntest"
)

Expand Down Expand Up @@ -679,4 +682,23 @@ func init() {
allTestCases = append(allTestCases, multiHopForceCloseTestCases...)
allTestCases = append(allTestCases, watchtowerTestCases...)
allTestCases = append(allTestCases, psbtFundingTestCases...)

if isWindowsOS() {
fmt.Println(len(allTestCases), "test cases")
filteredTestCases := make([]*lntest.TestCase, 0, len(allTestCases))

excludedSet := fn.NewSet(excludedTestsWindows...)
for _, tc := range allTestCases {
if excludedSet.Contains(tc.Name) {
fmt.Println("Excluding test case", tc.Name)
continue
}

filteredTestCases = append(filteredTestCases, tc)

}

allTestCases = filteredTestCases
fmt.Println(len(allTestCases), "test cases")
}
}
5 changes: 5 additions & 0 deletions itest/lnd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ func getLndBinary(t *testing.T) string {
return binary
}

// isWindowsOS returns true if the test is running on a Windows OS.
func isWindowsOS() bool {
return runtime.GOOS == "windows"
}

func init() {
// Before we start any node, we need to make sure that any btcd node
// that is started through the RPC harness uses a unique port as well
Expand Down

0 comments on commit 770accf

Please sign in to comment.