From 84b53075a0d14ae299b470baadce2f1ce26e6a4b Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 19 Apr 2022 21:35:42 +0200 Subject: [PATCH] tests: remove runTestJobFile (#1127) This prevented JetBrains GoLand from recognising subtests and treated it all as single big test, VSCode seems to be still broken in that regard Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Casey Lee --- act/runner/job_executor_test.go | 4 +++- act/runner/runner_test.go | 10 +++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/act/runner/job_executor_test.go b/act/runner/job_executor_test.go index c5114548..6ccd72ee 100644 --- a/act/runner/job_executor_test.go +++ b/act/runner/job_executor_test.go @@ -25,7 +25,9 @@ func TestJobExecutor(t *testing.T) { // These tests are sufficient to only check syntax. ctx := common.WithDryrun(context.Background(), true) for _, table := range tables { - runTestJobFile(ctx, t, table) + t.Run(table.workflowPath, func(t *testing.T) { + table.runTest(ctx, t, &Config{}) + }) } } diff --git a/act/runner/runner_test.go b/act/runner/runner_test.go index 52b99cf7..6d668ee4 100644 --- a/act/runner/runner_test.go +++ b/act/runner/runner_test.go @@ -105,12 +105,6 @@ func (j *TestJobFileInfo) runTest(ctx context.Context, t *testing.T, cfg *Config } } -func runTestJobFile(ctx context.Context, t *testing.T, j TestJobFileInfo) { - t.Run(j.workflowPath, func(t *testing.T) { - j.runTest(ctx, t, &Config{}) - }) -} - func TestRunEvent(t *testing.T) { if testing.Short() { t.Skip("skipping integration test") @@ -179,7 +173,9 @@ func TestRunEvent(t *testing.T) { } for _, table := range tables { - runTestJobFile(ctx, t, table) + t.Run(table.workflowPath, func(t *testing.T) { + table.runTest(ctx, t, &Config{}) + }) } }