Skip to content

Commit

Permalink
WIP add publish test and args to publish fn
Browse files Browse the repository at this point in the history
Signed-off-by: Kit Patella <[email protected]>
  • Loading branch information
mkcp committed Feb 12, 2025
1 parent e540b13 commit f1605c5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/internal/packager2/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ type PublishOpts struct {
SkipSignatureValidation bool
}

func Publish(ctx context.Context, opts PublishOpts) error {
// Takes directory/tar file & OCI Registry

// TODO Dir points to a location on disk and registry is a URL.
func Publish(ctx context.Context, dir string, registry string, opts PublishOpts) error {
return nil
}
35 changes: 35 additions & 0 deletions src/internal/packager2/publish_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package packager2

import (
"context"
"github.com/stretchr/testify/require"
"testing"
)

func TestPublish(t *testing.T) {

tt := []struct {
name string
dir string
opts PublishOpts
}{
{
name: "simple",
dir: "testdata/simple",
opts: PublishOpts{},
},
{
name: "simple",
dir: "testdata/simple",
opts: PublishOpts{},
},
}

for _, tc := range tt {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
err := Publish(context.Background(), tc.opts)

Check failure on line 31 in src/internal/packager2/publish_test.go

View workflow job for this annotation

GitHub Actions / validate-unit

not enough arguments in call to Publish

Check failure on line 31 in src/internal/packager2/publish_test.go

View workflow job for this annotation

GitHub Actions / test-unit

not enough arguments in call to Publish
require.NoError(t, err)
})
}
}

0 comments on commit f1605c5

Please sign in to comment.