You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-09-16 09:26:52 +02:00
test: Fix unit test TestArtifactoriesWithInvalidMode
The unit test TestArtifactoriesWithInvalidMode was not testing what it should be. The publish parameter was not set and we were testing for skipping instead of error
This commit is contained in:
@@ -649,16 +649,24 @@ func TestArtifactoriesWithoutSecret(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestArtifactoriesWithInvalidMode(t *testing.T) {
|
||||
assert.True(t, pipeline.IsSkip(Pipe{}.Run(context.New(config.Project{
|
||||
Artifactories: []config.Artifactory{
|
||||
{
|
||||
Name: "production",
|
||||
Mode: "does-not-exists",
|
||||
Target: "http://artifacts.company.com/example-repo-local/{{ .ProjectName }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}",
|
||||
Username: "deployuser",
|
||||
// Set secrets for artifactory instances
|
||||
os.Setenv("ARTIFACTORY_PRODUCTION_SECRET", "deployuser-secret")
|
||||
defer os.Unsetenv("ARTIFACTORY_PRODUCTION_SECRET")
|
||||
|
||||
var ctx = &context.Context{
|
||||
Publish: true,
|
||||
Config: config.Project{
|
||||
Artifactories: []config.Artifactory{
|
||||
{
|
||||
Name: "production",
|
||||
Mode: "does-not-exists",
|
||||
Target: "http://artifacts.company.com/example-repo-local/{{ .ProjectName }}/{{ .Os }}/{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}",
|
||||
Username: "deployuser",
|
||||
},
|
||||
},
|
||||
},
|
||||
}))))
|
||||
}
|
||||
assert.Error(t, Pipe{}.Run(ctx))
|
||||
}
|
||||
|
||||
func TestDefault(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user