Fork net/smpt into go-mail

Fix open TODO in smtp_test.go and fork `testenv.SkipFlaky()` from `internal/testenv` to implement flaky test skipping for FBSD
This commit is contained in:
Winni Neessen 2023-01-11 20:07:03 +01:00
parent 8e807c2569
commit df7bb9b742
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D

View file

@ -18,10 +18,12 @@ import (
"bytes"
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io"
"net"
"net/textproto"
"runtime"
"strings"
"testing"
"time"
@ -1071,12 +1073,9 @@ QUIT
`
func TestTLSClient(t *testing.T) {
/*
TODO: Check if we need this
if runtime.GOOS == "freebsd" || runtime.GOOS == "js" {
testenv.SkipFlaky(t, 19229)
}
*/
if runtime.GOOS == "freebsd" || runtime.GOOS == "js" {
SkipFlaky(t, 19229)
}
ln := newLocalListener(t)
defer func() {
_ = ln.Close()
@ -1280,3 +1279,12 @@ qgkeluku4GjxRlDMBuXk94xOBEinUs+p/hwP1Alll80Tpg==
-----END RSA TESTING KEY-----`))
func testingKey(s string) string { return strings.ReplaceAll(s, "TESTING KEY", "PRIVATE KEY") }
var flaky = flag.Bool("flaky", false, "run known-flaky tests too")
func SkipFlaky(t testing.TB, issue int) {
t.Helper()
if !*flaky {
t.Skipf("skipping known flaky test without the -flaky flag; see golang.org/issue/%d", issue)
}
}