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 larger runners #632

Closed
wants to merge 4 commits into from
Closed
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
7 changes: 1 addition & 6 deletions .github/workflows/go-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
test:
runs-on: ubuntu-latest
runs-on: mal-ubuntu-latest-arm-16-core

steps:
- uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/action/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -48,7 +49,6 @@ func TestExtractionMethod(t *testing.T) {
}

func TestExtractionMultiple(t *testing.T) {
t.Parallel()
tests := []struct {
path string
want []string
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/action/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"testing"
)

func TestCleanPath(t *testing.T) {

Check failure on line 10 in pkg/action/scan_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

TestCleanPath's subtests should call t.Parallel (tparallel)
t.Parallel()
// create a temporary directory
tempDir, err := os.MkdirTemp("", "TestCleanPath")
if err != nil {
Expand Down Expand Up @@ -122,6 +123,7 @@
}
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)
}
Expand Down
1 change: 1 addition & 0 deletions pkg/profile/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pkg/programkind/programkind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions pkg/report/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
Loading