John Olheiser 8f0182c322 API error cleanup (#7186) 1 week ago
..
gitea-repositories-meta 9f18b23129 Fix 404 when send pull request some situation (#6871) 1 month ago
migration-test f9ec2f89f2 Add golangci (#6418) 1 week ago
README.md 4090204944 CN translation of README (#5050) 8 months ago
README_ZH.md 4090204944 CN translation of README (#5050) 8 months ago
api_admin_org_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 weeks ago
api_admin_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_branch_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_comment_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_fork_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_gpg_keys_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_helper_for_declarative_test.go fb4438a815 Improve git test (#7086) 2 weeks ago
api_issue_label_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_issue_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_keys_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_org_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 weeks ago
api_pull_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_releases_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_repo_edit_test.go 1831b3b571 Fixes #5960 - Adds API Endpoint for Repo Edit (#7006) 3 weeks ago
api_repo_file_content_test.go 8f0182c322 API error cleanup (#7186) 1 week ago
api_repo_file_create_test.go 8f0182c322 API error cleanup (#7186) 1 week ago
api_repo_file_delete_test.go 8f0182c322 API error cleanup (#7186) 1 week ago
api_repo_file_helpers.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_repo_file_update_test.go 8f0182c322 API error cleanup (#7186) 1 week ago
api_repo_git_blobs_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_repo_git_commits_test.go ecefa9e724 Add single commit API support (#5843) 4 months ago
api_repo_git_hook_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_repo_git_ref_test.go 08bf443016 Implement git refs API for listing references (branches, tags and other) (#5354) 6 months ago
api_repo_git_tags_test.go 8de0b0a3f0 Fixes #2738 - Adds the /git/tags API endpoint (#7138) 1 week ago
api_repo_git_trees_test.go 2262811e40 Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 2 months ago
api_repo_lfs_locks_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_repo_raw_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 9 months ago
api_repo_tags_test.go 8de0b0a3f0 Fixes #2738 - Adds the /git/tags API endpoint (#7138) 1 week ago
api_repo_test.go 56ae539bed SearchRepositoryByName improvements and unification (#6897) 1 month ago
api_team_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_token_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
api_user_heatmap_test.go 6759237eda User action heatmap (#5131) 8 months ago
api_user_orgs_test.go 43cf2f3b55 Fixes #7023 - API Org Visibility (#7028) 3 weeks ago
api_user_search_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
auth_ldap_test.go 22ad514297 Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094) 7 months ago
benchmarks_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
branches_test.go f9ec2f89f2 Add golangci (#6418) 1 week ago
change_default_branch_test.go f1adaef458 Less verbose integration tests (#2123) 1 year ago
cors_test.go 34d06f4c6b Handle CORS requests (#6289) 1 month ago
create_no_session_test.go b33f7f792b Prevent creating empty sessions (#6677) 2 months 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) 4 months ago
editor_test.go f9ec2f89f2 Add golangci (#6418) 1 week ago
empty_repo_test.go 07802a2bc5 Refactor repo.isBare to repo.isEmpty #5629 (#5714) 5 months ago
explore_repos_test.go aec826b023 fix template error on explore repos (#2319) 1 year ago
git_helper_for_declarative_test.go fb4438a815 Improve git test (#7086) 2 weeks ago
git_test.go fb4438a815 Improve git test (#7086) 2 weeks ago
html_helper.go e59adcde65 Use httptest in integration tests (#3080) 1 year ago
integration_test.go f9ec2f89f2 Add golangci (#6418) 1 week ago
issue_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
lfs_getobject_test.go f9ec2f89f2 Add golangci (#6418) 1 week ago
links_test.go 743697a549 refactor: append, build variable and type switch (#4940) 3 weeks ago
mssql.ini.tmpl 5422f23ed8 Quieter Integration Tests (#6513) 2 months ago
mysql.ini.tmpl 5422f23ed8 Quieter Integration Tests (#6513) 2 months ago
mysql8.ini.tmpl 5422f23ed8 Quieter Integration Tests (#6513) 2 months ago
nonascii_branches_test.go bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810) 9 months ago
oauth_test.go 62d3f49c28 Add json tags for oauth2 form (#6627) 2 months ago
org_test.go 68a83cc5a2 Allow collaborators to view repo owned private org (#6965) 1 month ago
pgsql.ini.tmpl 5422f23ed8 Quieter Integration Tests (#6513) 2 months ago
pull_compare_test.go 3d3faa2624 Responsive view (#2750) 1 year ago
pull_create_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
pull_merge_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
pull_review_test.go 2382f1b057 fix 500 when reviewer is deleted with integration tests (#6856) 1 month ago
pull_status_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
release_test.go f5fa22a499 Fix prohibit login check on authorization (#6106) 4 months ago
repo_activity_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
repo_branch_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
repo_commits_search_test.go 3186ef554c Support search operators for commits search (#6479) 2 months ago
repo_commits_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 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 54bd63cd5c Change UpdateRepoIndex api to include watchers (#7012) 4 weeks ago
repo_test.go d9d538c8a1 Refactor table width to have more info shown in file list (#6867) 1 month ago
repofiles_delete_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
repofiles_update_test.go ce8de35334 Remove local clones & make hooks run on merge/edit/upload (#6672) 1 month ago
setting_test.go 094263db4d Show email if the authenticated user owns the profile page being requested for (#4981) 4 months ago
signin_test.go 8aadf79f80 Add integration tests for signin (#2363) 1 year ago
signout_test.go 5abd1d2a68 Add integration test for logging out (#2892) 1 year ago
signup_test.go f1adaef458 Less verbose integration tests (#2123) 1 year ago
sqlite.ini 5422f23ed8 Quieter Integration Tests (#6513) 2 months ago
ssh_key_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 1 month ago
testlogger.go f9ec2f89f2 Add golangci (#6418) 1 week ago
timetracking_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
user_test.go d699de32f2 add .gpg url (match github behaviour) (#6610) 2 months ago
version_test.go 34eee25bd4 Move sdk structs to modules/structs (#6905) 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