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

fix(travis):remove unnessary script in travis.yml #246

Merged
merged 6 commits into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,12 @@ env:

before_install:
- cd ${TRAVIS_HOME}
- wget https://opensource-rocketmq-client-us.oss-us-west-1.aliyuncs.com/cpp-client/linux/1.2.0/RHEL7.x/librocketmq.tar.gz
- wget https://opensource-rocketmq-client-us.oss-us-west-1.aliyuncs.com/cpp-client/linux/1.2.4/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
Expand Down
18 changes: 12 additions & 6 deletions core/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ func TestProducerConfig_String(t *testing.T) {
pConfig.SendMsgTimeout = 30
pConfig.CompressLevel = 4
pConfig.MaxMessageSize = 1024
pConfig.ProducerModel = CommonProducer

expect := "ProducerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: producerGroupName, InstanceName: testProducer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, S" +
"endMsgTimeout: 30, CompressLevel: 4, MaxMessageSize: 1024, ]"
"endMsgTimeout: 30, CompressLevel: 4, MaxMessageSize: 1024, ProducerModel: CommonProducer, ]"
assert.Equal(t, expect, pConfig.String())
}

Expand All @@ -56,22 +57,27 @@ func TestPushConsumerConfig_String(t *testing.T) {
FileSize: 1 << 20,
Level: LogLevelDebug}
pcConfig.ThreadCount = 4
expect := "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, " +
"GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, ]"
pcConfig.MessageBatchMaxSize = 1024
expect := "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, GroupName: consumerGroupName, " +
"InstanceName: testPushConsumer, LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, " +
"ThreadCount: 4, MessageBatchMaxSize: 1024, ]"
assert.Equal(t, expect, pcConfig.String())

pcConfig.NameServerDomain = "domain1"
expect = "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, ]"
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4, MessageBatchMaxSize: 1024, ]"
assert.Equal(t, expect, pcConfig.String())

pcConfig.MessageBatchMaxSize = 32
pcConfig.Model = Clustering
pcConfig.ConsumerModel = CoCurrently
pcConfig.MaxCacheMessageSize = 1024
pcConfig.MaxCacheMessageSizeInMB = 2048
expect = "PushConsumerConfig=[GroupId: testGroup, NameServer: localhost:9876, NameServerDomain: domain1, " +
"GroupName: consumerGroupName, InstanceName: testPushConsumer, " +
"LogConfig: {Path:/rocketmq/log FileNum:16 FileSize:1048576 Level:Debug}, ThreadCount: 4," +
" MessageBatchMaxSize: 32, MessageModel: Clustering, ]"
" MessageBatchMaxSize: 32, MessageModel: Clustering, ConsumerModel: CoCurrently," +
" MaxCacheMessageSize: 1024, MaxCacheMessageSizeInMB: 2048, ]"
assert.Equal(t, expect, pcConfig.String())
}
2 changes: 1 addition & 1 deletion core/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package rocketmq

const GoClientVersion = "Go Client V1.2.0, Support CPP Core:V1.2.X"
const GoClientVersion = "Go Client V1.2.4, Support CPP Core:V1.2.X"

func GetVersion() (version string) {
return GoClientVersion
Expand Down
21 changes: 9 additions & 12 deletions core/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
*/
package rocketmq

//import (
// "fmt"
// "testing"
// "../client"
//)
//
//func TestGetVersion(test *testing.T){
// fmt.Println("-----TestGetVersion Start----")
// version := rocketmq.GetVersion();
// fmt.Println(version)
// fmt.Println("-----TestGetVersion Finish----")
//}
import (
"github.com/stretchr/testify/assert"
"testing"
)

func TestGetVersion(test *testing.T) {
expect := "Go Client V1.2.4, Support CPP Core:V1.2.X"
assert.Equal(test, expect, GetVersion())
}
29 changes: 29 additions & 0 deletions demos/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package main

func main() {
//run producer
main0()
//run consumer
main1()
//run orderly producer
main2()
//run orderly consumer
main3()
}
3 changes: 2 additions & 1 deletion demos/orderly_push_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import (
"sync/atomic"
)

func main() {
// Change to main if you want to run it directly
func main3() {
pConfig := &rocketmq.PushConsumerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
Expand Down
3 changes: 2 additions & 1 deletion demos/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
"github.com/apache/rocketmq-client-go/core"
)

func main() {
// Change to main if you want to run it directly
func main0() {
pConfig := &rocketmq.ProducerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
Expand Down
3 changes: 2 additions & 1 deletion demos/producer_orderly.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import (
"time"
)

func main() {
// Change to main if you want to run it directly
func main2() {
pConfig := &rocketmq.ProducerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
Expand Down
3 changes: 2 additions & 1 deletion demos/push_consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import (
"sync/atomic"
)

func main() {
// Change to main if you want to run it directly
func main1() {
pConfig := &rocketmq.PushConsumerConfig{
ClientConfig: rocketmq.ClientConfig{
GroupID: "GID_XXXXXXXXXXXX",
Expand Down