Lunny Xiao be0f7ff9bf Fix team user api (#8172) 1 day ago
..
gitea-repositories-meta 72f6d5c882 Restrict repository indexing by glob match (#7767) 5 days ago
migration-test f83db078f0 Move database settings from models to setting (#7806) 3 weeks ago
README.md 4090204944 CN translation of README (#5050) 11 months ago
README_ZH.md 4090204944 CN translation of README (#5050) 11 months ago
api_admin_org_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 months ago
api_admin_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_branch_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_comment_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_fork_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_gpg_keys_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_helper_for_declarative_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
api_issue_label_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_issue_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_keys_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
api_org_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 months ago
api_pull_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_releases_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_repo_edit_test.go 12a098920c Fixed ineffectual assignments in tests (#7553) 1 month ago
api_repo_file_create_test.go cd96dee982 Fixes #7292 - API File Contents bug (#7301) 2 months ago
api_repo_file_delete_test.go 002b597c1f Fixes #7152 - Allow create/update/delete message to be empty, use default message (#7324) 2 months ago
api_repo_file_helpers.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_repo_file_update_test.go cd96dee982 Fixes #7292 - API File Contents bug (#7301) 2 months ago
api_repo_get_contents_list_test.go cd96dee982 Fixes #7292 - API File Contents bug (#7301) 2 months ago
api_repo_get_contents_test.go cd96dee982 Fixes #7292 - API File Contents bug (#7301) 2 months ago
api_repo_git_blobs_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_repo_git_commits_test.go 042089fbaf API method to list all commits of a repository (#6408) 3 weeks ago
api_repo_git_hook_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_repo_git_ref_test.go 08bf443016 Implement git refs API for listing references (branches, tags and other) (#5354) 9 months ago
api_repo_git_tags_test.go 8de0b0a3f0 Fixes #2738 - Adds the /git/tags API endpoint (#7138) 3 months ago
api_repo_git_trees_test.go 2262811e40 Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 5 months ago
api_repo_lfs_locks_test.go c2c35d169c lfs/lock: round locked_at timestamp to second (#7872) 1 month ago
api_repo_raw_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 1 year ago
api_repo_tags_test.go 8de0b0a3f0 Fixes #2738 - Adds the /git/tags API endpoint (#7138) 3 months ago
api_repo_test.go 72f6d5c882 Restrict repository indexing by glob match (#7767) 5 days ago
api_repo_topic_test.go 1f951cdeba Add API endpoint for accessing repo topics (#7963) 1 week ago
api_team_test.go 12a098920c Fixed ineffectual assignments in tests (#7553) 1 month ago
api_team_user_test.go be0f7ff9bf Fix team user api (#8172) 1 day ago
api_token_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
api_user_heatmap_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
api_user_orgs_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 months ago
api_user_search_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
auth_ldap_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
benchmarks_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 4 months ago
branches_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
change_default_branch_test.go f1adaef458 Less verbose integration tests (#2123) 2 years ago
cors_test.go 34d06f4c6b Handle CORS requests (#6289) 4 months ago
create_no_session_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
delete_user_test.go 099372d76c Refactor User Settings (#3900) 1 year ago
download_test.go 2a03e96bce Allow markdown files to read from the LFS (#5787) 7 months ago
editor_test.go f9ec2f89f2 Add golangci (#6418) 3 months ago
empty_repo_test.go 07802a2bc5 Refactor repo.isBare to repo.isEmpty #5629 (#5714) 8 months ago
explore_repos_test.go aec826b023 fix template error on explore repos (#2319) 2 years ago
git_helper_for_declarative_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
git_test.go baefea311f Fix #732: Add LFS objects to base repository on merging (#7082) 2 months ago
html_helper.go d02566a8ea integration tests: Use t.Helper() (#7654) 1 month ago
integration_test.go f83db078f0 Move database settings from models to setting (#7806) 3 weeks ago
issue_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
lfs_getobject_test.go f83db078f0 Move database settings from models to setting (#7806) 3 weeks ago
links_test.go 743697a549 refactor: append, build variable and type switch (#4940) 3 months ago
mssql.ini.tmpl d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
mysql.ini.tmpl d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
mysql8.ini.tmpl d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
nonascii_branches_test.go bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810) 1 year ago
oauth_test.go 62d3f49c28 Add json tags for oauth2 form (#6627) 5 months ago
org_test.go 68a83cc5a2 Allow collaborators to view repo owned private org (#6965) 4 months ago
pgsql.ini.tmpl d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
pull_compare_test.go 3d3faa2624 Responsive view (#2750) 1 year ago
pull_create_test.go 765be70323 Make CI work (#8057) 2 weeks ago
pull_merge_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
pull_review_test.go 2382f1b057 fix 500 when reviewer is deleted with integration tests (#6856) 4 months ago
pull_status_test.go 3ac45e3cb5 Fix pull creation with empty changes (#7920) 3 weeks ago
release_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
repo_activity_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 4 months ago
repo_branch_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
repo_commits_search_test.go ee11974719 Search Commits via Commit Hash (#7400) 1 week ago
repo_commits_test.go 2b6f45299d api: fix multiple bugs with statuses endpoints (#7785) 1 month ago
repo_fork_test.go e59adcde65 Use httptest in integration tests (#3080) 1 year ago
repo_migrate_test.go cc7b8e3379 Add more bench (#3161) 1 year ago
repo_search_test.go 72f6d5c882 Restrict repository indexing by glob match (#7767) 5 days ago
repo_test.go d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
repofiles_delete_test.go 002b597c1f Fixes #7152 - Allow create/update/delete message to be empty, use default message (#7324) 2 months ago
repofiles_update_test.go cd96dee982 Fixes #7292 - API File Contents bug (#7301) 2 months ago
setting_test.go 094263db4d Show email if the authenticated user owns the profile page being requested for (#4981) 6 months ago
signin_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
signout_test.go 5abd1d2a68 Add integration test for logging out (#2892) 1 year ago
signup_test.go f1adaef458 Less verbose integration tests (#2123) 2 years ago
sqlite.ini d0ec940dd7 switch to use gliderlabs/ssh for builtin server (#7250) 2 months ago
ssh_key_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
testlogger.go f9ec2f89f2 Add golangci (#6418) 3 months ago
timetracking_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
user_test.go 171b359877 Use gitea forked macaron (#7933) 3 weeks ago
version_test.go 54d96c79b5 Removed unnecessary conversions (#7557) 1 month ago
xss_test.go 1fdf560678 Added user language setting (#3875) 1 year ago

README.md

Integrations tests

Integration tests can be run with make commands for the appropriate backends, namely:

make test-mysql
make test-pgsql
make test-sqlite

Make sure to perform a clean build before running tests:

make clean build

Run all tests via local drone

drone exec --local --build-event "pull_request"

Run sqlite integrations tests

Start tests

make test-sqlite

Run mysql integrations tests

Setup a mysql database inside docker

docker run -e "MYSQL_DATABASE=test" -e "MYSQL_ALLOW_EMPTY_PASSWORD=yes" --rm --name mysql mysql:5.7 #(just ctrl-c to stop db and clean the container) 

Start tests based on the database container

TEST_MYSQL_HOST="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql):3306" TEST_MYSQL_DBNAME=test TEST_MYSQL_USERNAME=root TEST_MYSQL_PASSWORD='' make test-mysql

Run pgsql integrations tests

Setup a pgsql database inside docker

docker run -e "POSTGRES_DB=test" --rm --name pgsql postgres:9.5 #(just ctrl-c to stop db and clean the container) 

Start tests based on the database container

TEST_PGSQL_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql) TEST_PGSQL_DBNAME=test TEST_PGSQL_USERNAME=postgres TEST_PGSQL_PASSWORD=postgres make test-pgsql

Running individual tests

Example command to run GPG test with sqlite backend:

go test -c code.gitea.io/gitea/integrations \
  -o integrations.sqlite.test -tags 'sqlite' &&
  GITEA_ROOT="$GOPATH/src/code.gitea.io/gitea" \
  GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test \
  -test.v -test.run GPG