Skip to content

Commit 31df83f

Browse files
committed
Add fakes for models, update tests
Signed-off-by: Adolfo Garcia Veytia (puerco) <puerco@carabiner.dev>
1 parent 94eec6a commit 31df83f

4 files changed

Lines changed: 763 additions & 1 deletion

File tree

sourcetool/pkg/sourcetool/models/models.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate
12
package models
23

34
import (
@@ -17,13 +18,17 @@ import (
1718
// sourcetool can read VSAs and provenance attestations.
1819
// For now we only have retrieval functions but this may expand to
1920
// store statements as well if we need to.
21+
//
22+
//counterfeiter:generate . AttestationStorageReader
2023
type AttestationStorageReader interface {
2124
GetCommitVsa(context.Context, *Branch, *Commit) (*attestation.Statement, *vpb.VerificationSummary, error)
2225
GetCommitProvenance(context.Context, *Branch, *Commit) (*attestation.Statement, *attest.SourceProvenancePred, error)
2326
}
2427

2528
// VcsBackend abstracts a VCS or VCS hosting system that sourcetool
2629
// can inspect for SLSA controls.
30+
//
31+
//counterfeiter:generate . VcsBackend
2732
type VcsBackend interface {
2833
GetBranchControls(context.Context, *Repository, *Branch) (*slsa.ControlSetStatus, error)
2934
GetBranchControlsAtCommit(context.Context, *Repository, *Branch, *Commit) (*slsa.ControlSetStatus, error)

sourcetool/pkg/sourcetool/models/modelsfakes/fake_attestation_storage_reader.go

Lines changed: 217 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)