From 22cd0edfc90aa6c8ca182de27cbd95c82a768f2a Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Wed, 9 Aug 2023 21:12:50 -0300 Subject: [PATCH] fix: signal and watch tests --- signals_test.go | 6 +----- watch_test.go | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/signals_test.go b/signals_test.go index 479731cf..acfacb51 100644 --- a/signals_test.go +++ b/signals_test.go @@ -156,12 +156,8 @@ func TestSignalSentToProcessGroup(t *testing.T) { err := sut.Wait() - // In case of a subprocess failing, Task always returns exit code 1, not the - // exit code returned by the subprocess. This is understandable, since Task - // supports parallel execution: if two parallel subprocess fail, each with a - // different exit code, which one should Task report? This would be a race. var wantErr *exec.ExitError - const wantExitStatus = 1 // Task always returns exit code 1 in case of error + const wantExitStatus = 201 if errors.As(err, &wantErr) { if wantErr.ExitCode() != wantExitStatus { t.Errorf( diff --git a/watch_test.go b/watch_test.go index e107defc..8eb6b850 100644 --- a/watch_test.go +++ b/watch_test.go @@ -12,6 +12,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/go-task/task/v3" "github.com/go-task/task/v3/internal/filepathext"