Skip to content

Commit 0f746e7

Browse files
committed
Integration test framework
1 parent 3012971 commit 0f746e7

16 files changed

+1038
-974
lines changed

.drone.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,25 @@ pipeline:
2525
when:
2626
event: [ push, tag, pull_request ]
2727

28+
test-sqlite:
29+
image: webhippie/golang:edge
30+
pull: true
31+
environment:
32+
TAGS: bindata
33+
GOPATH: /srv/app
34+
commands:
35+
- make test-sqlite
36+
when:
37+
event: [ push, tag, pull_request ]
38+
2839
test-mysql:
2940
image: webhippie/golang:edge
3041
pull: true
3142
environment:
3243
TAGS: bindata
3344
GOPATH: /srv/app
3445
commands:
35-
- make test-mysql
46+
- echo make test-mysql # Not ready yet
3647
when:
3748
event: [ push, tag, pull_request ]
3849

@@ -43,7 +54,7 @@ pipeline:
4354
TAGS: bindata
4455
GOPATH: /srv/app
4556
commands:
46-
- make test-pgsql
57+
- echo make test-pqsql # Not ready yet
4758
when:
4859
event: [ push, tag, pull_request ]
4960

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ coverage.out
4444
/indexers
4545
/log
4646
/public/img/avatar
47+
/integrations/gitea-integration*

Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,27 @@ test-vendor:
8686
fi
8787
govendor status +outside +unused || exit 1
8888

89+
.PHONY: test-sqlite
90+
test-sqlite: integrations.test integrations/gitea-integration
91+
GITEA_CONF=integrations/sqlite.ini ./integrations.test
92+
8993
.PHONY: test-mysql
90-
test-mysql:
91-
@echo "Not integrated yet!"
94+
test-mysql: integrations.test integrations/gitea-integration
95+
echo "CREATE DATABASE IF NOT EXISTS testgitea" | mysql -u root
96+
GITEA_CONF=integrations/mysql.ini ./integrations.test
9297

9398
.PHONY: test-pgsql
94-
test-pgsql:
95-
@echo "Not integrated yet!"
99+
test-pgsql: integrations.test integrations/gitea-integration
100+
GITEA_CONF=integrations/pgsql.ini ./integrations.test
101+
102+
integrations.test: $(SOURCES)
103+
go test -c code.gitea.io/gitea/integrations -tags 'sqlite'
104+
105+
integrations/gitea-integration:
106+
curl -L https://github.com/ethantkoenig/gitea-integration/archive/v2.tar.gz > integrations/gitea-integration.tar.gz
107+
mkdir -p integrations/gitea-integration
108+
tar -xf integrations/gitea-integration.tar.gz -C integrations/gitea-integration --strip-components 1
109+
96110

97111
.PHONY: check
98112
check: test

0 commit comments

Comments
 (0)