From ac47de37c42b5c38aacf8953739ecf64aa7aefd8 Mon Sep 17 00:00:00 2001 From: egibs <20933572+egibs@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:37:44 -0600 Subject: [PATCH 1/4] Test larger runners Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> --- .github/workflows/go-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-tests.yaml b/.github/workflows/go-tests.yaml index b0015802b..5713a1014 100644 --- a/.github/workflows/go-tests.yaml +++ b/.github/workflows/go-tests.yaml @@ -16,7 +16,7 @@ permissions: jobs: test: - runs-on: ubuntu-latest + runs-on: mal-ubuntu-latest-8-core steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 From 73da344898bca9b330a8d3ed84729e215eb6aa48 Mon Sep 17 00:00:00 2001 From: egibs <20933572+egibs@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:48:30 -0600 Subject: [PATCH 2/4] Test 16-core Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> --- .github/workflows/go-tests.yaml | 2 +- pkg/action/archive_test.go | 3 ++- pkg/action/scan_test.go | 2 ++ pkg/profile/profile_test.go | 1 + pkg/programkind/programkind_test.go | 1 + pkg/report/report_test.go | 2 ++ 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-tests.yaml b/.github/workflows/go-tests.yaml index 5713a1014..bf87652c1 100644 --- a/.github/workflows/go-tests.yaml +++ b/.github/workflows/go-tests.yaml @@ -16,7 +16,7 @@ permissions: jobs: test: - runs-on: mal-ubuntu-latest-8-core + runs-on: mal-ubuntu-latest-16-core steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 diff --git a/pkg/action/archive_test.go b/pkg/action/archive_test.go index f04053eaf..81dc1eab2 100644 --- a/pkg/action/archive_test.go +++ b/pkg/action/archive_test.go @@ -39,6 +39,7 @@ func TestExtractionMethod(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() got := extractionMethod(tt.ext) if (got == nil) != (tt.want == nil) { t.Errorf("extractionMethod() for extension %v did not return expected result", tt.ext) @@ -48,7 +49,6 @@ func TestExtractionMethod(t *testing.T) { } func TestExtractionMultiple(t *testing.T) { - t.Parallel() tests := []struct { path string want []string @@ -317,6 +317,7 @@ func TestGetExt(t *testing.T) { } for _, tt := range tests { t.Run(tt.path, func(t *testing.T) { + t.Parallel() if got := getExt(tt.path); got != tt.want { t.Errorf("Ext() = %v, want %v", got, tt.want) } diff --git a/pkg/action/scan_test.go b/pkg/action/scan_test.go index aaeda3967..8651ca662 100644 --- a/pkg/action/scan_test.go +++ b/pkg/action/scan_test.go @@ -8,6 +8,7 @@ import ( ) func TestCleanPath(t *testing.T) { + t.Parallel() // create a temporary directory tempDir, err := os.MkdirTemp("", "TestCleanPath") if err != nil { @@ -122,6 +123,7 @@ func TestFormatPath(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() if got := formatPath(tt.path); got != tt.want { t.Errorf("FormatPath() = %v, want %v", got, tt.want) } diff --git a/pkg/profile/profile_test.go b/pkg/profile/profile_test.go index 2502512ec..0bb62f9c3 100644 --- a/pkg/profile/profile_test.go +++ b/pkg/profile/profile_test.go @@ -7,6 +7,7 @@ import ( ) func TestProfile(t *testing.T) { + t.Parallel() stop, err := Profile() if err != nil { t.Fatalf("failed to start profiling: %v", err) diff --git a/pkg/programkind/programkind_test.go b/pkg/programkind/programkind_test.go index b732a4ee5..9da3cc772 100644 --- a/pkg/programkind/programkind_test.go +++ b/pkg/programkind/programkind_test.go @@ -26,6 +26,7 @@ func TestFile(t *testing.T) { } for _, tt := range tests { t.Run(tt.in, func(t *testing.T) { + t.Parallel() got, err := File(filepath.Join("testdata/", tt.in)) if err != nil { t.Errorf("File(%s) returned error: %v", tt.in, err) diff --git a/pkg/report/report_test.go b/pkg/report/report_test.go index 2f3bdc997..371dd7d5a 100644 --- a/pkg/report/report_test.go +++ b/pkg/report/report_test.go @@ -41,6 +41,7 @@ func TestLongestUnique(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() if got := longestUnique(tt.raw); !reflect.DeepEqual(got, tt.want) { t.Errorf("longestUnique() = %v, want %v", got, tt.want) } @@ -82,6 +83,7 @@ func TestUpgradeRisk(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() if got := upgradeRisk(context.Background(), tt.currentScore, tt.riskCounts, tt.size); got != tt.want { t.Errorf("upgradeRisk(%d, %v, %v) = %v, want %v", tt.currentScore, tt.riskCounts, tt.size, got, tt.want) } From 037814361b54092611d56e82adce7a07f76c732c Mon Sep 17 00:00:00 2001 From: egibs <20933572+egibs@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:00:07 -0600 Subject: [PATCH 3/4] 64 cores just for fun Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> --- .github/workflows/go-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-tests.yaml b/.github/workflows/go-tests.yaml index bf87652c1..ae1bf70c0 100644 --- a/.github/workflows/go-tests.yaml +++ b/.github/workflows/go-tests.yaml @@ -16,7 +16,7 @@ permissions: jobs: test: - runs-on: mal-ubuntu-latest-16-core + runs-on: mal-ubuntu-latest-64-core steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 From 368085cc2d811e08faa02c34662f27e9d27d910f Mon Sep 17 00:00:00 2001 From: egibs <20933572+egibs@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:12:27 -0600 Subject: [PATCH 4/4] ARM? Signed-off-by: egibs <20933572+egibs@users.noreply.github.com> --- .github/workflows/go-tests.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/go-tests.yaml b/.github/workflows/go-tests.yaml index ae1bf70c0..3aec5e355 100644 --- a/.github/workflows/go-tests.yaml +++ b/.github/workflows/go-tests.yaml @@ -16,7 +16,7 @@ permissions: jobs: test: - runs-on: mal-ubuntu-latest-64-core + runs-on: mal-ubuntu-latest-arm-16-core steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 @@ -35,11 +35,6 @@ jobs: - name: install dependencies run: | - sudo add-apt-repository -n -y "deb http://archive.ubuntu.com/ubuntu/ mantic main restricted universe multiverse" - sudo add-apt-repository -n -y "deb http://archive.ubuntu.com/ubuntu/ mantic-updates main restricted universe multiverse" - sudo add-apt-repository -n -y "deb http://archive.ubuntu.com/ubuntu/ mantic-backports main restricted universe multiverse" - sudo add-apt-repository -n -y "deb http://security.ubuntu.com/ubuntu mantic-security main restricted universe multiverse" - sudo apt update && sudo apt install libyara-dev xz-utils -y - name: Unit tests