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 4026936
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions itest/list_exclude_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//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",
"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")

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) {
fmt.Println("Excluding test case", tc.Name)

Check failure on line 693 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)
continue
}

filteredTestCases = append(filteredTestCases, tc)

}

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

Check failure on line 702 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 @@ -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 4026936

Please sign in to comment.