-
Notifications
You must be signed in to change notification settings - Fork 215
[WIP] Fix integration tests for updated pins #14791
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,9 +297,9 @@ func TestApplyActionPinToStep(t *testing.T) { | |
| func TestGetActionPinsSorting(t *testing.T) { | ||
| pins := getActionPins() | ||
|
|
||
| // Verify we got all the pins (43 as of February 2026) | ||
| if len(pins) != 43 { | ||
| t.Errorf("getActionPins() returned %d pins, expected 43", len(pins)) | ||
| // Verify we got all the pins (38 as of February 2026) | ||
| if len(pins) != 38 { | ||
| t.Errorf("getActionPins() returned %d pins, expected 38", len(pins)) | ||
| } | ||
|
|
||
| // Verify they are sorted by version (descending) then by repository name (ascending) | ||
|
|
@@ -339,13 +339,13 @@ func TestGetActionPinByRepo(t *testing.T) { | |
| repo: "actions/checkout", | ||
| expectExists: true, | ||
| expectRepo: "actions/checkout", | ||
| expectVer: "v6", | ||
| expectVer: "v6.0.2", | ||
| }, | ||
| { | ||
| repo: "actions/setup-node", | ||
| expectExists: true, | ||
| expectRepo: "actions/setup-node", | ||
| expectVer: "v6.1.0", | ||
| expectVer: "v6.2.0", | ||
| }, | ||
| { | ||
| repo: "unknown/action", | ||
|
|
@@ -542,14 +542,14 @@ func TestGetActionPinSemverPreference(t *testing.T) { | |
| expectedVersion string | ||
| }{ | ||
| { | ||
| name: "setup-go prefers v6.1.0 over v6", | ||
| name: "setup-go prefers v6.2.0 over v6", | ||
| repo: "actions/setup-go", | ||
| expectedVersion: "v6.1.0", | ||
| expectedVersion: "v6.2.0", | ||
| }, | ||
| { | ||
| name: "setup-node prefers v6.1.0 over v6", | ||
| name: "setup-node prefers v6.2.0 over v6", | ||
| repo: "actions/setup-node", | ||
| expectedVersion: "v6.1.0", | ||
| expectedVersion: "v6.2.0", | ||
| }, | ||
| { | ||
| name: "upload-artifact prefers v6.0.0 over v5 and v4", | ||
|
|
@@ -601,18 +601,18 @@ func TestGetActionPinWithData_SemverPreference(t *testing.T) { | |
| shouldFallback bool // Whether we expect to fall back to highest version | ||
| }{ | ||
| { | ||
| name: "exact match for setup-go v6.1.0", | ||
| name: "exact match for setup-go v6.2.0", | ||
| repo: "actions/setup-go", | ||
| requestedVer: "v6.1.0", | ||
| expectedVer: "v6.1.0", | ||
| requestedVer: "v6.2.0", | ||
| expectedVer: "v6.2.0", | ||
| strictMode: false, | ||
| shouldFallback: false, | ||
| }, | ||
| { | ||
| name: "exact match for setup-go v6 from hardcoded pins", | ||
| name: "exact match for setup-go v6.2.0 from hardcoded pins", | ||
| repo: "actions/setup-go", | ||
| requestedVer: "v6", | ||
| expectedVer: "v6", // Should match exactly v6, not v6.1.0 | ||
| requestedVer: "v6.2.0", | ||
| expectedVer: "v6.2.0", // Should match exactly v6.2.0 | ||
| strictMode: false, | ||
| shouldFallback: false, | ||
| }, | ||
|
Comment on lines
+612
to
618
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestGetActionPinsSortingassertslen(pins) == 38, butgetActionPins()returns one element per JSON entry indata/action_pins.json, which currently contains 23 entries. This will make the test fail; update the expected count to match the JSON (or compute it from the embedded data instead of hardcoding a number).