From 249831064f84eab63c012109a39883eb07938d97 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 20 Nov 2016 18:30:30 +0000 Subject: [PATCH] courier: Skip test if test/util/exitcode is not found When building the Debian package, the tests are run in such a way that test/util/exitcode is not found, which causes them to fail. This patch is a workaround which skips the test if test/util/exitcode is not found; for now we should consider it temporary, until either the Debian packaging is fixed, or we decide that its environment is reasonably enough to make it permanent. : --- internal/courier/procmail_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/courier/procmail_test.go b/internal/courier/procmail_test.go index a6fc4ea..0668a36 100644 --- a/internal/courier/procmail_test.go +++ b/internal/courier/procmail_test.go @@ -66,6 +66,13 @@ func TestProcmailBadCommandLine(t *testing.T) { // Test that local delivery failures are considered permanent or not // according to the exit code. func TestExitCode(t *testing.T) { + // TODO: This can happen when building under unusual circumstances, such + // as Debian package building. Are they reasonable enough for us to keep + // this? + if _, err := os.Stat("../../test/util/exitcode"); os.IsNotExist(err) { + t.Skipf("util/exitcode not found, running from outside repo?") + } + cases := []struct { cmd string args []string