mrsdizzie ca46385637 Clean up various use of escape/unescape functions for URL generation (#6334) 1 day ago
..
gitea-repositories-meta 3b7f41f9f7 Fix serving of raw wiki files other than .md (#5814) 1 month ago
migration-test 8917d66571 Add migration test (#5773) 1 month ago
README.md 4090204944 CN translation of README (#5050) 5 months ago
README_ZH.md 4090204944 CN translation of README (#5050) 5 months ago
api_admin_test.go 7096085f2b Fix #5226 by adding CSRF checking to api reqToken and add CSRF to the POST header for deadline (#5250) 4 months ago
api_branch_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_comment_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_fork_test.go 93a1de4842 Fix repo API bug (#2133) 1 year ago
api_gpg_keys_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_helper_for_declarative_test.go 01c10a951b Fix ssh deploy and user key constraints (#1357) (#5939) 1 month ago
api_issue_label_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_issue_test.go ea20adaa84 feat(repo): support search repository by topic name (#4505) 6 months ago
api_keys_test.go 00533d3870 Keys API changes (#4960) 4 months ago
api_org_test.go 8ef177f8c5 add api for user to create org (#5268) 3 months ago
api_pull_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_releases_test.go fada6968a8 Fix new release creation API to allow empty target (#5870) 1 month ago
api_repo_git_commits_test.go ecefa9e724 Add single commit API support (#5843) 1 month ago
api_repo_git_ref_test.go 08bf443016 Implement git refs API for listing references (branches, tags and other) (#5354) 3 months ago
api_repo_lfs_locks_test.go 9e842c8a72 Fix SSH auth lfs locks (#3152) 1 year ago
api_repo_raw_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_repo_tags_test.go 01bbf5ea69 Add API to list tags (#5850) 1 month ago
api_repo_test.go 583968f274 Return 409 when creating repo if it already exists. (#6330) 4 days ago
api_team_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months ago
api_token_test.go ab55ca7ebd Add ability to delete a token (#4235) 8 months ago
api_user_heatmap_test.go 6759237eda User action heatmap (#5131) 4 months ago
api_user_orgs_test.go 44371b96f5 Ensure valid git author names passed in signatures (#5774) 1 month ago
auth_ldap_test.go 22ad514297 Fix issue where ecdsa and other key types are not synced from LDAP (#5092) (#5094) 4 months ago
benchmarks_test.go 9a33798b30 Fix type mismatch of format string (#5574) 2 months ago
branches_test.go e59adcde65 Use httptest in integration tests (#3080) 1 year ago
change_default_branch_test.go f1adaef458 Less verbose integration tests (#2123) 1 year ago
delete_user_test.go 099372d76c Refactor User Settings (#3900) 10 months ago
download_test.go 2a03e96bce Allow markdown files to read from the LFS (#5787) 1 month ago
editor_test.go bac6d05e78 Improve English grammar and consistency. (#3614) 11 months ago
empty_repo_test.go 07802a2bc5 Refactor repo.isBare to repo.isEmpty #5629 (#5714) 2 months ago
explore_repos_test.go aec826b023 fix template error on explore repos (#2319) 1 year ago
git_helper_for_declarative_test.go 2d213b64d1 use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines (#5976) 1 month ago
git_test.go 2a03e96bce Allow markdown files to read from the LFS (#5787) 1 month ago
html_helper.go e59adcde65 Use httptest in integration tests (#3080) 1 year ago
integration_test.go 2a03e96bce Allow markdown files to read from the LFS (#5787) 1 month ago
internal_test.go ca46385637 Clean up various use of escape/unescape functions for URL generation (#6334) 1 day ago
issue_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
lfs_getobject_test.go 7d434376f1 Pooled and buffered gzip implementation (#5722) 1 month ago
links_test.go 099372d76c Refactor User Settings (#3900) 10 months ago
mssql.ini.tmpl 3d91bb2f2d Make log mailer for testing (#5893) 1 month ago
mysql.ini.tmpl 3d91bb2f2d Make log mailer for testing (#5893) 1 month ago
mysql8.ini.tmpl 4a6b011b15 Add test environment for Mysql8 (#5234) 2 days ago
nonascii_branches_test.go bf55276189 Fix redirect with non-ascii branch names (#4764) (#4810) 6 months ago
oauth_test.go 2315019fef Add support for client basic auth for exchanging access tokens (#6293) 1 week ago
pgsql.ini.tmpl 3d91bb2f2d Make log mailer for testing (#5893) 1 month ago
pull_compare_test.go 3d3faa2624 Responsive view (#2750) 1 year ago
pull_create_test.go d26d249748 Minor UI tweaks (#5980) 4 weeks ago
pull_merge_test.go 4a685f8b87 Add rebase with merge commit merge style (#3844) (#4052) 2 months ago
release_test.go f5fa22a499 Fix prohibit login check on authorization (#6106) 4 weeks ago
repo_activity_test.go ae30315a62 Fix escaping changed title in comments (#3530) 1 year ago
repo_branch_test.go cc7b8e3379 Add more bench (#3161) 1 year ago
repo_commits_test.go e47df0b301 Enforce token on api routes [fixed critical security issue #4357] (#4840) 6 months 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 5866eb2321 Code/repo search (#2582) 1 year ago
repo_test.go f5fa22a499 Fix prohibit login check on authorization (#6106) 4 weeks ago
setting_test.go 094263db4d Show email if the authenticated user owns the profile page being requested for (#4981) 4 weeks 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 3d91bb2f2d Make log mailer for testing (#5893) 1 month ago
ssh_key_test.go 01c10a951b Fix ssh deploy and user key constraints (#1357) (#5939) 1 month ago
timetracking_test.go befa7445d2 Unit tests for routers/repo/issue_label (#3198) 1 year ago
user_test.go 44371b96f5 Ensure valid git author names passed in signatures (#5774) 1 month ago
version_test.go a4cd4616c6 Update hard-coded version to 1.3.0-dev (#2390) 1 year ago
xss_test.go 1fdf560678 Added user language setting (#3875) 10 months 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