Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: disable parallel testing #1610

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/osv-reporter/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"testing"
)

func Test_splitLastArg(t *testing.T) {

Check failure on line 8 in cmd/osv-reporter/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function Test_splitLastArg missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()

tests := []struct {
name string
Expand All @@ -28,9 +28,9 @@
},
},
}
for _, tt := range tests {

Check failure on line 31 in cmd/osv-reporter/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Range statement for test Test_splitLastArg missing the call to method parallel in test Run (paralleltest)
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
if got := splitLastArg(tt.args); !reflect.DeepEqual(got, tt.want) {
t.Errorf("splitLastArg() = %v, want %v", got, tt.want)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/osv-scanner/fix/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
return parsedContext, err
}

func TestParseUpgradeConfig(t *testing.T) {

Check failure on line 37 in cmd/osv-scanner/fix/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function TestParseUpgradeConfig missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()
flags := []string{"upgrade-config", "disallow-major-upgrades", "disallow-package-upgrades"}

tests := []struct {
Expand Down Expand Up @@ -119,9 +119,9 @@
},
}

for _, tt := range tests {

Check failure on line 122 in cmd/osv-scanner/fix/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Range statement for test TestParseUpgradeConfig missing the call to method parallel in test Run (paralleltest)
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
ctx, err := parseFlags(t, flags, tt.args)
if err != nil {
t.Fatalf("error parsing flags: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions cmd/osv-scanner/fix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
testutility.NewSnapshot().WithCRLFReplacement().MatchText(t, string(b))
}

func TestRun_Fix(t *testing.T) {

Check failure on line 36 in cmd/osv-scanner/fix_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function TestRun_Fix missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()
tests := []struct {
name string
args []string
Expand Down Expand Up @@ -79,9 +79,9 @@
manifest: "./fix/fixtures/override-maven/pom.xml",
},
}
for _, tt := range tests {

Check failure on line 82 in cmd/osv-scanner/fix_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Range statement for test TestRun_Fix missing the call to method parallel in test Run (paralleltest)
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

tc := cliTestCase{
name: tt.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"testing"
)

func TestCreateCallAnalysisStates(t *testing.T) {

Check failure on line 8 in cmd/osv-scanner/internal/helper/callanalysis_parser_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function TestCreateCallAnalysisStates missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()
testCases := []struct {
enabledCallAnalysis []string
disabledCallAnalysis []string
Expand Down
50 changes: 25 additions & 25 deletions cmd/osv-scanner/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
testutility.NewSnapshot().MatchText(t, stderr)
}

func TestRun(t *testing.T) {

Check failure on line 182 in cmd/osv-scanner/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function TestRun missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()

tests := []cliTestCase{
{
Expand Down Expand Up @@ -411,17 +411,17 @@
exit: 1,
},
}
for _, tt := range tests {

Check failure on line 414 in cmd/osv-scanner/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Range statement for test TestRun missing the call to method parallel in test Run (paralleltest)
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testCli(t, tt)
})
}
}

func TestRunCallAnalysis(t *testing.T) {

Check failure on line 423 in cmd/osv-scanner/main_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Function TestRunCallAnalysis missing the call to method parallel (paralleltest)
t.Parallel()
// t.Parallel()

// Switch to acceptance test if this takes too long, or when we add rust tests
// testutility.SkipIfNotAcceptanceTesting(t, "Takes a while to run")
Expand All @@ -438,15 +438,15 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testCli(t, tt)
})
}
}

