Skip to content

Commit 231a024

Browse files
committed
test(cli): update goldens after rebase and renderer changes
- keep table/yaml goldens - remove JSON goldens (see #6430) - update profile status table outputs to match current renderer
1 parent f6cc27a commit 231a024

6 files changed

Lines changed: 16 additions & 31 deletions

File tree

cmd/cli/app/artifact/artifact_get_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ func TestArtifactGetCommand(t *testing.T) {
8888
}
8989

9090
cli.RunCmdTests(t, tests, ArtifactCmd)
91-
}
91+
}

cmd/cli/app/artifact/testdata/artifact_get.table.golden

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
111 │ image │ owner-1 │ artifact-1 │ org/repo │ public │ 2024-01-02T15:04:05Z
44
PROFILE │ RULE │ RESULT │ DETAILS
55
────────────────────────────┼──────────────────────────────┼─────────┼──────────────────────────────
6-
<<<<<<< HEAD
76
artifact-security-baseline │ Require artifact attestation │ failure │ Alert: artifact attestation
87
│ │ │ alert is active URL:
98
│ │ │ https://example.com/alerts/a
@@ -16,7 +15,3 @@
1615
│ │ │ disabled for this image
1716
│ │ │ Guidance: enable artifact
1817
│ │ │ attestations before release
19-
=======
20-
artifact-security-baseline │ Require artifact attestation │ failure │ - artifact attestation is
21-
│ │ │ disabled for this image
22-
>>>>>>> 25edf5238 (feat(cli): add artifact get command tests and align with GetCLIClient pattern)

cmd/cli/app/artifact/testdata/artifact_get.yaml.golden

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,21 @@ artifact:
77
type: image
88
visibility: public
99

10-
<<<<<<< HEAD
1110
- alert:
1211
details: artifact attestation alert is active
1312
status: "on"
1413
url: https://example.com/alerts/artifact-111
1514
details: artifact attestation is disabled for this image
16-
=======
17-
- details: artifact attestation is disabled for this image
18-
>>>>>>> 25edf5238 (feat(cli): add artifact get command tests and align with GetCLIClient pattern)
1915
entity: artifact
2016
entityInfo:
2117
name: owner-1/artifact-1
2218
guidance: enable artifact attestations before release
23-
<<<<<<< HEAD
2419
lastUpdated: "2024-01-01T00:00:00Z"
2520
profileId: artifact-security-baseline
2621
remediationDetails: rebuild the artifact with attestations enabled
2722
remediationUrl: https://example.com/remediate/artifact-111
2823
ruleDescriptionName: Require artifact attestation
2924
ruleId: artifact-attestation-slsa
30-
=======
31-
profileId: artifact-security-baseline
32-
remediationUrl: https://example.com/remediate/artifact-111
33-
ruleDescriptionName: Require artifact attestation
34-
>>>>>>> 25edf5238 (feat(cli): add artifact get command tests and align with GetCLIClient pattern)
3525
ruleTypeName: artifact_attestation_slsa
3626
status: failure
3727

cmd/cli/app/profile/status/testdata/status_list_table_detailed.txt.golden

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
───────────────────────────────┼────────────────┼───────────────────────────────────────────────────
33
mock-profile │ ✅ │ 2024-01-01T00:00:00Z
44

5-
ENTITY │ RULE │ RESULT │ DETAILS
6-
─────────────────────┼────────────────────────────────────────────────────────────────────────────
7-
acme-corp/mock-repo │ Enable secret scanning to detect │ ✅ │ - Mock rule evaluation
8-
[repository] │ hardcoded secrets │ │ succeeded.
9-
├────────────────────────────────────────────────────────────────────────────
10-
│ Enable CodeQL for vulnerability scanning │ ⛔ │ - Mock rule evaluation
11-
│ │ failed.
5+
ENTITY │ RULE │ RESULT │ DETAILS
6+
─────────────────────┼────────────────────────────────────────────────────────────────────────────
7+
acme-corp/mock-repo │ Enable secret scanning to detect │ ✅ │ Details: Mock rule
8+
[repository] │ hardcoded secrets │ │ evaluation succeeded.
9+
├────────────────────────────────────────────────────────────────────────────
10+
│ Enable CodeQL for vulnerability │ ⛔ │ Details: Mock rule
11+
scanning │ │ evaluation failed.

cmd/cli/app/profile/status/testdata/status_list_table_detailed_no_emoji.txt.golden

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
───────────────────────────────┼────────────────┼───────────────────────────────────────────────────
33
mock-profile │ Ok │ 2024-01-01T00:00:00Z
44

5-
ENTITY │ RULE │ RESULT │ DETAILS
6-
─────────────────────┼────────────────────────────────────────────────────────────────────────────
7-
acme-corp/mock-repo │ Enable secret scanning to detect │ Ok │ - Mock rule evaluation
8-
[repository] │ hardcoded secrets │ │ succeeded.
9-
├────────────────────────────────────────────────────────────────────────────
10-
│ Enable CodeQL for vulnerability scanning │ Failed │ - Mock rule evaluation
11-
│ │ failed.
5+
ENTITY │ RULE │ RESULT │ DETAILS
6+
─────────────────────┼────────────────────────────────────────────────────────────────────────────
7+
acme-corp/mock-repo │ Enable secret scanning to detect │ Ok │ Details: Mock rule
8+
[repository] │ hardcoded secrets │ │ evaluation succeeded.
9+
├────────────────────────────────────────────────────────────────────────────
10+
│ Enable CodeQL for vulnerability │ Failed │ Details: Mock rule
11+
scanning │ │ evaluation failed.

internal/util/cli/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ func GetCLIClient[T any](cmd *cobra.Command, client func(grpc.ClientConnInterfac
6363
func HasRPCClient(ctx context.Context) bool {
6464
_, ok := ctx.Value(rpcInjectedKey{}).(struct{})
6565
return ok
66-
}
66+
}

0 commit comments

Comments
 (0)