Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* change table name in ci env

* add travis

* more error info
  • Loading branch information
weiguoz authored and tonyyang-svail committed May 22, 2019
1 parent b7277d9 commit e9a5837
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go

branches:
only:
- /.*/

script:
- sh scripts/test.sh
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func parseResponseBody(res *http.Response) ([]byte, error) {
return nil, errors.New("nil response")
}
if res.StatusCode >= 400 {
return nil, fmt.Errorf("bad stataus:%d", res.StatusCode)
return nil, fmt.Errorf("parseResponseBody error: %d", res.StatusCode)
}
if res.Body == nil {
return nil, errNilBody
Expand Down
4 changes: 2 additions & 2 deletions connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestQuery(t *testing.T) {
db, err := sql.Open("maxcompute", cfg4test.FormatDSN())
a.NoError(err)

const sql = `select * from yiyang_test_table1;`
_, err = db.Query(sql)
const stmt = `SELECT * FROM gomaxcompute_test LIMIT 1;`
_, err = db.Query(stmt)
a.NoError(err)
}
6 changes: 0 additions & 6 deletions job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package gomaxcompute

import (
"encoding/xml"
"fmt"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -23,8 +22,3 @@ func TestJob_GenCreateInstanceXml(t *testing.T) {
_, err := xml.MarshalIndent(job, "", " ")
a.NoError(err)
}

func TestNewSQLJob(t *testing.T) {
job := newSQLJob(`SELECT 1;`)
fmt.Println(string(string(job.XML())))
}
2 changes: 1 addition & 1 deletion rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestNext(t *testing.T) {
db, err := sql.Open("maxcompute", cfg4test.FormatDSN())
a.NoError(err)

const sql = `select * from yiyang_test_table1;`
const sql = `SELECT * from gomaxcompute_test;`
rows, err := db.Query(sql)
defer rows.Close()
a.NoError(err)
Expand Down
5 changes: 5 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e

go get -v -t ./... && go test -v ./...

0 comments on commit e9a5837

Please sign in to comment.