0
Files
.devcontainer
.gitea
.github
assets
build
cmd
contrib
custom
docker
models
actions
activities
admin
asymkey
auth
avatars
db
dbfs
fixtures
git
issues
migrations
organization
packages
perm
project
pull
renderhelper
repo
secret
shared
system
unit
unittest
user
webhook
main_test.go
repo.go
repo_test.go
modules
options
public
routers
services
snap
templates
tests
tools
web_src
.air.toml
.changelog.yml
.dockerignore
.editorconfig
.envrc
.eslintrc.cjs
.gitattributes
.gitignore
.gitpod.yml
.golangci.yml
.ignore
.mailmap
.markdownlint.yaml
.npmrc
.spectral.yaml
.yamllint.yaml
BSDmakefile
CHANGELOG-archived.md
CHANGELOG.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
DCO
Dockerfile
Dockerfile.rootless
LICENSE
MAINTAINERS
Makefile
README.md
README.zh-cn.md
README.zh-tw.md
SECURITY.md
build.go
crowdin.yml
flake.lock
flake.nix
go.mod
go.sum
main.go
main_timezones.go
package-lock.json
package.json
playwright.config.ts
poetry.lock
poetry.toml
pyproject.toml
stylelint.config.js
tailwind.config.js
tsconfig.json
updates.config.js
vitest.config.ts
webpack.config.js
Lunny Xiao 673cf6af76 make writing main test easier ()
This PR removed `unittest.MainTest` the second parameter
`TestOptions.GiteaRoot`. Now it detects the root directory by current
working directory.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-28 01:38:53 +00:00

34 lines
844 B
Go

// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package models
import (
"testing"
activities_model "code.gitea.io/gitea/models/activities"
"code.gitea.io/gitea/models/organization"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
_ "code.gitea.io/gitea/models/actions"
_ "code.gitea.io/gitea/models/system"
"github.com/stretchr/testify/assert"
)
// TestFixturesAreConsistent assert that test fixtures are consistent
func TestFixturesAreConsistent(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
unittest.CheckConsistencyFor(t,
&user_model.User{},
&repo_model.Repository{},
&organization.Team{},
&activities_model.Action{})
}
func TestMain(m *testing.M) {
unittest.MainTest(m)
}