mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-30 04:50:45 +02:00
add: two more test cases
This commit is contained in:
parent
b914f08301
commit
3580062fd3
@ -106,6 +106,50 @@ func Test_doRun(t *testing.T) {
|
|||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"valid",
|
||||||
|
args{
|
||||||
|
&context.Context{
|
||||||
|
Git: context.GitInfo{
|
||||||
|
CurrentTag: "v1.0.1",
|
||||||
|
},
|
||||||
|
Version: "1.0.1",
|
||||||
|
Artifacts: artifact.New(),
|
||||||
|
Config: config.Project{
|
||||||
|
GitHubURLs: config.GitHubURLs{Download: "https://api.custom.github.enterprise.com"},
|
||||||
|
Builds: []config.Build{
|
||||||
|
{Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}},
|
||||||
|
},
|
||||||
|
Dist: ".",
|
||||||
|
ProjectName: "run-pipe",
|
||||||
|
Archive: config.Archive{
|
||||||
|
Format: "tar.gz",
|
||||||
|
},
|
||||||
|
Release: config.Release{
|
||||||
|
GitHub: config.Repo{
|
||||||
|
Owner: "test",
|
||||||
|
Name: "test",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Scoop: config.Scoop{
|
||||||
|
Bucket: config.Repo{
|
||||||
|
Owner: "test",
|
||||||
|
Name: "test",
|
||||||
|
},
|
||||||
|
Description: "A run pipe test formula",
|
||||||
|
Homepage: "https://github.com/goreleaser",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Publish: true,
|
||||||
|
},
|
||||||
|
&DummyClient{},
|
||||||
|
},
|
||||||
|
[]artifact.Artifact{
|
||||||
|
{Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64"},
|
||||||
|
{Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386"},
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"no windows build",
|
"no windows build",
|
||||||
args{
|
args{
|
||||||
@ -267,6 +311,46 @@ func Test_doRun(t *testing.T) {
|
|||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"no archive",
|
||||||
|
args{
|
||||||
|
&context.Context{
|
||||||
|
Git: context.GitInfo{
|
||||||
|
CurrentTag: "v1.0.1",
|
||||||
|
},
|
||||||
|
Version: "1.0.1",
|
||||||
|
Artifacts: artifact.New(),
|
||||||
|
Config: config.Project{
|
||||||
|
Builds: []config.Build{
|
||||||
|
{Binary: "test", Goarch: []string{"amd64"}, Goos: []string{"windows"}},
|
||||||
|
},
|
||||||
|
Dist: ".",
|
||||||
|
ProjectName: "run-pipe",
|
||||||
|
Archive: config.Archive{
|
||||||
|
Format: "binary",
|
||||||
|
},
|
||||||
|
Release: config.Release{
|
||||||
|
Draft: true,
|
||||||
|
},
|
||||||
|
Scoop: config.Scoop{
|
||||||
|
Bucket: config.Repo{
|
||||||
|
Owner: "test",
|
||||||
|
Name: "test",
|
||||||
|
},
|
||||||
|
Description: "A run pipe test formula",
|
||||||
|
Homepage: "https://github.com/goreleaser",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Publish: true,
|
||||||
|
},
|
||||||
|
&DummyClient{},
|
||||||
|
},
|
||||||
|
[]artifact.Artifact{
|
||||||
|
{Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64"},
|
||||||
|
{Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386"},
|
||||||
|
},
|
||||||
|
true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user