Skip to content

Commit

Permalink
Enable CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
nati committed Dec 13, 2017
1 parent da80355 commit bc1b48c
Show file tree
Hide file tree
Showing 42 changed files with 39 additions and 89 deletions.
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/Juniper/contrail
docker:
- image: circleci/golang:1.9
- image: circleci/mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=contrail123

steps:
- checkout
- run:
name: install mysql client
command: sudo apt install mysql-client
- run:
name: install deps
command: ./tools/deps.sh
- run:
name: lint
command: ./tools/lint.sh
- run:
name: Wait for db
command: dockerize -wait tcp://localhost:3306 -timeout 1m
- run:
name: Reset database
command: ./tools/reset_db.sh
- run:
name: Run Test
command: make test
8 changes: 1 addition & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 0 additions & 75 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions pkg/apisrv/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (s *Server) Run() error {
return nil
}

//Close closes server resources
func (s *Server) Close() error {
return s.DB.Close()
}
2 changes: 1 addition & 1 deletion pkg/common/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/labstack/echo"
)

//REST API defines handlers for REST API calls.
//RESTAPI defines handlers for REST API calls.
type RESTAPI interface {
Path() string
LongPath() string
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c ColumnConfigs) Less(i, j int) bool {
return strings.Compare(strings.Join(c[i].ParentColumn, "")+c[i].Column, strings.Join(c[j].ParentColumn, "")+c[j].Column) > 0
}

func (c ColumnConfigs) ShortenColumn() {
func (c ColumnConfigs) shortenColumn() {
sort.Sort(c)
if len(c) < 2 {
return
Expand Down Expand Up @@ -418,7 +418,7 @@ func (api *API) resolveAllSQL() error {
if err != nil {
return err
}
s.Columns.ShortenColumn()
s.Columns.shortenColumn()
}
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions tools/reset_db.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

TOP=$(dirname "$0")
mysql -uroot -pcontrail123 -e "drop database if exists contrail_test;"
mysql -uroot -pcontrail123 -e "create database contrail_test;"
mysql -uroot -pcontrail123 contrail_test < $TOP/init.sql
mysql -uroot -pcontrail123 -h 127.0.0.1 -e "drop database if exists contrail_test;"
mysql -uroot -pcontrail123 -h 127.0.0.1 -e "create database contrail_test;"
mysql -uroot -pcontrail123 -h 127.0.0.1 contrail_test < $TOP/init.sql
2 changes: 1 addition & 1 deletion tools/test_config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Database configuraion. Only MySQL supported
database:
connection: "root:contrail123@tcp(mysql:3306)/contrail_test"
connection: "root:contrail123@tcp(localhost:3306)/contrail_test"
# Max Open Connections for MySQL Server
max_open_conn: 100

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bc1b48c

Please sign in to comment.