You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2019/01/10 14:50:53 UTC

[rocketmq-client-go] branch master updated: Enabling travis CI (#25)

This is an automated email from the ASF dual-hosted git repository.

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 497eb7e  Enabling travis CI (#25)
497eb7e is described below

commit 497eb7e2a59e0214d8f99ac1513bb58c3a3e42ec
Author: wenfeng <sx...@gmail.com>
AuthorDate: Thu Jan 10 22:50:49 2019 +0800

    Enabling travis CI (#25)
    
    * Add travis.yml
    
    * update travis.yml
---
 .travis.yml           | 41 +++++++++++++++++++++++++++++++++++++++++
 README.md             |  4 +++-
 core/cfuns.go         |  5 +++--
 core/error.go         |  2 +-
 core/log.go           |  2 +-
 core/message.go       |  4 ++--
 core/producer.go      |  6 +++---
 core/pull_consumer.go |  4 ++--
 core/push_consumer.go |  7 ++++---
 9 files changed, 60 insertions(+), 15 deletions(-)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..321185b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,41 @@
+language: go
+
+go:
+  - "1.10.x"
+  - "1.11.x"
+
+go_import_path: github.com/apache/rocketmq-client-go
+
+env:
+  global:
+    - NAME_SERVER_ADDRESS=127.0.0.1:9876
+    - BROKER_ADDRESS=127.0.0.1:10911
+    - TOPIC=test
+    - GROUP=testGroup
+  matrix:
+  - OS_TYPE=centos OS_VERSION=7
+
+before_install:
+  - cd ${TRAVIS_HOME}
+  - wget https://opensource-rocketmq-client.oss-cn-hangzhou.aliyuncs.com/cpp-client/linux/1.2.0/RHEL7.x/librocketmq.tar.gz
+  - tar -xzf librocketmq.tar.gz
+  - sudo cp librocketmq.so librocketmq.a /usr/local/lib/
+  - sudo cp -r rocketmq /usr/local/include/
+  - cd ${GOPATH}/src/github.com/apache/rocketmq-client-go
+
+before_script:
+  - cd ${TRAVIS_HOME}
+  - wget http://us.mirrors.quenda.co/apache/rocketmq/4.3.2/rocketmq-all-4.3.2-bin-release.zip
+  - unzip rocketmq-all-4.3.2-bin-release.zip
+  - cd rocketmq-all-4.3.2-bin-release
+  - perl -i -pe's/-Xms8g -Xmx8g -Xmn4g/-Xms2g -Xmx2g -Xmn1g/g' bin/runbroker.sh
+  - nohup sh bin/mqnamesrv &
+  - nohup sh bin/mqbroker -n localhost:9876 &
+  - sleep 10
+  - ./bin/mqadmin updateTopic -n ${NAME_SERVER_ADDRESS} -b ${BROKER_ADDRESS}  -t ${TOPIC}
+  - ./bin/mqadmin updateSubGroup -n ${NAME_SERVER_ADDRESS} -b ${BROKER_ADDRESS} -g ${GROUP}
+
+script:
+  - export LD_LIBRARY_PATH=/usr/local/lib
+  - cd ${GOPATH}/src/github.com/apache/rocketmq-client-go
+  - go test ./core
\ No newline at end of file
diff --git a/README.md b/README.md
index 71244fd..107d646 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
-## RocketMQ Client Go [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+## RocketMQ Client Go
+[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+[![TravisCI](https://travis-ci.org/apache/rocketmq-client-python.svg)](https://travis-ci.org/apache/rocketmq-client-go)
 
 * The client is using cgo to call [rocketmq-client-cpp](https://github.com/apache/rocketmq-client-cpp), which has been proven robust and widely adopted within Alibaba Group by many business units for more than three years.
 
diff --git a/core/cfuns.go b/core/cfuns.go
index 5b4cba9..e21fbd4 100644
--- a/core/cfuns.go
+++ b/core/cfuns.go
@@ -18,8 +18,9 @@ package rocketmq
 
 /*
 #cgo LDFLAGS: -L/usr/local/lib -lrocketmq
-#include "rocketmq/CMessageExt.h"
-#include "rocketmq/CPushConsumer.h"
+
+#include <rocketmq/CMessageExt.h>
+#include <rocketmq/CPushConsumer.h>
 */
 import "C"
 import (
diff --git a/core/error.go b/core/error.go
index b50b4b2..6be7883 100644
--- a/core/error.go
+++ b/core/error.go
@@ -18,7 +18,7 @@
 package rocketmq
 
 /*
-#include "rocketmq/CCommon.h"
+#include <rocketmq/CCommon.h>
 */
 import "C"
 import "fmt"
diff --git a/core/log.go b/core/log.go
index 5ff244e..18a5275 100644
--- a/core/log.go
+++ b/core/log.go
@@ -18,7 +18,7 @@
 package rocketmq
 
 /*
-#include "rocketmq/CCommon.h"
+#include <rocketmq/CCommon.h>
 */
 import "C"
 import "fmt"
diff --git a/core/message.go b/core/message.go
index 8e75d18..e072bff 100644
--- a/core/message.go
+++ b/core/message.go
@@ -18,8 +18,8 @@ package rocketmq
 
 /*
 #cgo LDFLAGS: -L/usr/local/lib/ -lrocketmq
-#include "rocketmq/CMessage.h"
-#include "rocketmq/CMessageExt.h"
+#include <rocketmq/CMessage.h>
+#include <rocketmq/CMessageExt.h>
 #include <stdlib.h>
 */
 import "C"
diff --git a/core/producer.go b/core/producer.go
index 8ad3ea4..fe2d978 100644
--- a/core/producer.go
+++ b/core/producer.go
@@ -21,9 +21,9 @@ package rocketmq
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "rocketmq/CMessage.h"
-#include "rocketmq/CProducer.h"
-#include "rocketmq/CSendResult.h"
+#include <rocketmq/CMessage.h>
+#include <rocketmq/CProducer.h>
+#include <rocketmq/CSendResult.h>
 
 int queueSelectorCallback_cgo(int size, CMessage *msg, void *selectorKey) {
 	int queueSelectorCallback(int, void*);
diff --git a/core/pull_consumer.go b/core/pull_consumer.go
index 74e4a0b..50b5196 100644
--- a/core/pull_consumer.go
+++ b/core/pull_consumer.go
@@ -22,8 +22,8 @@ package rocketmq
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "rocketmq/CMessageExt.h"
-#include "rocketmq/CPullConsumer.h"
+#include <rocketmq/CMessageExt.h>
+#include <rocketmq/CPullConsumer.h>
 */
 import "C"
 
diff --git a/core/push_consumer.go b/core/push_consumer.go
index e7ee1d7..90e1454 100644
--- a/core/push_consumer.go
+++ b/core/push_consumer.go
@@ -18,9 +18,10 @@ package rocketmq
 
 /*
 #cgo LDFLAGS: -L/usr/local/lib -lrocketmq
+
 #include <stdlib.h>
-#include "rocketmq/CMessageExt.h"
-#include "rocketmq/CPushConsumer.h"
+#include <rocketmq/CMessageExt.h>
+#include <rocketmq/CPushConsumer.h>
 
 extern int consumeMessageCallback(CPushConsumer *consumer, CMessageExt *msg);
 
@@ -32,10 +33,10 @@ import "C"
 
 import (
 	"fmt"
-	"github.com/pkg/errors"
 	log "github.com/sirupsen/logrus"
 	"sync"
 	"unsafe"
+	"errors"
 )
 
 type ConsumeStatus int