From a85e89d3fb8e1a3b2e9dda843e18aa819095e56e Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Wed, 20 Apr 2022 20:34:27 +0200 Subject: [PATCH] chore: fold integration test outputs (#1111) To make the test logs more readable, we should fold the output per test into a group. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- pkg/artifacts/server_test.go | 4 ++++ pkg/runner/job_executor_test.go | 4 ++++ pkg/runner/runner_test.go | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/pkg/artifacts/server_test.go b/pkg/artifacts/server_test.go index 81e66d2..9244c8b 100644 --- a/pkg/artifacts/server_test.go +++ b/pkg/artifacts/server_test.go @@ -259,6 +259,8 @@ func TestArtifactFlow(t *testing.T) { func runTestJobFile(ctx context.Context, t *testing.T, tjfi TestJobFileInfo) { t.Run(tjfi.workflowPath, func(t *testing.T) { + fmt.Printf("::group::%s\n", tjfi.workflowPath) + if err := os.RemoveAll(aritfactsPath); err != nil { panic(err) } @@ -292,5 +294,7 @@ func runTestJobFile(ctx context.Context, t *testing.T, tjfi TestJobFileInfo) { } else { assert.Error(t, err, tjfi.errorMessage) } + + fmt.Println("::endgroup::") }) } diff --git a/pkg/runner/job_executor_test.go b/pkg/runner/job_executor_test.go index 6ccd72e..2af7933 100644 --- a/pkg/runner/job_executor_test.go +++ b/pkg/runner/job_executor_test.go @@ -230,6 +230,8 @@ func TestNewJobExecutor(t *testing.T) { for _, tt := range table { t.Run(tt.name, func(t *testing.T) { + fmt.Printf("::group::%s\n", tt.name) + ctx := common.WithJobErrorContainer(context.Background()) jim := &jobInfoMock{} sfm := &stepFactoryMock{} @@ -308,6 +310,8 @@ func TestNewJobExecutor(t *testing.T) { jim.AssertExpectations(t) sfm.AssertExpectations(t) + + fmt.Println("::endgroup::") }) } } diff --git a/pkg/runner/runner_test.go b/pkg/runner/runner_test.go index 6d668ee..bc13d49 100644 --- a/pkg/runner/runner_test.go +++ b/pkg/runner/runner_test.go @@ -70,6 +70,8 @@ type TestJobFileInfo struct { } func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config) { + fmt.Printf("::group::%s\n", j.workflowPath) + log.SetLevel(logLevel) workdir, err := filepath.Abs(j.workdir) @@ -103,6 +105,8 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config } else { assert.Error(t, err, j.errorMessage) } + + fmt.Println("::endgroup::") } func TestRunEvent(t *testing.T) {