mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-08 03:31:59 +02:00
Improve test coverage for archive skip option.
This commit is contained in:
parent
454abc9a0a
commit
de2b5f4385
@ -186,6 +186,20 @@ func TestRunPipeDraftRelease(t *testing.T) {
|
|||||||
assert.False(client.CreatedFile)
|
assert.False(client.CreatedFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunPipeSkipArchive(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
var ctx = &context.Context{
|
||||||
|
Config: config.Project{
|
||||||
|
Archive: config.Archive{
|
||||||
|
Skip: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
client := &DummyClient{}
|
||||||
|
assert.NoError(doRun(ctx, client))
|
||||||
|
assert.False(client.CreatedFile)
|
||||||
|
}
|
||||||
|
|
||||||
type DummyClient struct {
|
type DummyClient struct {
|
||||||
CreatedFile bool
|
CreatedFile bool
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,35 @@ func TestRunFullPipe(t *testing.T) {
|
|||||||
assert.True(exists(post), post)
|
assert.True(exists(post), post)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunPipeSkipArchive(t *testing.T) {
|
||||||
|
assert := assert.New(t)
|
||||||
|
folder, err := ioutil.TempDir("", "goreleasertest")
|
||||||
|
assert.NoError(err)
|
||||||
|
var binary = filepath.Join(folder, "binary-testing")
|
||||||
|
var config = config.Project{
|
||||||
|
Dist: folder,
|
||||||
|
Build: config.Build{
|
||||||
|
Binary: "testing",
|
||||||
|
Goos: []string{
|
||||||
|
runtime.GOOS,
|
||||||
|
},
|
||||||
|
Goarch: []string{
|
||||||
|
runtime.GOARCH,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Archive: config.Archive{
|
||||||
|
Skip: true,
|
||||||
|
NameTemplate: "binary-{{.Binary}}",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
var ctx = &context.Context{
|
||||||
|
Config: config,
|
||||||
|
Archives: map[string]string{},
|
||||||
|
}
|
||||||
|
assert.NoError(Pipe{}.Run(ctx))
|
||||||
|
assert.True(exists(binary))
|
||||||
|
}
|
||||||
|
|
||||||
func TestRunPipeArmBuilds(t *testing.T) {
|
func TestRunPipeArmBuilds(t *testing.T) {
|
||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
folder, err := ioutil.TempDir("", "goreleasertest")
|
folder, err := ioutil.TempDir("", "goreleasertest")
|
||||||
|
@ -23,6 +23,18 @@ func TestRunPipeNoFormats(t *testing.T) {
|
|||||||
assert.NoError(Pipe{}.Run(ctx))
|
assert.NoError(Pipe{}.Run(ctx))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestRunPipeSkipArchive(t *testing.T) {
|
||||||
|
var assert = assert.New(t)
|
||||||
|
var ctx = &context.Context{
|
||||||
|
Config: config.Project{
|
||||||
|
Archive: config.Archive{
|
||||||
|
Skip: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
assert.NoError(Pipe{}.Run(ctx))
|
||||||
|
}
|
||||||
|
|
||||||
func TestRunPipe(t *testing.T) {
|
func TestRunPipe(t *testing.T) {
|
||||||
var assert = assert.New(t)
|
var assert = assert.New(t)
|
||||||
folder, err := ioutil.TempDir("", "archivetest")
|
folder, err := ioutil.TempDir("", "archivetest")
|
||||||
|
Loading…
Reference in New Issue
Block a user