Skip to content

Commit 62818ea

Browse files
committed
CI/CD Fix
1 parent 6a4f12b commit 62818ea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

p2p/test/transport/transport_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"sync/atomic"
2222
"testing"
2323
"time"
24+
"os"
2425

2526
libp2ptls "github.com/libp2p/go-libp2p/p2p/security/tls"
2627

@@ -116,6 +117,19 @@ func selfSignedTLSConfig(t *testing.T) *tls.Config {
116117
return tlsConfig
117118
}
118119

120+
func isWebRTCIPv6Supported() bool {
121+
if os.Getenv("CI") != "" || os.Getenv("GITHUB_ACTIONS") != "" {
122+
return false
123+
}
124+
125+
conn, err := net.Dial("tcp6", "[::1]:0")
126+
if err != nil {
127+
return false
128+
}
129+
conn.Close()
130+
return true
131+
}
132+
119133
var transportsToTest = []TransportTestCase{
120134
{
121135
Name: "TCP / Noise / Yamux",
@@ -577,6 +591,9 @@ var transportsToTest = []TransportTestCase{
577591
{
578592
Name: "WebRTC (IPv6)",
579593
HostGenerator: func(t *testing.T, opts TransportTestCaseOpts) host.Host {
594+
if !isWebRTCIPv6Supported() {
595+
t.Skip("WebRTC IPv6 not supported in this environment")
596+
}
580597
libp2pOpts := transformOpts(opts)
581598
libp2pOpts = append(libp2pOpts, libp2p.Transport(libp2pwebrtc.New))
582599
if opts.NoListen {

0 commit comments

Comments
 (0)