Permalink
Browse files

(SDI-2036) Fix #1205 add darwin to binary release

Currently we only build linux binaries. This update uses GOOS/GOARCH to
crosscompile for MacOS.

* remove dns update since we have multiple binaries
* follow s3/${GOOS}/${GOARCH}/file convention
* use helper.PluginFilePath to determine binary path
* change latest folder -> last git tag, latest_build folder -> last pr
  • Loading branch information...
nanliu committed Sep 23, 2016
1 parent c644599 commit 676744be8405e0f7038859250492715fd849b426
@@ -25,7 +25,6 @@ _testmain.go
tmp/
*.tmp
scratch/
build/
*.swp
profile.cov
gin-bin
@@ -40,3 +39,8 @@ vendor/
.DS_Store
*.cov
# build and release artifacts
build/
s3/
release/
@@ -1,8 +1,8 @@
sudo: false
language: go
go:
- 1.5.4
- 1.6.2
- 1.6.3
- 1.7.1
before_install:
- bash scripts/gitcookie.sh
- go get github.com/smartystreets/goconvey/convey
@@ -11,15 +11,14 @@ env:
global:
- SNAP_SOURCE=/home/travis/gopath/src/github.com/intelsdi-x/snap
- GO15VENDOREXPERIMENT=1
- secure: kSsbBOCrSRyWx6yhSwhTYIWRId4WNMkO9OhMphBPXb5kDEd+asanCybuBKdOSgzuqrzBbQsuQjzhw+iZwdiPoQInZyDxeVl7frroNvg94n+q4tpPQOPzJ6gN15MCHSq3m1lCk3XVrESGEBTqmdmUtZhY+RfxSXuq1xkDMesst2f+gONd5Bl+QFiboRqvjUXwGC+e3JnZI2LxWjYZspNh2ZS6c5mvbhufDPV5MD6+jlZppzHcNkHAtHOt3KNoTFai8X0U8MYiEax3mSIAHjYzQQayS5al54MfgcVo1r4gWmPOybkyb5+/DyNSUT4KY+XVIrxV68fSOuCnLxLEaQZ9W0c0WuetmUU1fOT8Iy9q0qLQq9IknXNnfsCEGdwB2XKfyNvKEtkWbi6b6idrok5d1y7b8Qt5olveczGx0cRbpXQ0BTZ/bnQMhL9tpUeRltbDey6dsSsTJjnatqH7CdeEAV0ZeY+LjBgTukps4TlEHTn0ddEzhR1rrRsQ3OB0kT59Y3BCJ4kstzpMsTFWKUTMr/75UR1g5XETfOt0BtXkM3I343AIjJt+MQg/bW26ZOTbqPbqVO3Z7eDf0MaRC4Mugm809ekMZARTLAmq4FMIutDsTTT741IgWZQrMDI37WUztDUE1WFDzcTkAk99yc6gBjZ+0dZd1Qc7RQR0RMBi4M4=
matrix:
- SNAP_TEST_TYPE=legacy
- SNAP_TEST_TYPE=small
- SNAP_TEST_TYPE=medium
- SNAP_TEST_TYPE=build
matrix:
exclude:
- go: 1.5.4
- go: 1.6.3
env: SNAP_TEST_TYPE=build
install:
- export TMPDIR=$HOME/tmp
@@ -42,12 +41,10 @@ deploy:
bucket: snap.ci.snap-telemetry.io
region: us-west-2
skip_cleanup: true
local-dir: build
local-dir: s3
upload-dir: snap
acl: public_read
on:
repo: intelsdi-x/snap
branch: master
condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.6.2"
after_deploy:
- "./scripts/post_deploy.sh"
condition: $SNAP_TEST_TYPE = build && $TRAVIS_GO_VERSION = "1.7.1"
@@ -23,7 +23,6 @@ package control
import (
"net"
"path"
"testing"
"github.com/intelsdi-x/gomit"
@@ -38,6 +37,7 @@ import (
"github.com/intelsdi-x/snap/grpc/common"
"github.com/intelsdi-x/snap/grpc/controlproxy/rpc"
"github.com/intelsdi-x/snap/pkg/rpcutil"
"github.com/intelsdi-x/snap/plugin/helper"
. "github.com/smartystreets/goconvey/convey"
)
@@ -99,7 +99,7 @@ func TestGRPCServerScheduler(t *testing.T) {
})
})
<-lpe.done
passthru, err := core.NewRequestedPlugin(path.Join(fixtures.SnapPath, "plugin", "snap-plugin-processor-passthru"))
passthru, err := core.NewRequestedPlugin(helper.PluginFilePath("snap-plugin-processor-passthru"))
if err != nil {
log.Fatal(err)
}
@@ -115,7 +115,7 @@ func TestGRPCServerScheduler(t *testing.T) {
typeName: catalogedPassthru.TypeName(),
}
<-lpe.done
filepub, err := core.NewRequestedPlugin(path.Join(fixtures.SnapPath, "plugin", "snap-plugin-publisher-mock-file"))
filepub, err := core.NewRequestedPlugin(helper.PluginFilePath("snap-plugin-publisher-mock-file"))
if err != nil {
log.Fatal(err)
}
@@ -46,6 +46,7 @@ import (
"github.com/intelsdi-x/snap/core/control_event"
"github.com/intelsdi-x/snap/core/ctypes"
"github.com/intelsdi-x/snap/core/serror"
"github.com/intelsdi-x/snap/plugin/helper"
)
// Mock Executor used to test
@@ -1460,7 +1461,7 @@ func TestPublishMetrics(t *testing.T) {
time.Sleep(1 * time.Second)
// Load plugin
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-publisher-mock-file"))
_, err := load(c, helper.PluginFilePath("snap-plugin-publisher-mock-file"))
So(err, ShouldBeNil)
<-lpe.done
So(len(c.pluginManager.all()), ShouldEqual, 1)
@@ -1508,7 +1509,7 @@ func TestProcessMetrics(t *testing.T) {
c.Config.Plugins.Processor.Plugins["passthru"] = newPluginConfigItem(optAddPluginConfigItem("test", ctypes.ConfigValueBool{Value: true}))
// Load plugin
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-processor-passthru"))
_, err := load(c, helper.PluginFilePath("snap-plugin-processor-passthru"))
So(err, ShouldBeNil)
<-lpe.done
So(len(c.pluginManager.all()), ShouldEqual, 1)
@@ -1590,7 +1591,7 @@ func TestMetricSubscriptionToNewVersion(t *testing.T) {
lpe := newListenToPluginEvents()
c.eventManager.RegisterHandler("TestMetricSubscriptionToNewVersion", lpe)
c.Start()
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock1"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock1"))
<-lpe.load
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 1)
@@ -1625,7 +1626,7 @@ func TestMetricSubscriptionToNewVersion(t *testing.T) {
})
Convey("Loading v2 of that plugin should move subscriptions to newer version", func() {
// Load version snap-plugin-collector-mock2
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock2"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock2"))
So(err, ShouldBeNil)
select {
// Wait on subscriptionMovedEvent
@@ -1662,7 +1663,7 @@ func TestMetricSubscriptionToOlderVersion(t *testing.T) {
lpe := newListenToPluginEvents()
c.eventManager.RegisterHandler("TestMetricSubscriptionToOlderVersion", lpe)
c.Start()
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock2"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock2"))
<-lpe.load
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 1)
@@ -1693,7 +1694,7 @@ func TestMetricSubscriptionToOlderVersion(t *testing.T) {
mockv2 := pc[0]
Convey("Loading v1 of that plugin and unloading v2 should move subscriptions to older version", func() {
// Load version snap-plugin-collector-mock1
_, err = load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock1"))
_, err = load(c, helper.PluginFilePath("snap-plugin-collector-mock1"))
<-lpe.load
So(err, ShouldBeNil)
// Unload version snap-plugin-collector-mock2
@@ -1746,7 +1747,7 @@ func TestDynamicMetricSubscriptionLoad(t *testing.T) {
lpe := newListenToPluginEvents()
c.eventManager.RegisterHandler("TestDynamicMetricSubscriptionLoad", lpe)
c.Start()
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock1"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock1"))
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 1)
lp, err2 := c.pluginManager.get("collector" + core.Separator + "mock" + core.Separator + "1")
@@ -1787,7 +1788,7 @@ func TestDynamicMetricSubscriptionLoad(t *testing.T) {
})
Convey("Loading mock plugin in version 2 should swap subscriptions to latest version", func() {
// Load version snap-plugin-collector-mock2
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock2"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock2"))
So(err, ShouldBeNil)
<-lpe.load // wait for load event
<-lpe.sub // wait for subscription event
@@ -1813,7 +1814,7 @@ func TestDynamicMetricSubscriptionLoad(t *testing.T) {
})
Convey("Loading another plugin should add subscriptions", func() {
// Load version snap-plugin-collector-anothermock1
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-anothermock1"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-anothermock1"))
So(err, ShouldBeNil)
<-lpe.load // wait for load event
<-lpe.sub // wait for subscription event
@@ -1845,9 +1846,9 @@ func TestDynamicMetricSubscriptionUnload(t *testing.T) {
lpe := newListenToPluginEvents()
c.eventManager.RegisterHandler("TestDynamicMetricSubscriptionUnload", lpe)
c.Start()
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock1"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock1"))
So(err, ShouldBeNil)
_, err = load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-anothermock1"))
_, err = load(c, helper.PluginFilePath("snap-plugin-collector-anothermock1"))
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 2)
lpMock, err2 := c.pluginManager.get("collector" + core.Separator + "mock" + core.Separator + "1")
@@ -1928,7 +1929,7 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) {
lpe := newListenToPluginEvents()
c.eventManager.RegisterHandler("TestDynamicMetricSubscriptionLoadLessMetrics", lpe)
c.Start()
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock1"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock1"))
So(err, ShouldBeNil)
So(len(c.pluginManager.all()), ShouldEqual, 1)
lp, err2 := c.pluginManager.get("collector" + core.Separator + "mock" + core.Separator + "1")
@@ -1970,7 +1971,7 @@ func TestDynamicMetricSubscriptionLoadLessMetrics(t *testing.T) {
})
Convey("Loading higher plugin version with less metrics", func() {
// Load version snap-plugin-collector-mock2
_, err := load(c, path.Join(fixtures.SnapPath, "plugin", "snap-plugin-collector-mock2"))
_, err := load(c, helper.PluginFilePath("snap-plugin-collector-mock2"))
So(err, ShouldBeNil)
<-lpe.load // wait for load event
<-lpe.sub // wait for subscription event
@@ -22,21 +22,20 @@ package fixtures
import (
"encoding/json"
"os"
"path"
"time"
"github.com/intelsdi-x/snap/core"
"github.com/intelsdi-x/snap/core/cdata"
"github.com/intelsdi-x/snap/plugin/helper"
)
var (
PluginName = "snap-plugin-collector-mock2"
SnapPath = os.ExpandEnv(os.Getenv("SNAP_PATH"))
PluginPath = path.Join(SnapPath, "plugin", PluginName)
SnapPath = helper.BuildPath
PluginPath = helper.PluginFilePath(PluginName)
JSONRPCPluginName = "snap-plugin-collector-mock1"
JSONRPCPluginPath = path.Join(SnapPath, "plugin", JSONRPCPluginName)
JSONRPCPluginPath = helper.PluginFilePath(JSONRPCPluginName)
)
// mocks a metric type
Oops, something went wrong.

0 comments on commit 676744b

Please sign in to comment.