From 14b7165af13c291a370baf088234897bb117d36d Mon Sep 17 00:00:00 2001 From: ProgHaj Date: Fri, 20 Oct 2023 13:52:27 +0200 Subject: [PATCH] Fix failing tests --- internal/callgraph/scheduler.go | 2 +- internal/cmd/root/root_test.go | 4 ++-- internal/file/exclusion_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/callgraph/scheduler.go b/internal/callgraph/scheduler.go index 51408a3b..0d655851 100644 --- a/internal/callgraph/scheduler.go +++ b/internal/callgraph/scheduler.go @@ -40,7 +40,7 @@ func (scheduler *Scheduler) Schedule(jobs []job.IJob, ctx cgexec.IContext) (IGen scheduler.spinnerManager.Start() for _, j := range jobs { - spinner := scheduler.spinnerManager.AddSpinner(callgraph, j.GetDir()) + spinner := scheduler.spinnerManager.AddSpinner(j.GetDir()) scheduler.queue <- queueItem{ job: j, spinner: spinner, diff --git a/internal/cmd/root/root_test.go b/internal/cmd/root/root_test.go index ca4fb6e0..38914922 100644 --- a/internal/cmd/root/root_test.go +++ b/internal/cmd/root/root_test.go @@ -11,7 +11,7 @@ import ( func TestNewRootCmd(t *testing.T) { cmd := NewRootCmd("v0.0.0", wire.GetCliContainer()) commands := cmd.Commands() - nbrOfCommands := 5 + nbrOfCommands := 6 if len(commands) != nbrOfCommands { t.Errorf("failed to assert that there were %d sub commands connected", nbrOfCommands) } @@ -31,7 +31,7 @@ func TestNewRootCmd(t *testing.T) { } } assert.Truef(t, match, "failed to assert that flag was present: "+AccessTokenFlag) - assert.Len(t, viperKeys, 13) + assert.Len(t, viperKeys, 14) } func TestPreRun(t *testing.T) { diff --git a/internal/file/exclusion_test.go b/internal/file/exclusion_test.go index 32321cd7..4ed426b8 100644 --- a/internal/file/exclusion_test.go +++ b/internal/file/exclusion_test.go @@ -114,7 +114,7 @@ func TestExclude(t *testing.T) { { name: "FileExclusionWithDoublestar", exclusions: []string{"**/composer.json"}, - expectedExclusions: []string{"composer.json"}, + expectedExclusions: []string{"composer.json", "composer.json"}, // Two composer.json files in testdata folder }, { name: "DirectoryExclusion", @@ -129,7 +129,7 @@ func TestExclude(t *testing.T) { { name: "ExtensionExclusionWithWildcardAndDoublestar", exclusions: []string{"**/*.mod"}, - expectedExclusions: []string{"go.mod"}, + expectedExclusions: []string{"go.mod", "go.mod"}, // Two go.mod files in testdata folder }, { name: "DirectoryExclusionWithDoublestar",