mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
test: improve s3 tests
This commit is contained in:
parent
8690ee07e5
commit
5e6301254f
@ -74,7 +74,7 @@ func upload(ctx *context.Context, conf config.S3) error {
|
||||
svc := s3.New(sess, &aws.Config{
|
||||
Region: aws.String(conf.Region),
|
||||
})
|
||||
folder, err := nametemplate.Apply(ctx, "s3", conf.Folder)
|
||||
folder, err := nametemplate.Apply(ctx, conf.Folder)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -78,12 +78,20 @@ func TestUpload(t *testing.T) {
|
||||
Name: "bin.deb",
|
||||
Path: debpath,
|
||||
})
|
||||
start(t)
|
||||
defer stop(t)
|
||||
// start(t)
|
||||
// defer stop(t)
|
||||
setCredentials(t)
|
||||
assert.NoError(t, Pipe{}.Default(ctx))
|
||||
assert.NoError(t, Pipe{}.Run(ctx))
|
||||
}
|
||||
|
||||
func setCredentials(t *testing.T) {
|
||||
// this comes from the testdata/config/config.json file - not real aws keys
|
||||
os.Setenv("AWS_ACCESS_KEY_ID", "IWA0WZQ1QJ2I8I1ALW64")
|
||||
os.Setenv("AWS_SECRET_ACCESS_KEY", "zcK4QQegvYwVGJaBm2E6k20WRLIQZqHOKOPP2npT")
|
||||
os.Setenv("AWS_REGION", "us-east-1")
|
||||
}
|
||||
|
||||
func start(t *testing.T) {
|
||||
dir, err := os.Getwd()
|
||||
assert.NoError(t, err)
|
||||
@ -101,11 +109,8 @@ func start(t *testing.T) {
|
||||
t.FailNow()
|
||||
}
|
||||
// TODO: check if the container is healthy instead of sleeping an arbitrary amount of time
|
||||
t.Log("waiting for minio to be healthy")
|
||||
time.Sleep(5 * time.Second)
|
||||
// this comes from the testdata/config/config.json file - not real aws keys
|
||||
os.Setenv("AWS_ACCESS_KEY_ID", "IWA0WZQ1QJ2I8I1ALW64")
|
||||
os.Setenv("AWS_SECRET_ACCESS_KEY", "zcK4QQegvYwVGJaBm2E6k20WRLIQZqHOKOPP2npT")
|
||||
os.Setenv("AWS_REGION", "us-east-1")
|
||||
}
|
||||
|
||||
func stop(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user