Skip to content

Commit

Permalink
update logrus and use glide as dependency management tool. (#30)
Browse files Browse the repository at this point in the history
* update dependencies.

* refactor test cases

* remove glide.lock

* fix build error
  • Loading branch information
martinyunify authored Aug 12, 2017
1 parent 8e195d1 commit 0bf3d69
Show file tree
Hide file tree
Showing 450 changed files with 76,728 additions and 27,952 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ gen
coverage
release
.idea
glide.lock
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL := /bin/bash
PREFIX=qingcloud-sdk-go
VERSION=$(shell cat version.go | grep "Version\ =" | sed -e s/^.*\ //g | sed -e s/\"//g)
DIRS_TO_CHECK=$(shell ls -d */ | grep -vE "vendor|test")
PKGS_TO_CHECK=$(shell go list ./... | grep -v "/vendor/")
PKGS_TO_CHECK=$(shell go list ./... | grep -vE "vendor|test")
PKGS_TO_RELEASE=$(shell go list ./... | grep -vE "/vendor/|/test")
FILES_TO_RELEASE=$(shell find . -name "*.go" | grep -vE "/vendor/|/test|.*_test.go")
FILES_TO_RELEASE_WITH_VENDOR=$(shell find . -name "*.go" | grep -vE "/test|.*_test.go")
Expand Down Expand Up @@ -141,7 +141,7 @@ unit-runtime-go-1.5:
@echo "ok"

test:
pushd "./test"; go run *.go; popd
pushd "./test"; go test ; popd
@echo "ok"

release: release-source release-source-with-vendor
Expand Down
14 changes: 14 additions & 0 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package: github.com/yunify/qingcloud-sdk-go
import:
- package: github.com/sirupsen/logrus
version: ~1.0.2
- package: gopkg.in/yaml.v2
testImport:
- package: github.com/DATA-DOG/godog
version: ~0.7.3
subpackages:
- gherkin
- package: github.com/stretchr/testify
version: ~1.1.4
subpackages:
- assert
2 changes: 1 addition & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"strings"
"time"

"github.com/Sirupsen/logrus"
"github.com/sirupsen/logrus"
)

var instance *logrus.Logger
Expand Down
12 changes: 8 additions & 4 deletions test/main.go → test/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@
// | limitations under the License.
// +-------------------------------------------------------------------------

package main
package test

import (
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"testing"

"gopkg.in/yaml.v2"

"github.com/DATA-DOG/godog"

"github.com/yunify/qingcloud-sdk-go/config"
qc "github.com/yunify/qingcloud-sdk-go/service"
)

func main() {
func TestMain(m *testing.M) {
setUp()

context := func(s *godog.Suite) {
Expand All @@ -39,7 +41,9 @@ func main() {
Tags: "",
}
status := godog.RunWithOptions("*", context, options)

if st := m.Run(); st > status {
status = st
}
os.Exit(status)
}

Expand Down
2 changes: 1 addition & 1 deletion test/service.go → test/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// | limitations under the License.
// +-------------------------------------------------------------------------

package main
package test

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion test/utils.go → test/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// | limitations under the License.
// +-------------------------------------------------------------------------

package main
package test

import (
"fmt"
Expand Down
37 changes: 0 additions & 37 deletions test/vendor/github.com/DATA-DOG/godog/options.go

This file was deleted.

13 changes: 0 additions & 13 deletions test/vendor/gopkg.in/yaml.v2/LICENSE

This file was deleted.

131 changes: 0 additions & 131 deletions test/vendor/gopkg.in/yaml.v2/README.md

This file was deleted.

Loading

0 comments on commit 0bf3d69

Please sign in to comment.