提交 0f6f1ec2 编写于 作者: 5 520MianXiangDuiXiang520

:construction_worker:update travis.yml

上级 8f6c04fd
......@@ -5,9 +5,19 @@ go:
before_install:
- go get github.com/mattn/goveralls
before_script:
- touch secret.ini
- echo "[mysql]" >> secret.ini
- echo "user=$MySQL_USER" >> secret.ini
- echo "password=$MySQL_PASSWORD" >> secret.ini
- echo "ip=$MySQL_IP" >> secret.ini
- echo "port=$MySQL_PORT" >> secret.ini
- echo "dbname=$MySQL_DBNAME" >> secret.ini
script:
- ls && make build && ls
- goveralls -service=travis-ci
deploy:
provider: pages
......@@ -17,3 +27,6 @@ deploy:
target_branch: master # Add this line - To push into GitHub master branch
on:
branch: master # Your GitHub repo default branch
after_script:
rm -rf secret.ini
\ No newline at end of file
......@@ -2,16 +2,15 @@ package dao
import "testing"
func TestAddFriendship(t *testing.T) {
// test FriendshipLink has ImgLink and Intro
err := AddFriendship(&FriendShipLink{
SiteLink: "https://draveness.me/",
SiteName: "面向信仰编程",
ImgLink: "https://draveness.me/images/draven-logo.png",
Intro: "面向信仰编程",
})
if err != nil {
t.Error(err)
func TestQueryAllFriendLink(t *testing.T) {
var fls []FriendShipLink
if err := QueryAllFriendLink(&fls); err != nil {
t.Error("Error!")
}
if len(fls) <= 0 {
t.Error("没拿到")
}
if fls[0].SiteName == "" {
t.Error("Nil")
}
// test FriendshipLink without ImgLink and Intro
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册