mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fixed tests
This commit is contained in:
parent
74d3f69289
commit
881b17ede1
@ -81,9 +81,9 @@ func skip(ctx *context.Context, platform, name string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.WithField("platform", platform).Debugf("found %v binaries", len(binaries))
|
||||
for _, binary := range binaries {
|
||||
log.WithField("binary", binary.Name()).Info("skip archiving")
|
||||
log.Infof("path: %v %v", path, binary.Name())
|
||||
ctx.AddArtifact(filepath.Join(path+"/", binary.Name()))
|
||||
}
|
||||
return nil
|
||||
|
@ -75,22 +75,23 @@ func TestRunPipeBinary(t *testing.T) {
|
||||
}()
|
||||
var dist = filepath.Join(folder, "dist")
|
||||
assert.NoError(os.Mkdir(dist, 0755))
|
||||
assert.NoError(os.Mkdir(filepath.Join(dist, "mybin"), 0755))
|
||||
_, err = os.Create(filepath.Join(dist, "mybin", "mybin"))
|
||||
assert.NoError(os.Mkdir(filepath.Join(dist, "mybin_darwin"), 0755))
|
||||
assert.NoError(os.Mkdir(filepath.Join(dist, "mybin_win"), 0755))
|
||||
_, err = os.Create(filepath.Join(dist, "mybin_darwin", "mybin"))
|
||||
assert.NoError(err)
|
||||
_, err = os.Create(filepath.Join(dist, "mybin", "mybin.exe"))
|
||||
_, err = os.Create(filepath.Join(dist, "mybin_win", "mybin.exe"))
|
||||
assert.NoError(err)
|
||||
_, err = os.Create(filepath.Join(folder, "README.md"))
|
||||
assert.NoError(err)
|
||||
var ctx = &context.Context{
|
||||
Archives: map[string]string{
|
||||
"darwinamd64": "mybin",
|
||||
"windowsamd64": "mybin",
|
||||
Folders: map[string]string{
|
||||
"darwinamd64": "mybin_darwin",
|
||||
"windowsamd64": "mybin_win",
|
||||
},
|
||||
Config: config.Project{
|
||||
Dist: dist,
|
||||
Build: config.Build{
|
||||
Binary: "mybin",
|
||||
Builds: []config.Build{
|
||||
{Binary: "mybin"},
|
||||
},
|
||||
Archive: config.Archive{
|
||||
Format: "binary",
|
||||
@ -98,8 +99,8 @@ func TestRunPipeBinary(t *testing.T) {
|
||||
},
|
||||
}
|
||||
assert.NoError(Pipe{}.Run(ctx))
|
||||
assert.Contains(ctx.Artifacts, "mybin")
|
||||
assert.Contains(ctx.Artifacts, "mybin.exe")
|
||||
assert.Contains(ctx.Artifacts, "mybin_darwin/mybin")
|
||||
assert.Contains(ctx.Artifacts, "mybin_win/mybin.exe")
|
||||
assert.Len(ctx.Artifacts, 2)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user