You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/01/10 14:50:52 UTC

[GitHub] ShannonDing closed pull request #25: Enabling travis CI

ShannonDing closed pull request #25: Enabling travis CI
URL: https://github.com/apache/rocketmq-client-go/pull/25
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services