Skip to content

Commit

Permalink
add trace logs to ok/err/project lint tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Nov 15, 2024
1 parent 7a4614f commit 8367acc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions linter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestLinterLintOK(t *testing.T) {
config := Config{}
linter.defaultConfig = &config

t.Log("Linting workflow file", f)
errs, err := linter.LintFile(f, proj)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -104,6 +105,9 @@ func testFindAllWorkflowsInDir(subdir string) (string, []string, error) {
}

func checkErrors(t *testing.T, outfile string, errs []*Error) {
t.Helper()
t.Log("Checking errors with", outfile)

expected := []string{}
{
f, err := os.Open(outfile)
Expand Down Expand Up @@ -168,6 +172,7 @@ func TestLinterLintError(t *testing.T) {
base := strings.TrimSuffix(infile, filepath.Ext(infile))
testName := filepath.Base(base)
t.Run(subdir+"/"+testName, func(t *testing.T) {
t.Log("Linting workflow file", infile)
b, err := os.ReadFile(infile)
if err != nil {
panic(err)
Expand Down Expand Up @@ -317,6 +322,8 @@ func TestLinterLintProject(t *testing.T) {
name := info.Name()
t.Run("project/"+name, func(t *testing.T) {
repo := filepath.Join(root, name)
t.Log("Linting project at", repo)

opts := LinterOptions{
WorkingDir: repo,
}
Expand Down

0 comments on commit 8367acc

Please sign in to comment.