#98 Set up FreeBSD tests via CirrusCI

Cirrus seems to kill the sendmail test, let's make it skip-able
This commit is contained in:
Winni Neessen 2023-01-12 01:19:24 +01:00
parent 433980a584
commit 64dde76a58
Signed by: wneessen
GPG key ID: 5F3AF39B820C119D
2 changed files with 7 additions and 0 deletions

View file

@ -18,6 +18,7 @@ freebsd_task:
env: env:
TEST_ALLOW_SEND: 0 TEST_ALLOW_SEND: 0
TEST_SKIP_SENDMAIL: 1
pkginstall_script: pkginstall_script:
- pkg update -f - pkg update -f

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")