Skip to content

Commit

Permalink
Rename chroncile files to chronicle push (#6213)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdmanv authored and Ilya Kislenko committed Aug 2, 2019
1 parent a3a87e0 commit cc0cc78
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
File renamed without changes.
39 changes: 39 additions & 0 deletions pkg/chronicle/chronicle_push_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package chronicle

import (
"context"
"path/filepath"

. "gopkg.in/check.v1"
"k8s.io/apimachinery/pkg/util/rand"

crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1"
"github.com/kanisterio/kanister/pkg/objectstore"
"github.com/kanisterio/kanister/pkg/testutil"
)

type ChroniclePushSuite struct{}

var _ = Suite(&ChroniclePushSuite{})

func (s *ChroniclePushSuite) TestPush(c *C) {
osType := objectstore.ProviderTypeS3
loc := crv1alpha1.Location{
Type: crv1alpha1.LocationTypeS3Compliant,
Region: testutil.TestS3Region,
Bucket: testutil.TestS3BucketName,
}
prof := *testutil.ObjectStoreProfileOrSkip(c, osType, loc)
pp := filepath.Join(c.MkDir(), "profile.json")
err := writeProfile(pp, prof)
c.Assert(err, IsNil)

p := PushParams{
ProfilePath: pp,
ArtifactPath: rand.String(10),
Command: []string{"echo hello"},
}
ctx := context.Background()
err = push(ctx, p, 0)
c.Assert(err, IsNil)
}
33 changes: 0 additions & 33 deletions pkg/chronicle/chronicle_test.go
Original file line number Diff line number Diff line change
@@ -1,43 +1,10 @@
package chronicle

import (
"context"
"path/filepath"
"testing"

. "gopkg.in/check.v1"
"k8s.io/apimachinery/pkg/util/rand"

crv1alpha1 "github.com/kanisterio/kanister/pkg/apis/cr/v1alpha1"
"github.com/kanisterio/kanister/pkg/objectstore"
"github.com/kanisterio/kanister/pkg/testutil"
)

// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { TestingT(t) }

type ChronicleSuite struct{}

var _ = Suite(&ChronicleSuite{})

func (s *ChronicleSuite) TestPush(c *C) {
osType := objectstore.ProviderTypeS3
loc := crv1alpha1.Location{
Type: crv1alpha1.LocationTypeS3Compliant,
Region: testutil.TestS3Region,
Bucket: testutil.TestS3BucketName,
}
prof := *testutil.ObjectStoreProfileOrSkip(c, osType, loc)
pp := filepath.Join(c.MkDir(), "profile.json")
err := writeProfile(pp, prof)
c.Assert(err, IsNil)

p := PushParams{
ProfilePath: pp,
ArtifactPath: rand.String(10),
Command: []string{"echo hello"},
}
ctx := context.Background()
err = push(ctx, p, 0)
c.Assert(err, IsNil)
}

0 comments on commit cc0cc78

Please sign in to comment.