Merge branch 'main' into feature/97_fork-the-netsmtp-package-from-stdlib-into-go-mail

This commit is contained in:
Winni Neessen 2023-01-12 01:31:36 +01:00
commit f782f3f4fc
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D
3 changed files with 29 additions and 22 deletions

View file

@ -1,28 +1,28 @@
# SPDX-FileCopyrightText: 2022 Winni Neessen <winni@neessen.dev> # SPDX-FileCopyrightText: 2022 Winni Neessen <winni@neessen.dev>
# #
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: MIT
container: freebsd_task:
image: golang:latest name: FreeBSD
matrix:
- name: FreeBSD 13.1
freebsd_instance:
image_family: freebsd-13-1
- name: FreeBSD 12.4
freebsd_instance:
image_family: freebsd-12-4
- name: FreeBSD 12.3
freebsd_instance:
image_family: freebsd-12-3
env: env:
GOPROXY: https://proxy.golang.org TEST_ALLOW_SEND: 0
TEST_SKIP_SENDMAIL: 1
lint_task: pkginstall_script:
name: GolangCI Lint - pkg update -f
container: - pkg install -y go
image: golangci/golangci-lint:latest
run_script: golangci-lint run -v --timeout 5m0s --out-format json > lint-report.json
always:
golangci_artifacts:
path: lint-report.json
type: text/json
format: golangci
build_task: test_script:
modules_cache: - go test -v -race -cover -shuffle=on ./...
fingerprint_script: cat go.sum
folder: $GOPATH/pkg/mod
get_script: go get github.com/wneessen/go-mail
build_script: go build github.com/wneessen/go-mail
test_script: go test -race -v -cover github.com/wneessen/go-mail/...

View file

@ -1087,6 +1087,7 @@ func getTestConnection(auth bool) (*Client, error) {
if th == "" { if th == "" {
return nil, fmt.Errorf("no TEST_HOST set") return nil, fmt.Errorf("no TEST_HOST set")
} }
fmt.Printf("XXX: TEST_HOST: %s\n", th)
tp := 25 tp := 25
if tps := os.Getenv("TEST_PORT"); tps != "" { if tps := os.Getenv("TEST_PORT"); tps != "" {
tpi, err := strconv.Atoi(tps) tpi, err := strconv.Atoi(tps)

View file

@ -16,6 +16,9 @@ import (
// TestMsg_WriteToSendmailWithContext tests the WriteToSendmailWithContext() method of the Msg // TestMsg_WriteToSendmailWithContext tests the WriteToSendmailWithContext() method of the Msg
func TestMsg_WriteToSendmailWithContext(t *testing.T) { func TestMsg_WriteToSendmailWithContext(t *testing.T) {
if os.Getenv("TEST_SKIP_SENDMAIL") != "" {
t.Skipf("TEST_SKIP_SENDMAIL variable is set. Skipping sendmail test")
}
tests := []struct { tests := []struct {
name string name string
sp string sp string
@ -42,6 +45,9 @@ func TestMsg_WriteToSendmailWithContext(t *testing.T) {
// TestMsg_WriteToSendmail will test the output to the local sendmail command // TestMsg_WriteToSendmail will test the output to the local sendmail command
func TestMsg_WriteToSendmail(t *testing.T) { func TestMsg_WriteToSendmail(t *testing.T) {
if os.Getenv("TEST_SKIP_SENDMAIL") != "" {
t.Skipf("TEST_SKIP_SENDMAIL variable is set. Skipping sendmail test")
}
_, err := os.Stat(SendmailPath) _, err := os.Stat(SendmailPath)
if err != nil { if err != nil {
t.Skipf("local sendmail command not found in expected path. Skipping") t.Skipf("local sendmail command not found in expected path. Skipping")