summaryrefslogtreecommitdiffstats
path: root/integrations/git_helper_for_declarative_test.go
Commit message (Collapse)AuthorAgeFilesLines
* Fix partial cloning a repo (#18373) (#18377)Gusted2022-01-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | * Fix partial cloning a repo (#18373) - Backport from: #18373 - Backport isn't 1-1, because the frontport had a refactor in that area, which v1.16 doesn't have. * Include diff & use copy * Add partial clone test * patch * Apply suggestions from code review * globalArgs first * avoid copy but make GlobalCMDArgs append first * please linter Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Make test work with different default branch config (#18038)mscherer2021-12-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * Make test work with different default branch config On a system configured with a different default branch name, doGitInitTestRepository will create a repository with a branch named differently, and so further tests would break: --- FAIL: TestGit/HTTP/PushCreate/SuccessfullyPushAndCreateTestRepository (0.02s) git_helper_for_declarative_test.go:167: Error Trace: git_helper_for_declarative_test.go:167 Error: Received unexpected error: exit status 1 - error: src refspec master does not match any error: failed to push some refs to 'http://127.0.0.1:3003/user2/repo-tmp-push-create-http.git' Test: TestGit/HTTP/PushCreate/SuccessfullyPushAndCreateTestRepository git_test.go:587: Error Trace: git_test.go:587 Error: Received unexpected error: repository does not exist [id: 0, uid: 0, owner_name: user2, name: repo-tmp-push-create-http] Test: TestGit/HTTP/PushCreate * Update integrations/git_helper_for_declarative_test.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix ipv6 parsing for builtin ssh server (#17561)Wim2021-11-061-1/+2
|
* refactor: move from io/ioutil to io and os package (#17109)Eng Zer Jun2021-09-221-5/+4
| | | | | | | | | The io/ioutil package has been deprecated as of Go 1.16, see https://golang.org/doc/go1.16#ioutil. This commit replaces the existing io/ioutil functions with their new definitions in io and os packages. Signed-off-by: Eng Zer Jun <engzerjun@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix Benchmark tests, remove a broken one & add two new (#15250)65432021-04-161-1/+7
| | | | | | | | | | | | | | | * Benchmark Integration TESTS * CI: add benching-arm64 pipeline * BenchmarkRepo: name test case tests * Fix BenchmarkRepoBranchCommit beside Create new Branch * CI: benching use amd64 * rm total broken "BenchmarkRepo" * dont run benchmark in CI
* migrate from com.* to alternatives (#14103)65432020-12-251-3/+6
| | | | | | | | | | | | | | | * remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
* Migrations: Use Process Manager to create own Context (#13792)65432020-12-021-1/+1
|
* Introduce go chi web framework as frontend of macaron, so that we can move ↵Lunny Xiao2020-11-131-1/+1
| | | | | | | | | routes from macaron to chi step by step (#7420) * When route cannot be found on chi, go to macaron * Stick chi version to 1.5.0 * Follow router log setting
* Re-attempt to delete temporary upload if the file is locked by another ↵zeripath2020-08-111-2/+3
| | | | | | | | | | | process (#12447) Replace all calls to os.Remove/os.RemoveAll by retrying util.Remove/util.RemoveAll and remove circular dependencies from util. Fix #12339 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
* Make the PushCreate test declarative (#11229)zeripath2020-04-281-3/+6
| | | | | | | | | | | | Reduce the code duplication in the PushCreate test and switch to a declarative format. * Instead of explicitly creating the repository re-use functions from the other declarative tests and add comments * Ensure that the test repository is deleted at the end of test * Slightly reorder the sub-tests Also reduce the code duplication in MergeFork and add some comments there too and make doGitCloneFail be self-contained. Signed-off-by: Andrew Thornton art27@cantab.net
* Fix the intermittent TestGPGGit failures (#9360)zeripath2019-12-151-0/+6
| | | | | | * Fix the intermittent TestGPGGit failures Reattempt to open the listener if the port is busy with a delay up to a second Switch from generating a private key each time, just use a known good key
* Missed defer prepareTestEnv (#9285)zeripath2019-12-081-1/+1
| | | | | | * onGiteaRun should defer the cleanup from prepareTestEnv * Some more missed defers
* Fix datarace on git.GlobalCommandArgs on tests (#9162)Lunny Xiao2019-11-271-13/+4
| | | | | | | | | | * fix datarace on git.GlobalCommandArgs on tests * fix tests * fix tests * fix tests
* Yet another attempt to fix the intermittent failure of gpg git test (#9146)zeripath2019-11-261-0/+1
| | | | | | | | | | * Yet another attempt to fix the race in gpg_git_test * add some fail nows * Need to set preparetestenv * Ensure that http messages go to the correct server
* Fix intermittent GPG Git test failure (#8968)zeripath2019-11-131-2/+4
|
* Restore functionality for early gits (#7775)zeripath2019-10-121-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | * Change tests to make it possible to run TestGit with 1.7.2 * Make merge run on 1.7.2 * Fix tracking and staging branch name problem * Ensure that git 1.7.2 works on tests * ensure that there is no chance for conflicts * Fix-up missing merge issues * Final rm * Ensure LFS filters run on the tests * Do not sign commits from temp repo * Restore tracking fetch change * Apply suggestions from code review * Update modules/repofiles/temp_repo.go
* Use gitea forked macaron (#7933)Tamal Saha2019-08-231-1/+2
| | | Signed-off-by: Tamal Saha <tamal@appscode.com>
* Reduce quote usage to bypass bug in GIT_SSH_COMMAND (#7893)guillep2k2019-08-161-1/+1
|
* Fix local runs of ssh-requiring integration tests (#7855)zeripath2019-08-141-7/+11
|
* Improve git test (#7086)zeripath2019-05-311-4/+32
| | | | | * Ensure that the lfs files are created with a different prefix * Reduce the replication in git_test.go
* Quieter Integration Tests (#6513)zeripath2019-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Rename BaseLogger to WriterLogger to help the creation of other providers * Don't export ColorBytes and ResetBytes from ColoredValues * Make integration tests only print logs if they fail * check can color before coloring * I always forget about MSSQL * Oh and use LEVEL in sqlite.ini * Make the test logger log at info - as it means you see the router * Remove empty expected changes * Make the migrations quieter too * Don't display SQL on error - it can be looked at in the file logs if necessary * Fix skip when using onGiteaRun
* move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364)Lunny Xiao2019-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move code.gitea.io/git to code.gitea.io/gitea/modules/git * fix imports * fix fmt * fix misspell * remove wrong tests data * fix unit tests * fix tests * fix tests * fix tests * fix tests * fix tests * enable Debug to trace the failure tests * fix tests * fix tests * fix tests * fix tests * fix tests * comment commit count tests since git clone depth is 50 * fix tests * update from code.gitea.io/git * revert change to makefile
* use native golang SSH library but ssh-keygen when enable built-in SSH server ↵Lunny Xiao2019-02-071-2/+2
| | | | | | | | to remove dependent on that command lines (#5976) * use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines * fix tests and add comment head
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-031-0/+127
1. A key can either be an ssh user key or a deploy key. It cannot be both. 2. If a key is a user key - it can only be associated with one user. 3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different. 4. If a repository is deleted, its deploy keys must be deleted too. We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints: - [x] You should not be able to add the same user key as another user - [x] You should not be able to add a ssh user key which is being used as a deploy key - [x] You should not be able to add a ssh deploy key which is being used as a user key - [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode. - [x] If you delete a repository you must delete all its deploy keys. Fix #1357