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 1777abc commit 6435e1c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
14 changes: 14 additions & 0 deletions itest/list_exclude_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//go:build integration

package itest

var excludedTestsWindows = []string{
"sweep cpfp anchor incoming timeout",
"sweep htlcs",
"lookup htlc resolution",
"async payments benchmark",
"coop close with external delivery",
"multihop htlc aggregation leased",
"multihop htlc aggregation anchor",
"multihop htlc aggregation simple taproot",
}
21 changes: 21 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,22 @@ func init() {
allTestCases = append(allTestCases, multiHopForceCloseTestCases...)
allTestCases = append(allTestCases, watchtowerTestCases...)
allTestCases = append(allTestCases, psbtFundingTestCases...)

if isWindowsOS() {
fmt.Println(len(allTestCases), "test cases")

Check failure on line 687 in itest/list_on_test.go

View workflow job for this annotation

GitHub Actions / lint code

use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
filteredTestCases := make([]*lntest.TestCase, 0, len(allTestCases))

excludedSet := fn.NewSet(excludedTestsWindows...)
for _, tc := range allTestCases {
if excludedSet.Contains(tc.Name) {
continue
}

filteredTestCases = append(filteredTestCases, tc)

}

allTestCases = filteredTestCases
fmt.Println(len(allTestCases), "test cases")

Check failure on line 701 in itest/list_on_test.go

View workflow job for this annotation

GitHub Actions / lint code

use of `fmt.Println` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
}
}
5 changes: 5 additions & 0 deletions itest/lnd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,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 6435e1c

Please sign in to comment.