From 0b6ca07a0e33968227d8ff9c78f7bbe55cc7143d Mon Sep 17 00:00:00 2001 From: rhysd Date: Sat, 2 Mar 2024 12:20:00 +0900 Subject: [PATCH] add workflows in `testdata/err` to test for `Linter.LintFiles` --- linter_test.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/linter_test.go b/linter_test.go index f40af2ea6..17c0faf30 100644 --- a/linter_test.go +++ b/linter_test.go @@ -199,22 +199,31 @@ func TestLinterLintError(t *testing.T) { } } -func TestLinterLintAllExamples(t *testing.T) { +func TestLinterLintAllErrorWorkflowsAtOnce(t *testing.T) { + shellcheck, err := execabs.LookPath("shellcheck") + if err != nil { + t.Skipf("shellcheck is not found: %s", err) + } + + pyflakes, err := execabs.LookPath("pyflakes") + if err != nil { + t.Skipf("pyflakes is not found: %s", err) + } + dir, files, err := testFindAllWorkflowsInDir("examples") if err != nil { panic(err) } + // Root directory must be testdata/examples/ since some workflow assumes it proj := &Project{root: dir} - shellcheck, err := execabs.LookPath("shellcheck") + _, fs, err := testFindAllWorkflowsInDir("err") if err != nil { - t.Skipf("shellcheck is not found: %s", err) + panic(err) } - - pyflakes, err := execabs.LookPath("pyflakes") - if err != nil { - t.Skipf("pyflakes is not found: %s", err) + for _, f := range fs { + files = append(files, f) } o := LinterOptions{