mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-09 23:42:55 +01:00
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:
parent
8e807c2569
commit
df7bb9b742
1 changed files with 14 additions and 6 deletions
|
@ -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) {
|
||||||
/*
|
|
||||||
TODO: Check if we need this
|
|
||||||
if runtime.GOOS == "freebsd" || runtime.GOOS == "js" {
|
if runtime.GOOS == "freebsd" || runtime.GOOS == "js" {
|
||||||
testenv.SkipFlaky(t, 19229)
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue