diff --git a/.cirrus.yml b/.cirrus.yml index ade4ba2..db9523c 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,28 +1,28 @@ # SPDX-FileCopyrightText: 2022 Winni Neessen # -# SPDX-License-Identifier: CC0-1.0 +# SPDX-License-Identifier: MIT -container: - image: golang:latest +freebsd_task: + name: FreeBSD -env: - GOPROXY: https://proxy.golang.org + 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 -lint_task: - name: GolangCI Lint - container: - 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 + env: + TEST_ALLOW_SEND: 0 + TEST_SKIP_SENDMAIL: 1 -build_task: - modules_cache: - 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/... + pkginstall_script: + - pkg update -f + - pkg install -y go + + test_script: + - go test -v -race -cover -shuffle=on ./... \ No newline at end of file diff --git a/client_test.go b/client_test.go index c85a91c..3b71f5e 100644 --- a/client_test.go +++ b/client_test.go @@ -1087,6 +1087,7 @@ func getTestConnection(auth bool) (*Client, error) { if th == "" { return nil, fmt.Errorf("no TEST_HOST set") } + fmt.Printf("XXX: TEST_HOST: %s\n", th) tp := 25 if tps := os.Getenv("TEST_PORT"); tps != "" { tpi, err := strconv.Atoi(tps) diff --git a/msg_nowin_test.go b/msg_nowin_test.go index 9eec2eb..d5dca3d 100644 --- a/msg_nowin_test.go +++ b/msg_nowin_test.go @@ -16,6 +16,9 @@ import ( // TestMsg_WriteToSendmailWithContext tests the WriteToSendmailWithContext() method of the Msg 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 { name string sp string @@ -42,6 +45,9 @@ func TestMsg_WriteToSendmailWithContext(t *testing.T) { // TestMsg_WriteToSendmail will test the output to the local sendmail command 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) if err != nil { t.Skipf("local sendmail command not found in expected path. Skipping")