func TestRun_LockfileWithExplicitParseAs(t *testing.T) {
t.Parallel()
// t.Parallel()

tests := []cliTestCase{
{
Expand Down Expand Up @@ -560,7 +560,7 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

stdout, stderr := runCli(t, tt)

Expand All @@ -574,7 +574,7 @@

// TestRun_GithubActions tests common actions the github actions reusable workflow will run
func TestRun_GithubActions(t *testing.T) {
t.Parallel()
// t.Parallel()

tests := []cliTestCase{
{
Expand All @@ -590,15 +590,15 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testCli(t, tt)
})
}
}

func TestRun_LocalDatabases(t *testing.T) {
t.Parallel()
// t.Parallel()

tests := []cliTestCase{
{
Expand Down Expand Up @@ -665,7 +665,7 @@

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

if testutility.IsAcceptanceTest() {
testDir := testutility.CreateTestDir(t)
Expand All @@ -683,7 +683,7 @@
}

func TestRun_LocalDatabases_AlwaysOffline(t *testing.T) {
t.Parallel()
// t.Parallel()

tests := []cliTestCase{
{
Expand All @@ -695,7 +695,7 @@

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testDir := testutility.CreateTestDir(t)
old := tt.args
Expand All @@ -711,7 +711,7 @@
}

func TestRun_Licenses(t *testing.T) {
t.Parallel()
// t.Parallel()
tests := []cliTestCase{
{
name: "No vulnerabilities with license summary",
Expand Down Expand Up @@ -776,15 +776,15 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testCli(t, tt)
})
}
}

func TestRun_Docker(t *testing.T) {
t.Parallel()
// t.Parallel()

testutility.SkipIfNotAcceptanceTesting(t, "Takes a long time to pull down images")

Expand Down Expand Up @@ -818,7 +818,7 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

// Only test on linux, and mac/windows CI/CD does not come with docker preinstalled
if runtime.GOOS != "linux" {
Expand All @@ -831,7 +831,7 @@
}

func TestRun_OCIImage(t *testing.T) {
t.Parallel()
// t.Parallel()

testutility.SkipIfNotAcceptanceTesting(t, "Not consistent on MacOS/Windows")

Expand Down Expand Up @@ -899,7 +899,7 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

// point out that we need the images to be built and saved separately
for _, arg := range tt.args {
Expand All @@ -917,7 +917,7 @@

// Tests all subcommands here.
func TestRun_SubCommands(t *testing.T) {
t.Parallel()
// t.Parallel()
tests := []cliTestCase{
// without subcommands
{
Expand All @@ -941,15 +941,15 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()

testCli(t, tt)
})
}
}

func TestRun_InsertDefaultCommand(t *testing.T) {
t.Parallel()
// t.Parallel()
commands := []*cli.Command{
{Name: "default"},
{Name: "scan"},
Expand Down Expand Up @@ -1015,7 +1015,7 @@
}

func TestRun_MavenTransitive(t *testing.T) {
t.Parallel()
// t.Parallel()
tests := []cliTestCase{
{
name: "scans transitive dependencies for pom.xml by default",
Expand Down Expand Up @@ -1058,14 +1058,14 @@

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
testCli(t, tt)
})
}
}

func TestRun_MoreLockfiles(t *testing.T) {
t.Parallel()
// t.Parallel()
tests := []cliTestCase{
{
name: "uv.lock",
Expand Down Expand Up @@ -1097,7 +1097,7 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
testCli(t, tt)
})
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/osv-scanner/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestRun_Update(t *testing.T) {
t.Parallel()
// t.Parallel()
tests := []struct {
name string
args []string
Expand All @@ -27,7 +27,7 @@ func TestRun_Update(t *testing.T) {

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
tc := cliTestCase{
name: tt.name,
args: slices.Clone(tt.args),
Expand Down
8 changes: 4 additions & 4 deletions internal/ci/vulnerability_result_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func TestDiffVulnerabilityResults(t *testing.T) {
t.Parallel()
// t.Parallel()
type args struct {
oldRes models.VulnerabilityResults
newRes models.VulnerabilityResults
Expand Down Expand Up @@ -70,15 +70,15 @@ func TestDiffVulnerabilityResults(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
got := ci.DiffVulnerabilityResults(tt.args.oldRes, tt.args.newRes)
testutility.NewSnapshot().MatchJSON(t, got)
})
}
}

func TestDiffVulnerabilityByUniqueVulnCountResults(t *testing.T) {
t.Parallel()
// t.Parallel()
type args struct {
oldRes models.VulnerabilityResults
newRes models.VulnerabilityResults
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestDiffVulnerabilityByUniqueVulnCountResults(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// t.Parallel()
got := ci.DiffVulnerabilityResultsByOccurrences(tt.args.oldRes, tt.args.newRes)
testutility.NewSnapshot().MatchJSON(t, got)
})
Expand Down
Loading
Loading