From 6435e1c339572efbe04331c01ef250eaf91e9b19 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 7 Nov 2024 23:19:19 +0800 Subject: [PATCH] x - skip tests for windows --- itest/list_exclude_test.go | 14 ++++++++++++++ itest/list_on_test.go | 21 +++++++++++++++++++++ itest/lnd_test.go | 5 +++++ 3 files changed, 40 insertions(+) create mode 100644 itest/list_exclude_test.go diff --git a/itest/list_exclude_test.go b/itest/list_exclude_test.go new file mode 100644 index 0000000000..c87d0a1bf6 --- /dev/null +++ b/itest/list_exclude_test.go @@ -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", +} diff --git a/itest/list_on_test.go b/itest/list_on_test.go index 563b0f56cb..71ecd627ec 100644 --- a/itest/list_on_test.go +++ b/itest/list_on_test.go @@ -3,6 +3,9 @@ package itest import ( + "fmt" + + "github.com/lightningnetwork/lnd/fn" "github.com/lightningnetwork/lnd/lntest" ) @@ -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") + 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") + } } diff --git a/itest/lnd_test.go b/itest/lnd_test.go index a5ef38778f..40138f2b8e 100644 --- a/itest/lnd_test.go +++ b/itest/lnd_test.go @@ -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