From 64dde76a58bf3ab5fe64281f9dacd14f06370ede Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Thu, 12 Jan 2023 01:19:24 +0100 Subject: [PATCH] #98 Set up FreeBSD tests via CirrusCI Cirrus seems to kill the sendmail test, let's make it skip-able --- .cirrus.yml | 1 + msg_nowin_test.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index 1438092..4ee1ba7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -18,6 +18,7 @@ freebsd_task: env: TEST_ALLOW_SEND: 0 + TEST_SKIP_SENDMAIL: 1 pkginstall_script: - pkg update -f 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")