Skip to content

Commit

Permalink
simplify test giturl
Browse files Browse the repository at this point in the history
Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
  • Loading branch information
ramonpetgrave64 committed Jan 19, 2024
1 parent 8afe20b commit 7dda203
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions verifiers/internal/gha/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
refs123 = "@refs/tags/v1.2.3"
githubWorkflows = "/.github/workflows/"
builderGoSlsa3 = githubWorkflows + "builder_go_slsa3.yml"
builderGoSlsa3GitUrl = httpsGithubCom + trustedBuilderRepository + builderGoSlsa3
delegatorGenericSlsa3 = githubWorkflows + "delegator_generic_slsa3.yml"
generatorGenericSlsa3 = githubWorkflows + "generator_generic_slsa3.yml"
)
Expand Down Expand Up @@ -102,7 +103,7 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: "https://token.actions.githubusercontent.com",
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid generic delegator builder without tag",
Expand Down Expand Up @@ -140,7 +141,7 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid main ref for e2e test - match builderID",
Expand All @@ -152,10 +153,10 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
buildOpts: &options.BuilderOpts{
ExpectedID: asStringPointer(httpsGithubCom + trustedBuilderRepository + builderGoSlsa3),
ExpectedID: asStringPointer(builderGoSlsa3GitUrl),
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid main ref for e2e test - mismatch builderID",
Expand All @@ -182,10 +183,10 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
buildOpts: &options.BuilderOpts{
ExpectedID: asStringPointer(httpsGithubCom + trustedBuilderRepository + builderGoSlsa3),
ExpectedID: asStringPointer(builderGoSlsa3GitUrl),
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid workflow identity - mismatch builderID",
Expand Down Expand Up @@ -213,7 +214,7 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
},
err: serrors.ErrorInvalidRef,
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "invalid workflow identity with build",
Expand Down Expand Up @@ -249,7 +250,7 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid workflow identity with fully qualified source - no default",
Expand All @@ -261,9 +262,9 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
buildOpts: &options.BuilderOpts{
ExpectedID: asStringPointer(httpsGithubCom + trustedBuilderRepository + builderGoSlsa3),
ExpectedID: asStringPointer(builderGoSlsa3GitUrl),
},
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid workflow identity with fully qualified source - match builderID",
Expand All @@ -275,10 +276,10 @@ func Test_VerifyBuilderIdentity(t *testing.T) {
Issuer: certOidcIssuer,
},
buildOpts: &options.BuilderOpts{
ExpectedID: asStringPointer(httpsGithubCom + trustedBuilderRepository + builderGoSlsa3),
ExpectedID: asStringPointer(builderGoSlsa3GitUrl),
},
defaults: defaultArtifactTrustedReusableWorkflows,
builderID: httpsGithubCom + trustedBuilderRepository + builderGoSlsa3,
builderID: builderGoSlsa3GitUrl,
},
{
name: "valid workflow identity with fully qualified source - mismatch builderID",
Expand Down

0 comments on commit 7dda203

Please sign in to comment.