Skip to content

Commit 13e63f8

Browse files
committed
tests integrations to tests integraton
1 parent a099a57 commit 13e63f8

File tree

168 files changed

+255
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+255
-254
lines changed

.gitignore

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ cpu.out
6363
/indexers
6464
/log
6565
/public/img/avatar
66-
/tests/integrations/gitea-integration-mysql
67-
/tests/integrations/gitea-integration-mysql8
68-
/tests/integrations/gitea-integration-pgsql
69-
/tests/integrations/gitea-integration-sqlite
70-
/tests/integrations/gitea-integration-mssql
71-
/tests/integrations/indexers-mysql
72-
/tests/integrations/indexers-mysql8
73-
/tests/integrations/indexers-pgsql
74-
/tests/integrations/indexers-sqlite
75-
/tests/integrations/indexers-mssql
66+
/tests/integration/gitea-integration-mysql
67+
/tests/integration/gitea-integration-mysql8
68+
/tests/integration/gitea-integration-pgsql
69+
/tests/integration/gitea-integration-sqlite
70+
/tests/integration/gitea-integration-mssql
71+
/tests/integration/indexers-mysql
72+
/tests/integration/indexers-mysql8
73+
/tests/integration/indexers-pgsql
74+
/tests/integration/indexers-sqlite
75+
/tests/integration/indexers-mssql
7676
/tests/sqlite.ini
7777
/tests/mysql.ini
7878
/tests/mysql8.ini

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ Here's how to run the test suite:
8686
| | |
8787
| :------------------------------------- | :----------------------------------------------- |
8888
|``make test[\#TestSpecificName]`` | run unit test |
89-
|``make test-sqlite[\#TestSpecificName]``| run [integration](integrations) test for SQLite |
90-
|[More details about integrations](integrations/README.md) |
89+
|``make test-sqlite[\#TestSpecificName]``| run [integration](tests/integration) test for SQLite |
90+
|[More details about integrations](tests/integration/README.md) |
9191

9292
## Vendoring
9393

@@ -167,7 +167,7 @@ import (
167167

168168
To maintain understandable code and avoid circular dependencies it is important to have a good structure of the code. The Gitea code is divided into the following parts:
169169

170-
- **integration:** Integrations tests
170+
- **integration:** Integration tests
171171
- **models:** Contains the data structures used by xorm to construct database tables. It also contains supporting functions to query and update the database. Dependencies to other code in Gitea should be avoided although some modules might be needed (for example for logging).
172172
- **models/fixtures:** Sample model data used in integration tests.
173173
- **models/migrations:** Handling of database migrations between versions. PRs that changes a database structure shall also have a migration step.

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
9999

100100
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
101101

102-
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/tests/integrations/migration-test code.gitea.io/gitea/tests/integrations code.gitea.io/gitea/tests,$(shell $(GO) list ./... | grep -v /vendor/))
102+
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests,$(shell $(GO) list ./... | grep -v /vendor/))
103103

104104
FOMANTIC_WORK_DIR := web_src/fomantic
105105

@@ -242,9 +242,9 @@ clean:
242242
$(GO) clean -i ./...
243243
rm -rf $(EXECUTABLE) $(DIST) $(BINDATA_DEST) $(BINDATA_HASH) \
244244
integrations*.test \
245-
tests/integrations/gitea-integration-pgsql/ tests/integrations/gitea-integration-mysql/ tests/integrations/gitea-integration-mysql8/ tests/integrations/gitea-integration-sqlite/ \
246-
tests/integrations/gitea-integration-mssql/ tests/integrations/indexers-mysql/ tests/integrations/indexers-mysql8/ tests/integrations/indexers-pgsql tests/integrations/indexers-sqlite \
247-
tests/integrations/indexers-mssql tests/mysql.ini tests/mysql8.ini tests/pgsql.ini tests/mssql.ini man/
245+
tests/integration/gitea-integration-pgsql/ tests/integration/gitea-integration-mysql/ tests/integration/gitea-integration-mysql8/ tests/integration/gitea-integration-sqlite/ \
246+
tests/integration/gitea-integration-mssql/ tests/integration/indexers-mysql/ tests/integration/indexers-mysql8/ tests/integration/indexers-pgsql tests/integration/indexers-sqlite \
247+
tests/integration/indexers-mssql tests/mysql.ini tests/mysql8.ini tests/pgsql.ini tests/mssql.ini man/
248248

249249
.PHONY: fmt
250250
fmt:
@@ -589,45 +589,45 @@ integration-test-coverage-sqlite: integrations.cover.sqlite.test generate-ini-sq
589589
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.cover.sqlite.test -test.coverprofile=integration.coverage.out
590590

591591
integrations.mysql.test: git-check $(GO_SOURCES)
592-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -o integrations.mysql.test
592+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql.test
593593

594594
integrations.mysql8.test: git-check $(GO_SOURCES)
595-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -o integrations.mysql8.test
595+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mysql8.test
596596

597597
integrations.pgsql.test: git-check $(GO_SOURCES)
598-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -o integrations.pgsql.test
598+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.pgsql.test
599599

600600
integrations.mssql.test: git-check $(GO_SOURCES)
601-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -o integrations.mssql.test
601+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.mssql.test
602602

603603
integrations.sqlite.test: git-check $(GO_SOURCES)
604-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -o integrations.sqlite.test -tags '$(TEST_TAGS)'
604+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
605605

606606
integrations.cover.test: git-check $(GO_SOURCES)
607-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
607+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
608608

609609
integrations.cover.sqlite.test: git-check $(GO_SOURCES)
610-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
610+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
611611

612612
.PHONY: migrations.mysql.test
613613
migrations.mysql.test: $(GO_SOURCES)
614-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations/migration-test -o migrations.mysql.test
614+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
615615

616616
.PHONY: migrations.mysql8.test
617617
migrations.mysql8.test: $(GO_SOURCES)
618-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations/migration-test -o migrations.mysql8.test
618+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql8.test
619619

620620
.PHONY: migrations.pgsql.test
621621
migrations.pgsql.test: $(GO_SOURCES)
622-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations/migration-test -o migrations.pgsql.test
622+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
623623

624624
.PHONY: migrations.mssql.test
625625
migrations.mssql.test: $(GO_SOURCES)
626-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations/migration-test -o migrations.mssql.test
626+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mssql.test
627627

628628
.PHONY: migrations.sqlite.test
629629
migrations.sqlite.test: $(GO_SOURCES)
630-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integrations/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
630+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
631631

632632
.PHONY: migrations.individual.mysql.test
633633
migrations.individual.mysql.test: $(GO_SOURCES)

docs/content/doc/developers/guidelines-backend.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ To maintain understandable code and avoid circular dependencies it is important
3333

3434
- `build`: Scripts to help build Gitea.
3535
- `cmd`: All Gitea actual sub commands includes web, doctor, serv, hooks, admin and etc. `web` will start the web service. `serv` and `hooks` will be invoked by Git or OpenSSH. Other sub commands could help to maintain Gitea.
36-
- `integrations`: Integration tests
36+
- `tests`: Tests
37+
- `tests/integration`: Integration tests
3738
- `models`: Contains the data structures used by xorm to construct database tables. It also contains functions to query and update the database. Dependencies to other Gitea code should be avoided. You can make exceptions in cases such as logging.
3839
- `models/db`: Basic database operations. All other `models/xxx` packages should depend on this package. The `GetEngine` function should only be invoked from `models/`.
3940
- `models/fixtures`: Sample data used in unit tests and integration tests. One `yml` file means one table which will be loaded into database when beginning the tests.

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ will run the integration tests in an SQLite environment. Integration tests
309309
require `git lfs` to be installed. Other database tests are available but
310310
may need adjustment to the local environment.
311311

312-
Take a look at [`tests/integrations/README.md`](https://github.com/go-gitea/gitea/blob/main/tests/integrations/README.md)
312+
Take a look at [`tests/integration/README.md`](https://github.com/go-gitea/gitea/blob/main/tests/integration/README.md)
313313
for more information and how to run a single test.
314314

315315

tests/integrations/README.md renamed to tests/integration/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Integrations tests
1+
# Integration tests
22

33
Integration tests can be run with make commands for the
44
appropriate backends, namely:
@@ -18,13 +18,13 @@ make clean build
1818
drone exec --local --build-event "pull_request"
1919
```
2020

21-
## Run sqlite integrations tests
21+
## Run sqlite integration tests
2222
Start tests
2323
```
2424
make test-sqlite
2525
```
2626

27-
## Run MySQL integrations tests
27+
## Run MySQL integration tests
2828
Setup a MySQL database inside docker
2929
```
3030
docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" -p 3306:3306 --rm --name mysql mysql:latest #(just ctrl-c to stop db and clean the container)
@@ -35,7 +35,7 @@ Start tests based on the database container
3535
TEST_MYSQL_HOST=localhost:3306 TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql
3636
```
3737

38-
## Run pgsql integrations tests
38+
## Run pgsql integration tests
3939
Setup a pgsql database inside docker
4040
```
4141
docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:latest #(just ctrl-c to stop db and clean the container)
@@ -45,7 +45,7 @@ Start tests based on the database container
4545
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
4646
```
4747

48-
## Run mssql integrations tests
48+
## Run mssql integration tests
4949
Setup a mssql database inside docker
5050
```
5151
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)

tests/integrations/README_ZH.md renamed to tests/integration/README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ docker run -e "POSTGRES_DB=test" -p 5432:5432 --rm --name pgsql postgres:14 #(ju
4343
TEST_PGSQL_HOST=localhost:5432 TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql
4444
```
4545

46-
## Run mssql integrations tests
46+
## Run mssql integration tests
4747
同上,首先在 docker 容器里部署一个 mssql 数据库
4848
```
4949
docker run -e "ACCEPT_EULA=Y" -e "MSSQL_PID=Standard" -e "SA_PASSWORD=MwantsaSecurePassword1" -p 1433:1433 --rm --name mssql microsoft/mssql-server-linux:latest #(just ctrl-c to stop db and clean the container)

tests/integrations/admin_user_test.go renamed to tests/integration/admin_user_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_activitypub_person_test.go renamed to tests/integration/api_activitypub_person_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"context"

tests/integrations/api_admin_org_test.go renamed to tests/integration/api_admin_org_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_admin_test.go renamed to tests/integration/api_admin_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_branch_test.go renamed to tests/integration/api_branch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_comment_test.go renamed to tests/integration/api_comment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_fork_test.go renamed to tests/integration/api_fork_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_gpg_keys_test.go renamed to tests/integration/api_gpg_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_helper_for_declarative_test.go renamed to tests/integration/api_helper_for_declarative_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"context"

tests/integrations/api_httpsig_test.go renamed to tests/integration/api_httpsig_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"encoding/base64"

tests/integrations/api_issue_label_test.go renamed to tests/integration/api_issue_label_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_issue_milestone_test.go renamed to tests/integration/api_issue_milestone_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_issue_reaction_test.go renamed to tests/integration/api_issue_reaction_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_issue_stopwatch_test.go renamed to tests/integration/api_issue_stopwatch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_issue_subscription_test.go renamed to tests/integration/api_issue_subscription_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_issue_test.go renamed to tests/integration/api_issue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_issue_tracked_time_test.go renamed to tests/integration/api_issue_tracked_time_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_keys_test.go renamed to tests/integration/api_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_nodeinfo_test.go renamed to tests/integration/api_nodeinfo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

tests/integrations/api_notification_test.go renamed to tests/integration/api_notification_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_oauth2_apps_test.go renamed to tests/integration/api_oauth2_apps_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.package models
44

5-
package integrations
5+
package integration
66

77
import (
88
"fmt"

tests/integrations/api_org_test.go renamed to tests/integration/api_org_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

5-
package integrations
5+
package integration
66

77
import (
88
"net/http"

0 commit comments

Comments
 (0)