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" "bytes"
"crypto/tls" "crypto/tls"
"crypto/x509" "crypto/x509"
"flag"
"fmt" "fmt"
"io" "io"
"net" "net"
"net/textproto" "net/textproto"
"runtime"
"strings" "strings"
"testing" "testing"
"time" "time"
@ -1071,12 +1073,9 @@ QUIT
` `
func TestTLSClient(t *testing.T) { func TestTLSClient(t *testing.T) {
/* if runtime.GOOS == "freebsd" || runtime.GOOS == "js" {
TODO: Check if we need this SkipFlaky(t, 19229)
if runtime.GOOS == "freebsd" || runtime.GOOS == "js" { }
testenv.SkipFlaky(t, 19229)
}
*/
ln := newLocalListener(t) ln := newLocalListener(t)
defer func() { defer func() {
_ = ln.Close() _ = ln.Close()
@ -1280,3 +1279,12 @@ qgkeluku4GjxRlDMBuXk94xOBEinUs+p/hwP1Alll80Tpg==
-----END RSA TESTING KEY-----`)) -----END RSA TESTING KEY-----`))
func testingKey(s string) string { return strings.ReplaceAll(s, "TESTING KEY", "PRIVATE 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)
}
}