Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

Commit

Permalink
Defalke TestParse
Browse files Browse the repository at this point in the history
This commit deflakes the TestParse test

Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
  • Loading branch information
puerco committed Jun 11, 2024
1 parent 25f9dc9 commit 2eb4f73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package parser

import (
"reflect"
"sort"
"testing"

"github.com/stacklok/trusty-action/pkg/types"
Expand Down Expand Up @@ -72,6 +73,10 @@ func TestParse(t *testing.T) {

for _, test := range tests {
deps, ecosystem, err := Parse(test.filename, test.content)

sort.Slice(deps, func(i, j int) bool { return deps[i].Name < deps[j].Name })
sort.Slice(test.expected, func(i, j int) bool { return test.expected[i].Name < test.expected[j].Name })

if !reflect.DeepEqual(deps, test.expected) {
t.Errorf("Expected dependencies %v, but got %v", test.expected, deps)
}
Expand Down

0 comments on commit 2eb4f73

Please sign in to comment.