diff options
-rw-r--r-- | .drone.yml | 4 | ||||
-rw-r--r-- | .drone.yml.sig | 2 | ||||
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | integrations/integration_test.go | 52 | ||||
-rw-r--r-- | integrations/mysql.ini | 6 | ||||
-rw-r--r-- | integrations/pgsql.ini | 2 | ||||
-rw-r--r-- | models/attachment_test.go | 6 | ||||
-rw-r--r-- | models/fixtures/attachment.yml | 16 | ||||
-rw-r--r-- | models/fixtures/pull_request.yml | 2 |
9 files changed, 64 insertions, 27 deletions
diff --git a/.drone.yml b/.drone.yml index 89fb792193..62db99082c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -44,7 +44,7 @@ pipeline: TAGS: bindata GOPATH: /srv/app commands: - - echo make test-mysql # Not ready yet + - make test-mysql when: event: [ push, tag, pull_request ] @@ -55,7 +55,7 @@ pipeline: TAGS: bindata GOPATH: /srv/app commands: - - echo make test-pqsql # Not ready yet + - make test-pgsql when: event: [ push, tag, pull_request ] diff --git a/.drone.yml.sig b/.drone.yml.sig index 3d2acc7936..c53f5b2796 100644 --- a/.drone.yml.sig +++ b/.drone.yml.sig @@ -1 +1 @@ -eyJhbGciOiJIUzI1NiJ9.d29ya3NwYWNlOgogIGJhc2U6IC9zcnYvYXBwCiAgcGF0aDogc3JjL2NvZGUuZ2l0ZWEuaW8vZ2l0ZWEKCnBpcGVsaW5lOgogIGNsb25lOgogICAgaW1hZ2U6IHBsdWdpbnMvZ2l0CiAgICBkZXB0aDogNTAKICAgIHRhZ3M6IHRydWUKCiAgdGVzdDoKICAgIGltYWdlOiB3ZWJoaXBwaWUvZ29sYW5nOmVkZ2UKICAgIHB1bGw6IHRydWUKICAgIGVudmlyb25tZW50OgogICAgICBUQUdTOiBiaW5kYXRhIHNxbGl0ZQogICAgICBHT1BBVEg6IC9zcnYvYXBwCiAgICBjb21tYW5kczoKICAgICAgLSBhcGsgLVUgYWRkIG9wZW5zc2gtY2xpZW50CiAgICAgIC0gbWFrZSBjbGVhbg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hZ2U6IHBvc3RncmVzOjkuNQogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gUE9TVEdSRVNfREI9dGVzdAogICAgd2hlbjoKICAgICAgZXZlbnQ6IFsgcHVzaCwgdGFnLCBwdWxsX3JlcXVlc3QgXQo._gmaEu0hvh55_gmu1f06G5jdsDGIelMW0whjHfe7ovw
\ No newline at end of file @@ -90,7 +90,6 @@ test-sqlite: integrations.test .PHONY: test-mysql test-mysql: integrations.test - echo "CREATE DATABASE IF NOT EXISTS testgitea" | mysql -u root GITEA_CONF=integrations/mysql.ini ./integrations.test .PHONY: test-pgsql diff --git a/integrations/integration_test.go b/integrations/integration_test.go index dc0d41edef..e13c3b512f 100644 --- a/integrations/integration_test.go +++ b/integrations/integration_test.go @@ -6,8 +6,10 @@ package integrations import ( "bytes" + "database/sql" "fmt" "io" + "log" "net/http" "os" "testing" @@ -26,13 +28,7 @@ import ( var mac *macaron.Macaron func TestMain(m *testing.M) { - appIniPath := os.Getenv("GITEA_CONF") - if appIniPath == "" { - fmt.Println("Environment variable $GITEA_CONF not set") - os.Exit(1) - } - setting.CustomConf = appIniPath - routers.GlobalInit() + initIntegrationTest() mac = routes.NewMacaron() routes.RegisterRoutes(mac) @@ -59,6 +55,48 @@ func TestMain(m *testing.M) { os.Exit(m.Run()) } +func initIntegrationTest() { + if setting.CustomConf = os.Getenv("GITEA_CONF"); setting.CustomConf == "" { + fmt.Println("Environment variable $GITEA_CONF not set") + os.Exit(1) + } + + setting.NewContext() + models.LoadConfigs() + + switch { + case setting.UseMySQL: + db, err := sql.Open("mysql", fmt.Sprintf("%s:%s@tcp(%s)/", + models.DbCfg.User, models.DbCfg.Passwd, models.DbCfg.Host)) + defer db.Close() + if err != nil { + log.Fatalf("sql.Open: %v", err) + } + if _, err = db.Exec("CREATE DATABASE IF NOT EXISTS testgitea"); err != nil { + log.Fatalf("db.Exec: %v", err) + } + case setting.UsePostgreSQL: + db, err := sql.Open("postgres", fmt.Sprintf("postgres://%s:%s@%s/?sslmode=%s", + models.DbCfg.User, models.DbCfg.Passwd, models.DbCfg.Host, models.DbCfg.SSLMode)) + defer db.Close() + if err != nil { + log.Fatalf("sql.Open: %v", err) + } + rows, err := db.Query(fmt.Sprintf("SELECT 1 FROM pg_database WHERE datname = '%s'", + models.DbCfg.Name)) + if err != nil { + log.Fatalf("db.Query: %v", err) + } + if rows.Next() { + break // database already exists + } + if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil { + log.Fatalf("db.Exec: %v", err) + } + } + routers.GlobalInit() +} + func prepareTestEnv(t *testing.T) { assert.NoError(t, models.LoadFixtures()) assert.NoError(t, os.RemoveAll("integrations/gitea-integration")) diff --git a/integrations/mysql.ini b/integrations/mysql.ini index 9e121ac1e6..b15588c867 100644 --- a/integrations/mysql.ini +++ b/integrations/mysql.ini @@ -42,14 +42,14 @@ ENABLE_FEDERATED_AVATAR = false PROVIDER = file [log] -MODE = console,file +MODE = console,file +ROOT_PATH = mysql-log [log.console] LEVEL = Warn [log.file] -LEVEL = Info -ROOT_PATH = log +LEVEL = Info [security] INSTALL_LOCK = true diff --git a/integrations/pgsql.ini b/integrations/pgsql.ini index 42e29e8266..920a5190d4 100644 --- a/integrations/pgsql.ini +++ b/integrations/pgsql.ini @@ -43,13 +43,13 @@ PROVIDER = file [log] MODE = console,file +ROOT_PATH = pgsql-log [log.console] LEVEL = Warn [log.file] LEVEL = Info -ROOT_PATH = log [security] INSTALL_LOCK = true diff --git a/models/attachment_test.go b/models/attachment_test.go index 5fdac31b41..d568e39431 100644 --- a/models/attachment_test.go +++ b/models/attachment_test.go @@ -13,7 +13,7 @@ import ( func TestIncreaseDownloadCount(t *testing.T) { assert.NoError(t, PrepareTestDatabase()) - attachment, err := GetAttachmentByUUID("1234567890") + attachment, err := GetAttachmentByUUID("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11") assert.NoError(t, err) assert.Equal(t, int64(0), attachment.DownloadCount) @@ -21,7 +21,7 @@ func TestIncreaseDownloadCount(t *testing.T) { err = attachment.IncreaseDownloadCount() assert.NoError(t, err) - attachment, err = GetAttachmentByUUID("1234567890") + attachment, err = GetAttachmentByUUID("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11") assert.NoError(t, err) assert.Equal(t, int64(1), attachment.DownloadCount) } @@ -53,7 +53,7 @@ func TestDeleteAttachments(t *testing.T) { err = DeleteAttachment(&Attachment{ID: 8}, false) assert.NoError(t, err) - attachment, err := GetAttachmentByUUID("test-12345") + attachment, err := GetAttachmentByUUID("a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18") assert.Error(t, err) assert.True(t, IsErrAttachmentNotExist(err)) assert.Nil(t, attachment) diff --git a/models/fixtures/attachment.yml b/models/fixtures/attachment.yml index 99bd5453ee..f196aa4ea6 100644 --- a/models/fixtures/attachment.yml +++ b/models/fixtures/attachment.yml @@ -1,6 +1,6 @@ - id: 1 - uuid: 1234567890 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 issue_id: 1 comment_id: 0 name: attach1 @@ -9,7 +9,7 @@ - id: 2 - uuid: 1122334455 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12 issue_id: 1 comment_id: 0 name: attach2 @@ -18,7 +18,7 @@ - id: 3 - uuid: comment-id-1 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13 issue_id: 2 comment_id: 1 name: attach1 @@ -27,7 +27,7 @@ - id: 4 - uuid: comment-id-2 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14 issue_id: 3 comment_id: 1 name: attach2 @@ -36,7 +36,7 @@ - id: 5 - uuid: comment-id-3 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a15 issue_id: 4 comment_id: 0 name: attach1 @@ -45,7 +45,7 @@ - id: 6 - uuid: comment-id-4 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a16 issue_id: 5 comment_id: 2 name: attach1 @@ -54,7 +54,7 @@ - id: 7 - uuid: comment-id-5 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17 issue_id: 5 comment_id: 2 name: attach1 @@ -63,7 +63,7 @@ - id: 8 - uuid: test-12345 + uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18 issue_id: 6 comment_id: 0 name: attach1 diff --git a/models/fixtures/pull_request.yml b/models/fixtures/pull_request.yml index 7946a0f8f7..d8313f9f90 100644 --- a/models/fixtures/pull_request.yml +++ b/models/fixtures/pull_request.yml @@ -16,7 +16,7 @@ - id: 2 type: 0 # gitea pull request - status: 1 # checking + status: 2 # mergable issue_id: 3 index: 3 head_repo_id: 1 |