Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

promote to master #42

Merged
merged 10 commits into from
Mar 27, 2019
23 changes: 15 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@ platform:
os: linux
arch: amd64

services:
- name: nats-streaming
image: nats-streaming
command: [-mc, 0]
ports:
- 4222

steps:
- name: branch-push
- name: tests
image: golang
environment:
CODECOV_TOKEN:
from_secret: CODECOV_TOKEN
COVERALLS_TOKEN:
from_secret: COVERALLS_TOKEN
commands:
- apt-get update
- apt-get install unzip
- export STAN_HOST="nats-streaming"
- go get -v golang.org/x/lint/golint
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/mattn/goveralls
Expand All @@ -19,16 +30,12 @@ steps:
- go get -v github.com/onsi/ginkgo/ginkgo
- go get -v github.com/onsi/gomega
- go get -v github.com/moleculer-go/cupaloy
- curl -fSsL https://github.com/nats-io/nats-streaming-server/releases/download/v0.11.2/nats-streaming-server-v0.11.2-linux-amd64.zip -o nats.zip
- unzip nats.zip && ls
- nohup nats-*/nats-streaming-server -mc 0 -l /dev/null &
- mkdir /usr/local/go/src/github.com/
- mkdir /usr/local/go/src/github.com/moleculer-go
- ln -s /drone/src/ /usr/local/go/src/github.com/moleculer-go/moleculer
- cd /usr/local/go/src/github.com/moleculer-go/moleculer
- go get -d ./...
- ginkgo -r --randomizeAllSpecs --failFast --cover --trace
- export CODECOV_TOKEN="e1ecc5e9-6a8a-47cf-b3bb-c046d2fd9f1c"
- gover ./ coverage.txt
- curl -s https://codecov.io/bash | bash
- goveralls -coverprofile=coverage.txt -service=drone.io -repotoken cXy9o2ocOliHLtJ4HMMQQ8MAFHWV7Io1q
- goveralls -coverprofile=coverage.txt -service=drone.io
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@

.idea
.DS_Store
broker/broker.coverprofile

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ matrix:
- os: windows

before_install:
- export STAN_HOST="localhost"
- go get -v golang.org/x/lint/golint
- go get -v golang.org/x/tools/cmd/cover
- go get -v github.com/mattn/goveralls
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
Lightning fast, lightweight, simple and fun to develop with. Also easy, very easy to test ;)

[![Gitter](https://badges.gitter.im/moleculer-go/community.svg)](https://gitter.im/moleculer-go/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[![Travis Build Status](https://travis-ci.org/moleculer-go/moleculer.svg?branch=master)](https://travis-ci.org/moleculer-go/moleculer)

[![Drone.io Build Status](https://cloud.drone.io/api/badges/moleculer-go/moleculer/status.svg)](https://cloud.drone.io/moleculer-go/moleculer)

[![Go Report Card](https://goreportcard.com/badge/github.com/moleculer-go/moleculer)](https://goreportcard.com/report/github.com/moleculer-go/moleculer)

[![Coverage -> Coveralls](https://coveralls.io/repos/github/moleculer-go/moleculer/badge.svg?branch=master)](https://coveralls.io/github/moleculer-go/moleculer?branch=master)

[![Coverage -> Codecov](https://codecov.io/gh/moleculer-go/moleculer/branch/develop/graph/badge.svg)](https://codecov.io/gh/moleculer-go/moleculer)

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmoleculer-go%2Fmoleculer.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fmoleculer-go%2Fmoleculer?ref=badge_shield)

<!--
Expand All @@ -25,9 +19,9 @@ Lightning fast, lightweight, simple and fun to develop with. Also easy, very eas
![](https://img.shields.io/badge/performance---42%25-red.svg)
-->

**Website**: [tbd](https://moleculer.services)
**Website**: [tbd](https://gomicro.services)

**Documentation**: [tbd](https://moleculer.services/docs)
**Documentation**: [tbd](https://gomicro.services/docs)

Status: In development !

Expand Down
2 changes: 1 addition & 1 deletion transit/nats/stan.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (transporter *StanTransporter) Connect() chan bool {
connection, error := stan.Connect(transporter.clusterID, transporter.clientID, stan.NatsURL(transporter.url))
if error != nil {
transporter.logger.Error("\nConnect() - Error: ", error, " clusterID: ", transporter.clusterID, " clientID: ", transporter.clientID)
panic(error)
panic("Error trying to connect to stan server. url: " + transporter.url + " clusterID: " + transporter.clusterID + " clientID: " + transporter.clientID + " -> Stan error: " + error.Error())
}
transporter.logger.Info("Connect() - connection success!")

Expand Down
3 changes: 2 additions & 1 deletion transit/nats/stan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nats_test

import (
"fmt"
"os"

"github.com/moleculer-go/moleculer/payload"
"github.com/moleculer-go/moleculer/util"
Expand Down Expand Up @@ -83,7 +84,7 @@ var _ = Describe("NATS Streaming Transit", func() {
contextA := context.BrokerContext(brokerDelegates)
logger := contextA.Logger()
var serializer serializer.Serializer = serializer.CreateJSONSerializer(logger)
url := "stan://localhost:4222"
url := "stan://" + os.Getenv("STAN_HOST") + ":4222"
options := nats.StanOptions{
"MOL",
url,
Expand Down
3 changes: 2 additions & 1 deletion transit/pubsub/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"math"
"os"
"sync"
"time"

Expand Down Expand Up @@ -126,7 +127,7 @@ func (pubsub *PubSub) createStanTransporter() transit.Transport {
//TODO: move this to config and params
broker := pubsub.broker
prefix := "MOL"
url := "stan://localhost:4222"
url := "stan://" + os.Getenv("STAN_HOST") + ":4222"
clusterID := "test-cluster"

localNodeID := broker.LocalNode().GetID()
Expand Down