You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a public repo that i own (=> should PASS) (expect: AccessModeWrite)
a public repo that someone else owns (=> should FAIL) (expect: AccessModeRead)
a private repo that i own (=> PASS) (expect: AccessModeWrite)
a private repo that someone else owns that I have write access to (expect: AccessModeWrite)
a private repo that someone else owns that I have read access to (expect: AccessModeRead)
a private repo someone else owns that I have no access to (=> FAIL) (expect: AccessModeReadNone)
a deploy key with read only access (should FAIL) (expect: AccessModeRead)
a deploy key with write access (should PASS) (expect: AccessModeWrite)
a nonexistent repo (-> this falls into the push-to-create cases)
There are two push-to-create settings: repository.ENABLE_PUSH_CREATE_USER, and ENABLE_PUSH_CREATE_ORG; for both, the user/org needs to already exist (you can't just say 'git push git@site:randomorg/repo1.git')
a nonexistent (i.e. push-to-create) in a personal repo (=> should PASS)
a nonexistent (i.e. push-to-create) in an organization that exists that i own (=> should PASS)
a nonexistent (i.e. push-to-create) push-to-create in an organization that exists that someone else owns (=> should FAIL)
a push-to-create in an organization that doesn't exist (=> should FAIL)
pushing / pulling to a .wiki
there are basically only: None, Read or Write (there's also Admin and Owner, but those are the same as Write as far as git-annex is concerned, they only add access to a repo's settings)
A catch tho: a site Admin can write to ANY repo. so you need to set up two unprivileged users for these tests.
The permission model in Gitea is None < Read < Write < Admin < Owner; for our purposes we only need to think about None/Read/Write:
In a public repo, you might have: Read, Write
In a private repo, you might have: None, Read, Write
In a non-existent repo, you might have: None (if push to create is off) or Write (if it's on)
Here's some scripts to write and read annexes:
test-gitea-annex-write() {
REPO=$1; shift
(set -e; cd $(mktemp -d)
git init
echo '# testing' > README.md && git add README.md && git commit -m "Initial commit"
git annex init
dd if=/dev/urandom of=large.bin bs=1M count=8 && git annex add large.bin && git commit -m "Annex a file"
git remote add origin "$REPO"
git config annex.jobs 1
git annex sync --content origin
git annex sync --content origin # this has to be twice or it doesn't work right; that, or you `git push` first
)
}
test-gitea-annex-read() {
REPO=$1; shift
(set -e; cd $(mktemp -d)
git clone "$REPO" repo
cd repo
git annex get
)
}
And then maybe we'll do something like
set -e
test-gitea-annex-write git@localhost:kousu/public1.git
test-gitea-annex-write git@localhost:mastershake/public1.git && (echo 'error: write should have been blocked'; exit 1)
test-gitea-annex-write git@localhost:kousu/non-existent-1.git
test-gitea-annex-write git@localhost:my-org/non-existent-1.git
# ....
To actually set up the repos we'll have to hit the API, and then figure out how to wrap these scripts inside of Go.
I did some reconnaissance this morning to figure out how gitea handles tests currently.
The integrations/ folder seems to be where the main action is. It seems to consist solely of tests; I think unit tests are scattered through the tree, in files named _test.go, but I'm not interested in unit tests, I want to know if we can upload and download a complete annex, so I'll focus on this.
PrepareTestEnv is a helper that tests can call -- most of the tests in integrations/ call it -- which sets up the SQL database, filling it in with some test data, and copying the rest of the test data from integrations/gitea-repositories-meta/ to a (presumably empty and temporary) setting.RepoRootPath. The SQL test data is in models/fixtures/.
LFS is currently in a few files; the one closest to what I want to do with git-annex is
There's also integrations/ssh_key_test.go which is for checking some extra subtle logics around adding/removing ssh keys. I think this might be a good model to start from -- it uses the same helpers as testGit like createSSHUrl and doGitPushTestRepository, but without doing a kitchen-sink test. I'm wary of editing testGit directly -- for now I just want to test git-annex-shell's integration with gitea, not with git-lfs or other obscure features of git and it would be a lot easier especially to maintain that from a fork if I could do that in its own file that will rarely have merge conflicts.
Anyway, I think this looks good enough to get started. doGitPushTestRepository is git push -u, doGitAddRemote is git remote add ....
Plan
Figure out how to run the tests.
Especially, how do I target specific tests to run?
Add integrations/git_helper_for_declarative_test.go with helpers like doGitAnnexCopy, doGitAnnexSync, doGitAnnexInit, ...
Add integrations/annex_test.go with, to start, testGitAnnex which just uploads and downloads to a public repo over ssh
Add testGitAnnexHTTP to cover downloading from a public repo over HTTP
Add some variations to cover
private user repos
public org repos
limited org repos
private org repos
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
Add variants to test permissions -- downloading (see above) (I'm hazy on how to do this, but presumably by looking for how integrations/gitea-repositories-meta/limited_org/public_repo_on_limited_org.git gets used in the tests will show)
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
Most of the tests exist as standard Go unit tests, meaning they're in _test.go files in the same folder; so target a specific one of those, you can do e.g.
go test -v code.gitea.io/gitea/modules/git -run TestGetFullCommitID
or you can do
go test -v code.gitea.io/gitea/modules/git
to run a whole sub-folder (note to self/other golang newbies: code.gitea.io/gitea == ./ because ./go.mod declares that as that folder's namespace).
However, to test git-annex we need to set up an integration test that boots a complete gitea server + database behind it, and those have a special script (which seems a little flakey?):
TAGS="bindata sqlite sqlite_unlock_notify" make build # this is *not* a declared dependency of test-sqlite so needs to be done separately
make 'test-sqlite#TestGit'
You can also target a subtest with
make 'test-sqlite#TestGit.SSH.MergeFork'
(but not all of these actually work when run independently like this)
NB: '/'s become '.'s when targetting a subtest
$ time make 'test-sqlite#TestGit.SSH'
go test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
sed -e 's|{{REPO_TEST_DIR}}||g' \
integrations/sqlite.ini.tmpl > integrations/sqlite.ini
GITEA_ROOT="/home/GRAMES.POLYMTL.CA/p115628/src/gitea" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run TestGit/SSH
2022/07/03 02:40:49 ...s/setting/setting.go:782:loadFromConf() [I] The provided APP_DATA_PATH: integrations/gitea-integration-sqlite/data is not absolute - it will be made absolute against the work path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea
2022/07/03 02:40:49 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/attachments
2022/07/03 02:40:49 ...s/storage/storage.go:170:initAvatars() [I] Initialising Avatar storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/avatars
2022/07/03 02:40:49 ...s/storage/storage.go:188:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/repo-avatars
2022/07/03 02:40:49 ...s/storage/storage.go:182:initLFS() [I] Initialising LFS storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/lfs
2022/07/03 02:40:49 ...s/storage/storage.go:194:initRepoArchives() [I] Initialising Repository Archive storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/repo-archive
2022/07/03 02:40:49 ...s/storage/storage.go:200:initPackages() [I] Initialising Packages storage with type:
2022/07/03 02:40:49 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/packages
2022/07/03 02:40:49 modules/git/git.go:133:checkInit() [W] git module has been initialized already, duplicate init should be fixed
2022/07/03 02:40:49 routers/init.go:106:GlobalInitInstalled() [I] Git Version: 2.34.1, Wire Protocol Version 2 Enabled (home: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/gitea-repositories)
2022/07/03 02:40:49 routers/init.go:109:GlobalInitInstalled() [I] AppPath: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/gitea
2022/07/03 02:40:49 routers/init.go:110:GlobalInitInstalled() [I] AppWorkPath: /home/GRAMES.POLYMTL.CA/p115628/src/gitea
2022/07/03 02:40:49 routers/init.go:111:GlobalInitInstalled() [I] Custom path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/custom
2022/07/03 02:40:49 routers/init.go:112:GlobalInitInstalled() [I] Log path: sqlite-log
2022/07/03 02:40:49 routers/init.go:113:GlobalInitInstalled() [I] Configuration file: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/sqlite.ini
2022/07/03 02:40:49 routers/init.go:114:GlobalInitInstalled() [I] Run Mode: Prod
=== TestGitSmartHTTP (integrations/git_helper_for_declarative_test.go:95)
=== TestGit (integrations/git_helper_for_declarative_test.go:95)
=== TestGit/SSH (integrations/git_test.go:98)
=== TestGit/SSH/Standard (integrations/git_test.go:150)
=== TestGit/SSH/Standard/PushCommit (integrations/git_test.go:199)
=== TestGit/SSH/Standard/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/SSH/Standard/PushCommit/Big (integrations/git_test.go:209)
+++ TestGit/SSH/Standard/PushCommit/Big is a slow test (took 18.435778619s)
+++ TestGit/SSH/Standard/PushCommit is a slow test (took 19.37301885s)
+++ TestGit/SSH/Standard is a slow test (took 19.373246803s)
=== TestGit/SSH/LFS (integrations/git_test.go:158)
=== TestGit/SSH/LFS/PushCommit (integrations/git_test.go:199)
=== TestGit/SSH/LFS/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/SSH/LFS/PushCommit/Big (integrations/git_test.go:209)
=== TestGit/SSH/LFS/Locks (integrations/git_test.go:190)
=== TestGit/SSH/Raw (integrations/git_test.go:218)
=== TestGit/SSH/Media (integrations/git_test.go:259)
=== TestGit/SSH/CreateAgitFlowPull (integrations/git_test.go:704)
=== TestGit/SSH/BranchProtectMerge (integrations/git_test.go:374)
+++ TestGit/SSH/BranchProtectMerge is a slow test (took 17.193116261s)
=== TestGit/SSH/MergeFork (integrations/git_test.go:130)
=== TestGit/SSH/MergeFork/CreatePRAndMerge (integrations/git_test.go:464)
+++ TestGit/SSH/MergeFork/CreatePRAndMerge is a slow test (took 19.859786547s)
=== TestGit/SSH/MergeFork/Raw (integrations/git_test.go:218)
=== TestGit/SSH/MergeFork/Media (integrations/git_test.go:259)
+++ TestGit/SSH/MergeFork is a slow test (took 20.702272418s)
=== TestGit/SSH/PushCreate (integrations/git_test.go:564)
+++ TestGit/SSH is a slow test (took 1m21.693525873s)
+++ TestGit is a slow test (took 1m22.131702369s)
PASS
This is good enough to get me going, I think.
(annoyingly, TestGit seems to be broken at the moment, which is too bad because that's what seemed the most similar to what I want to write?
p115628@joplin:~/src/gitea$
make 'test-sqlite#TestGit'
go test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags 'sqlite sqlite_unlock_notify'
sed -e 's|{{REPO_TEST_DIR}}||g' \
integrations/sqlite.ini.tmpl > integrations/sqlite.ini
GITEA_ROOT="/home/GRAMES.POLYMTL.CA/p115628/src/gitea" GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run TestGit
2022/07/02 22:46:22 ...s/setting/setting.go:782:loadFromConf() [I] The provided APP_DATA_PATH: integrations/gitea-integration-sqlite/data is not absolute - it will be made absolute against the work path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea
2022/07/02 22:46:22 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/attachments
2022/07/02 22:46:22 ...s/storage/storage.go:170:initAvatars() [I] Initialising Avatar storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/avatars
2022/07/02 22:46:22 ...s/storage/storage.go:188:initRepoAvatars() [I] Initialising Repository Avatar storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/repo-avatars
2022/07/02 22:46:22 ...s/storage/storage.go:182:initLFS() [I] Initialising LFS storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/lfs
2022/07/02 22:46:22 ...s/storage/storage.go:194:initRepoArchives() [I] Initialising Repository Archive storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/repo-archive
2022/07/02 22:46:22 ...s/storage/storage.go:200:initPackages() [I] Initialising Packages storage with type:
2022/07/02 22:46:22 ...les/storage/local.go:46:NewLocalStorage() [I] Creating new Local Storage at /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/data/packages
2022/07/02 22:46:22 modules/git/git.go:133:checkInit() [W] git module has been initialized already, duplicate init should be fixed
2022/07/02 22:46:22 routers/init.go:106:GlobalInitInstalled() [I] Git Version: 2.34.1, Wire Protocol Version 2 Enabled (home: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/gitea-repositories)
2022/07/02 22:46:22 routers/init.go:109:GlobalInitInstalled() [I] AppPath: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/gitea
2022/07/02 22:46:22 routers/init.go:110:GlobalInitInstalled() [I] AppWorkPath: /home/GRAMES.POLYMTL.CA/p115628/src/gitea
2022/07/02 22:46:22 routers/init.go:111:GlobalInitInstalled() [I] Custom path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/custom
2022/07/02 22:46:22 routers/init.go:112:GlobalInitInstalled() [I] Log path: sqlite-log
2022/07/02 22:46:22 routers/init.go:113:GlobalInitInstalled() [I] Configuration file: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/sqlite.ini
2022/07/02 22:46:22 routers/init.go:114:GlobalInitInstalled() [I] Run Mode: Prod
=== TestGitSmartHTTP (integrations/git_helper_for_declarative_test.go:95)
=== TestGit (integrations/git_helper_for_declarative_test.go:95)
=== TestGit/HTTP (integrations/git_test.go:53)
=== TestGit/HTTP/Standard (integrations/git_test.go:150)
=== TestGit/HTTP/Standard/PushCommit (integrations/git_test.go:199)
=== TestGit/HTTP/Standard/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/HTTP/Standard/PushCommit/Big (integrations/git_test.go:209)
+++ TestGit/HTTP/Standard/PushCommit/Big is a slow test (took 18.504541431s)
+++ TestGit/HTTP/Standard/PushCommit is a slow test (took 19.272224413s)
+++ TestGit/HTTP/Standard is a slow test (took 19.272400951s)
=== TestGit/HTTP/LFS (integrations/git_test.go:158)
=== TestGit/HTTP/LFS/PushCommit (integrations/git_test.go:199)
=== TestGit/HTTP/LFS/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/HTTP/LFS/PushCommit/Big (integrations/git_test.go:209)
=== TestGit/HTTP/LFS/Locks (integrations/git_test.go:190)
=== TestGit/HTTP/Raw (integrations/git_test.go:218)
=== TestGit/HTTP/Media (integrations/git_test.go:259)
=== TestGit/HTTP/CreateAgitFlowPull (integrations/git_test.go:704)
=== TestGit/HTTP/BranchProtectMerge (integrations/git_test.go:374)
=== TestGit/HTTP/AutoMerge (integrations/git_test.go:622)
=== TestGit/HTTP/CreatePRAndSetManuallyMerged (integrations/git_test.go:512)
=== TestGit/HTTP/MergeFork (integrations/git_test.go:89)
=== TestGit/HTTP/MergeFork/CreatePRAndMerge (integrations/git_test.go:464)
+++ TestGit/HTTP/MergeFork/CreatePRAndMerge is a slow test (took 19.561360367s)
=== TestGit/HTTP/MergeFork/Raw (integrations/git_test.go:218)
=== TestGit/HTTP/MergeFork/Media (integrations/git_test.go:259)
+++ TestGit/HTTP/MergeFork is a slow test (took 20.322901367s)
=== TestGit/HTTP/PushCreate (integrations/git_test.go:564)
+++ TestGit/HTTP is a slow test (took 1m9.21203097s)
=== TestGit/SSH (integrations/git_test.go:98)
=== TestGit/SSH/Standard (integrations/git_test.go:150)
=== TestGit/SSH/Standard/PushCommit (integrations/git_test.go:199)
=== TestGit/SSH/Standard/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/SSH/Standard/PushCommit/Big (integrations/git_test.go:209)
=== TestGit/SSH/LFS (integrations/git_test.go:158)
=== TestGit/SSH/LFS/PushCommit (integrations/git_test.go:199)
=== TestGit/SSH/LFS/PushCommit/Little (integrations/git_test.go:201)
=== TestGit/SSH/LFS/PushCommit/Big (integrations/git_test.go:209)
=== TestGit/SSH/LFS/Locks (integrations/git_test.go:190)
=== TestGit/SSH/Raw (integrations/git_test.go:218)
=== TestGit/SSH/Media (integrations/git_test.go:259)
=== TestGit/SSH/CreateAgitFlowPull (integrations/git_test.go:704)
=== TestGit/SSH/BranchProtectMerge (integrations/git_test.go:374)
=== TestGit/SSH/MergeFork (integrations/git_test.go:130)
=== TestGit/SSH/MergeFork/CreatePRAndMerge (integrations/git_test.go:464)
=== TestGit/SSH/MergeFork/Raw (integrations/git_test.go:218)
=== TestGit/SSH/MergeFork/Media (integrations/git_test.go:259)
=== TestGit/SSH/PushCreate (integrations/git_test.go:564)
--- FAIL: TestGit (85.74s)
testlogger.go:78: 2022/07/02 22:46:24 modules/git/git.go:133:checkInit() [W] git module has been initialized already, duplicate init should be fixed
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-26] router: completed GET /user/login for , 200 OK in 12.6ms @ auth/auth.go:149(auth.SignIn)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-27] router: completed POST /user/login for , 303 See Other in 108.5ms @ auth/auth.go:174(auth.SignInPost)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-28] router: completed GET /user/settings/applications for , 200 OK in 5.9ms @ setting/applications.go:25(setting.Applications)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-29] router: completed POST /user/settings/applications for , 303 See Other in 20.8ms @ setting/applications.go:35(setting.ApplicationsPost)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-30] router: completed GET /user/settings/applications for , 200 OK in 4.2ms @ setting/applications.go:25(setting.Applications)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-31] router: completed GET /user/login for , 200 OK in 1.7ms @ auth/auth.go:149(auth.SignIn)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-32] router: completed POST /user/login for , 303 See Other in 103.1ms @ auth/auth.go:174(auth.SignInPost)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-33] router: completed GET /user/settings/applications for , 200 OK in 4.4ms @ setting/applications.go:25(setting.Applications)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-34] router: completed POST /user/settings/applications for , 303 See Other in 20.6ms @ setting/applications.go:35(setting.ApplicationsPost)
testlogger.go:78: 2022/07/02 22:46:24 ...eb/routing/logger.go:99:func1() [I] [62c10300-35] router: completed GET /user/settings/applications for , 200 OK in 3.9ms @ setting/applications.go:25(setting.Applications)
--- FAIL: TestGit/SSH (16.08s)
testlogger.go:78: 2022/07/02 22:47:34 ...eb/routing/logger.go:99:func1() [I] router: completed POST /api/v1/user/repos?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 201 Created in 641.8ms @ repo/repo.go:271(repo.Create)
testlogger.go:78: 2022/07/02 22:47:34 ...eb/routing/logger.go:99:func1() [I] [62c10346-6] router: completed PUT /api/v1/repos/user4/repo-tmp-18/collaborators/user2?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 204 No Content in 24.6ms @ repo/collaborators.go:128(repo.AddCollaborator)
testlogger.go:78: 2022/07/02 22:47:34 ...eb/routing/logger.go:99:func1() [I] [62c10346-7] router: completed POST /api/v1/repos/user4/repo-tmp-18/forks?token=84398dee58528eec9311a94ac09601ff77ad218c for , 202 Accepted in 67.8ms @ repo/fork.go:75(repo.CreateFork)
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c] router: completed POST /api/v1/user/keys?token=84398dee58528eec9311a94ac09601ff77ad218c for , 201 Created in 18.9ms @ user/key.go:217(user.CreatePublicKey)
testlogger.go:78: 2022/07/02 22:47:40 modules/ssh/ssh.go:265:sshConnectionFailed() [W] [62c102ff-16] Failed connection from 127.0.0.1:43892 with error: [ssh: no auth passed yet]
testlogger.go:78: 2022/07/02 22:47:40 modules/ssh/ssh.go:267:sshConnectionFailed() [W] [62c102ff-16] Failed authentication attempt from 127.0.0.1:43892
--- FAIL: TestGit/SSH/Clone (0.05s)
git_helper_for_declarative_test.go:102:
Error Trace: git_helper_for_declarative_test.go:102
Error: Received unexpected error:
exit status 128 - Cloning into '/tmp/repo-tmp-181046320980'...
Warning: Permanently added '[localhost]:2203' (RSA) to the list of known hosts.
git@localhost: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Test: TestGit/SSH/Clone
git_helper_for_declarative_test.go:105:
Error Trace: git_helper_for_declarative_test.go:105
Error: Should be true
Test: TestGit/SSH/Clone
--- FAIL: TestGit/SSH/Standard (0.28s)
--- FAIL: TestGit/SSH/Standard/PushCommit (0.28s)
--- FAIL: TestGit/SSH/Standard/PushCommit/Little (0.01s)
git_test.go:309:
Error Trace: git_test.go:309
git_test.go:202
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/Standard/PushCommit/Little
git_test.go:311:
Error Trace: git_test.go:311
git_test.go:202
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/Standard/PushCommit/Little
--- FAIL: TestGit/SSH/Standard/PushCommit/Big (0.28s)
git_test.go:309:
Error Trace: git_test.go:309
git_test.go:210
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/Standard/PushCommit/Big
git_test.go:311:
Error Trace: git_test.go:311
git_test.go:210
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/Standard/PushCommit/Big
--- FAIL: TestGit/SSH/LFS (0.48s)
git_test.go:168:
Error Trace: git_test.go:168
Error: Received unexpected error:
exit status 128
Test: TestGit/SSH/LFS
git_test.go:170:
Error Trace: git_test.go:170
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS
git_test.go:185:
Error Trace: git_test.go:185
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS
--- FAIL: TestGit/SSH/LFS/PushCommit (0.31s)
--- FAIL: TestGit/SSH/LFS/PushCommit/Little (0.00s)
git_test.go:309:
Error Trace: git_test.go:309
git_test.go:202
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS/PushCommit/Little
git_test.go:311:
Error Trace: git_test.go:311
git_test.go:202
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS/PushCommit/Little
--- FAIL: TestGit/SSH/LFS/PushCommit/Big (0.31s)
git_test.go:309:
Error Trace: git_test.go:309
git_test.go:210
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS/PushCommit/Big
git_test.go:311:
Error Trace: git_test.go:311
git_test.go:210
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/LFS/PushCommit/Big
--- FAIL: TestGit/SSH/LFS/Locks (0.11s)
git_test.go:298:
Error Trace: git_test.go:298
git_test.go:293
git_test.go:191
Error: Received unexpected error:
exit status 2 - Error while retrieving locks: missing protocol: ""
- Error while retrieving locks: missing protocol: ""
Test: TestGit/SSH/LFS/Locks
git_test.go:300:
Error Trace: git_test.go:300
git_test.go:293
git_test.go:191
Error: Received unexpected error:
exit status 2 - failed to call `git rev-parse --show-toplevel`: exit status 128
- failed to call `git rev-parse --show-toplevel`: exit status 128
Test: TestGit/SSH/LFS/Locks
git_test.go:302:
Error Trace: git_test.go:302
git_test.go:293
git_test.go:191
Error: Received unexpected error:
exit status 2 - Error while retrieving locks: missing protocol: ""
- Error while retrieving locks: missing protocol: ""
Test: TestGit/SSH/LFS/Locks
git_test.go:304:
Error Trace: git_test.go:304
git_test.go:293
git_test.go:191
Error: Received unexpected error:
exit status 2 - Unable to determine path: failed to call `git rev-parse --show-toplevel`: exit status 128
- Unable to determine path: failed to call `git rev-parse --show-toplevel`: exit status 128
Test: TestGit/SSH/LFS/Locks
--- FAIL: TestGit/SSH/Raw (0.08s)
git_test.go:226:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:226
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Raw
Messages: Request: GET /user2/repo-tmp-18/raw/branch/master
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-19] router: completed GET /user2/repo-tmp-18/raw/branch/master for , 404 Not Found in 22.9ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:227:
Error Trace: git_test.go:227
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/Raw
git_test.go:232:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:232
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Raw
Messages: Request: GET /user2/repo-tmp-18/raw/branch/master
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-26] router: completed GET /user2/repo-tmp-18/raw/branch/master for , 404 Not Found in 20.5ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:232: Response: Not found.
git_test.go:236:
Error Trace: git_test.go:236
Error: "Not found.\n" does not contain "version https://git-lfs.github.com/spec/v1"
Test: TestGit/SSH/Raw
git_test.go:242:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:242
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Raw
Messages: Request: GET /user2/repo-tmp-18/raw/branch/master
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-32] router: completed GET /user2/repo-tmp-18/raw/branch/master for , 404 Not Found in 19.7ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:243:
Error Trace: git_test.go:243
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/Raw
git_test.go:247:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:247
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Raw
Messages: Request: GET /user2/repo-tmp-18/raw/branch/master
git_test.go:247: Response: Not found.
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-38] router: completed GET /user2/repo-tmp-18/raw/branch/master for , 404 Not Found in 19.4ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:250:
Error Trace: git_test.go:250
Error: "Not found.\n" does not contain "version https://git-lfs.github.com/spec/v1"
Test: TestGit/SSH/Raw
--- FAIL: TestGit/SSH/Media (0.08s)
git_test.go:268:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:268
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Media
Messages: Request: GET /user2/repo-tmp-18/media/branch/master
git_test.go:269:
Error Trace: git_test.go:269
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/Media
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-44] router: completed GET /user2/repo-tmp-18/media/branch/master for , 404 Not Found in 20.3ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:274:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:274
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Media
Messages: Request: GET /user2/repo-tmp-18/media/branch/master
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-50] router: completed GET /user2/repo-tmp-18/media/branch/master for , 404 Not Found in 20.6ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:275:
Error Trace: git_test.go:275
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/Media
git_test.go:280:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:280
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Media
Messages: Request: GET /user2/repo-tmp-18/media/branch/master
testlogger.go:78: 2022/07/02 22:47:40 ...eb/routing/logger.go:99:func1() [I] [62c1034c-56] router: completed GET /user2/repo-tmp-18/media/branch/master for , 404 Not Found in 19.0ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:281:
Error Trace: git_test.go:281
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/Media
git_test.go:285:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:285
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/Media
Messages: Request: GET /user2/repo-tmp-18/media/branch/master
git_test.go:286:
Error Trace: git_test.go:286
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/Media
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034c-62] router: completed GET /user2/repo-tmp-18/media/branch/master for , 404 Not Found in 20.8ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
--- FAIL: TestGit/SSH/CreateAgitFlowPull (0.00s)
git_test.go:712:
Error Trace: git_test.go:712
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/CreateAgitFlowPull
--- FAIL: TestGit/SSH/BranchProtectMerge (0.31s)
--- FAIL: TestGit/SSH/BranchProtectMerge/CreateBranchProtected (0.00s)
git_helper_for_declarative_test.go:178:
Error Trace: git_helper_for_declarative_test.go:178
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/CreateBranchProtected
--- FAIL: TestGit/SSH/BranchProtectMerge/PushProtectedBranch (0.00s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PushProtectedBranch
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-4] router: completed GET /user/settings/applications for , 200 OK in 6.8ms @ setting/applications.go:25(setting.Applications)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-5] router: completed POST /user/settings/applications for , 303 See Other in 22.2ms @ setting/applications.go:35(setting.ApplicationsPost)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-6] router: completed GET /user/settings/applications for , 200 OK in 4.7ms @ setting/applications.go:25(setting.Applications)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-7] router: completed GET /user2/repo-tmp-18/settings/branches for , 200 OK in 21.9ms @ repo/setting_protected_branch.go:31(repo.ProtectedBranch)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-13] router: completed POST /user2/repo-tmp-18/settings/branches/protected for , 404 Not Found in 18.4ms @ context/repo.go:863(context.RepoRefByType)
--- FAIL: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchNoWhitelist (0.04s)
git_test.go:440:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:440
Error: Not equal:
expected: 303
actual : 404
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchNoWhitelist
Messages: Request: POST /user2/repo-tmp-18/settings/branches/protected
git_test.go:440: Response: Not found.
git_test.go:458:
Error Trace: git_test.go:458
Error: Not equal:
expected: "success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated."
actual : ""
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated.
+
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchNoWhitelist
--- FAIL: TestGit/SSH/BranchProtectMerge/GenerateCommit (0.00s)
git_test.go:382:
Error Trace: git_test.go:382
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/GenerateCommit
--- FAIL: TestGit/SSH/BranchProtectMerge/PushToUnprotectedBranch (0.00s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PushToUnprotectedBranch
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:958:parseCompareInfo() [I] [62c1034d-22] Base branch: protected
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:959:parseCompareInfo() [I] [62c1034d-22] Repo path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/gitea-repositories/user2/repo-tmp-18.git
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-22] router: completed POST /api/v1/repos/user2/repo-tmp-18/pulls?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3 for , 404 Not Found in 29.0ms @ repo/pull.go:248(repo.CreatePullRequest)
--- FAIL: TestGit/SSH/BranchProtectMerge/CreatePullRequest (0.03s)
api_helper_for_declarative_test.go:234:
Error Trace: integration_test.go:503
integration_test.go:332
api_helper_for_declarative_test.go:234
git_test.go:389
Error: Not equal:
expected: 201
actual : 404
Test: TestGit/SSH/BranchProtectMerge/CreatePullRequest
Messages: Request: POST /api/v1/repos/user2/repo-tmp-18/pulls?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3
api_helper_for_declarative_test.go:234: Response: {"errors":null,"message":"IsBranchExist","url":"http://localhost:3003/api/swagger"}
--- FAIL: TestGit/SSH/BranchProtectMerge/GenerateCommit#01 (0.00s)
git_test.go:394:
Error Trace: git_test.go:394
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/GenerateCommit#01
--- FAIL: TestGit/SSH/BranchProtectMerge/PushToUnprotectedBranch#01 (0.00s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PushToUnprotectedBranch#01
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:958:parseCompareInfo() [I] [62c1034d-28] Base branch: unprotected
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:959:parseCompareInfo() [I] [62c1034d-28] Repo path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/gitea-repositories/user2/repo-tmp-18.git
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-28] router: completed POST /api/v1/repos/user2/repo-tmp-18/pulls?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3 for , 404 Not Found in 26.7ms @ repo/pull.go:248(repo.CreatePullRequest)
--- FAIL: TestGit/SSH/BranchProtectMerge/CreatePullRequest#01 (0.03s)
api_helper_for_declarative_test.go:234:
Error Trace: integration_test.go:503
integration_test.go:332
api_helper_for_declarative_test.go:234
git_test.go:399
Error: Not equal:
expected: 201
actual : 404
Test: TestGit/SSH/BranchProtectMerge/CreatePullRequest#01
Messages: Request: POST /api/v1/repos/user2/repo-tmp-18/pulls?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3
api_helper_for_declarative_test.go:234: Response: {"errors":null,"message":"IsBranchExist","url":"http://localhost:3003/api/swagger"}
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-32] router: completed POST /api/v1/repos/user2/repo-tmp-18/pulls/0/merge?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3 for , 404 Not Found in 23.2ms @ repo/pull.go:696(repo.MergePullRequest)
--- FAIL: TestGit/SSH/BranchProtectMerge/MergePR2 (0.02s)
api_helper_for_declarative_test.go:293:
Error Trace: api_helper_for_declarative_test.go:293
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/BranchProtectMerge/MergePR2
Messages: Request: POST /api/v1/repos/user2/repo-tmp-18/pulls/0/merge?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3
api_helper_for_declarative_test.go:295: Response: {"errors":["pull request does not exist [id: 0, issue_id: 0, head_repo_id: 0, base_repo_id: 0, head_branch: , base_branch: ]"],"message":"GetPullRequestByIndex","url":"http://localhost:3003/api/swagger"}
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-36] router: completed POST /api/v1/repos/user2/repo-tmp-18/pulls/0/merge?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3 for , 404 Not Found in 19.3ms @ repo/pull.go:696(repo.MergePullRequest)
--- FAIL: TestGit/SSH/BranchProtectMerge/MergePR (0.02s)
api_helper_for_declarative_test.go:293:
Error Trace: api_helper_for_declarative_test.go:293
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/BranchProtectMerge/MergePR
Messages: Request: POST /api/v1/repos/user2/repo-tmp-18/pulls/0/merge?token=0e6cf094b472b7e67b01f7fc39f85e4ec0338aa3
api_helper_for_declarative_test.go:295: Response: {"errors":["pull request does not exist [id: 0, issue_id: 0, head_repo_id: 0, base_repo_id: 0, head_branch: , base_branch: ]"],"message":"GetPullRequestByIndex","url":"http://localhost:3003/api/swagger"}
--- FAIL: TestGit/SSH/BranchProtectMerge/PullProtected (0.00s)
git_helper_for_declarative_test.go:199:
Error Trace: git_helper_for_declarative_test.go:199
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PullProtected
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-41] router: completed GET /user2/repo-tmp-18/settings/branches for , 200 OK in 22.6ms @ repo/setting_protected_branch.go:31(repo.ProtectedBranch)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-47] router: completed POST /user2/repo-tmp-18/settings/branches/protected for , 404 Not Found in 17.6ms @ context/repo.go:863(context.RepoRefByType)
--- FAIL: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchUnprotectedFilePaths (0.04s)
git_test.go:440:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:440
Error: Not equal:
expected: 303
actual : 404
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchUnprotectedFilePaths
Messages: Request: POST /user2/repo-tmp-18/settings/branches/protected
git_test.go:440: Response: Not found.
git_test.go:458:
Error Trace: git_test.go:458
Error: Not equal:
expected: "success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated."
actual : ""
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated.
+
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchUnprotectedFilePaths
--- FAIL: TestGit/SSH/BranchProtectMerge/GenerateCommit#02 (0.00s)
git_test.go:409:
Error Trace: git_test.go:409
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/GenerateCommit#02
--- FAIL: TestGit/SSH/BranchProtectMerge/PushUnprotectedFilesToProtectedBranch (0.00s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PushUnprotectedFilesToProtectedBranch
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-55] router: completed GET /user2/repo-tmp-18/settings/branches for , 200 OK in 24.1ms @ repo/setting_protected_branch.go:31(repo.ProtectedBranch)
testlogger.go:78: 2022/07/02 22:47:41 ...eb/routing/logger.go:99:func1() [I] [62c1034d-61] router: completed POST /user2/repo-tmp-18/settings/branches/protected for , 404 Not Found in 23.3ms @ context/repo.go:863(context.RepoRefByType)
--- FAIL: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchWhitelist (0.05s)
git_test.go:453:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:453
Error: Not equal:
expected: 303
actual : 404
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchWhitelist
Messages: Request: POST /user2/repo-tmp-18/settings/branches/protected
git_test.go:453: Response: Not found.
git_test.go:458:
Error Trace: git_test.go:458
Error: Not equal:
expected: "success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated."
actual : ""
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-success%3DBranch%2Bprotection%2Bfor%2Bbranch%2B%2527protected%2527%2Bhas%2Bbeen%2Bupdated.
+
Test: TestGit/SSH/BranchProtectMerge/ProtectProtectedBranchWhitelist
--- FAIL: TestGit/SSH/BranchProtectMerge/CheckoutMaster (0.00s)
git_helper_for_declarative_test.go:185:
Error Trace: git_helper_for_declarative_test.go:185
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/CheckoutMaster
--- FAIL: TestGit/SSH/BranchProtectMerge/CreateBranchForced (0.00s)
git_helper_for_declarative_test.go:178:
Error Trace: git_helper_for_declarative_test.go:178
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/CreateBranchForced
--- FAIL: TestGit/SSH/BranchProtectMerge/GenerateCommit#03 (0.00s)
git_test.go:419:
Error Trace: git_test.go:419
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/GenerateCommit#03
--- FAIL: TestGit/SSH/BranchProtectMerge/MergeProtectedToToforce (0.00s)
git_helper_for_declarative_test.go:192:
Error Trace: git_helper_for_declarative_test.go:192
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/MergeProtectedToToforce
--- FAIL: TestGit/SSH/BranchProtectMerge/PushToProtectedBranch (0.00s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/PushToProtectedBranch
--- FAIL: TestGit/SSH/BranchProtectMerge/CheckoutMasterAgain (0.00s)
git_helper_for_declarative_test.go:185:
Error Trace: git_helper_for_declarative_test.go:185
Error: Received unexpected error:
exit status 128 - fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
- fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Test: TestGit/SSH/BranchProtectMerge/CheckoutMasterAgain
--- FAIL: TestGit/SSH/MergeFork (8.46s)
--- FAIL: TestGit/SSH/MergeFork/CreatePRAndMerge (8.32s)
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:958:parseCompareInfo() [I] [62c1034d-74] Base branch: master
testlogger.go:78: 2022/07/02 22:47:41 .../api/v1/repo/pull.go:959:parseCompareInfo() [I] [62c1034d-74] Repo path: /home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/gitea-integration-sqlite/gitea-repositories/user4/repo-tmp-18.git
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034d-74] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls?token=84398dee58528eec9311a94ac09601ff77ad218c for , 201 Created in 966.0ms @ repo/pull.go:248(repo.CreatePullRequest)
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034e-22] router: completed GET /user4/repo-tmp-18/pulls/1 for , 200 OK in 82.2ms @ repo/issue.go:1122(repo.ViewIssue)
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034e-41] router: completed GET /user4/repo-tmp-18/pulls/1/files for , 200 OK in 81.5ms @ repo/pull.go:643(repo.ViewPullFiles)
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034e-63] router: completed GET /user4/repo-tmp-18/pulls/1/commits for , 200 OK in 63.3ms @ repo/pull.go:607(repo.ViewPullCommits)
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034e-81] router: completed GET /user4/repo-tmp-18/pulls/1.diff for , 0 in 23.8ms @ repo/pull.go:1386(repo.DownloadPullDiff)
testlogger.go:78: 2022/07/02 22:47:42 ...eb/routing/logger.go:99:func1() [I] [62c1034e-88] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 32.2ms @ repo/pull.go:696(repo.MergePullRequest)
testlogger.go:78: 2022/07/02 22:47:43 ...eb/routing/logger.go:99:func1() [I] [62c1034f] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 29.5ms @ repo/pull.go:696(repo.MergePullRequest)
testlogger.go:78: 2022/07/02 22:47:44 ...eb/routing/logger.go:99:func1() [I] [62c10350] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 31.6ms @ repo/pull.go:696(repo.MergePullRequest)
testlogger.go:78: 2022/07/02 22:47:45 ...eb/routing/logger.go:99:func1() [I] [62c10351] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 30.3ms @ repo/pull.go:696(repo.MergePullRequest)
testlogger.go:78: 2022/07/02 22:47:46 ...eb/routing/logger.go:99:func1() [I] [62c10352] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 30.1ms @ repo/pull.go:696(repo.MergePullRequest)
testlogger.go:78: 2022/07/02 22:47:47 ...eb/routing/logger.go:99:func1() [I] [62c10353] router: completed POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 405 Method Not Allowed in 32.0ms @ repo/pull.go:696(repo.MergePullRequest)
--- FAIL: TestGit/SSH/MergeFork/CreatePRAndMerge/MergePR (6.19s)
api_helper_for_declarative_test.go:293:
Error Trace: api_helper_for_declarative_test.go:293
Error: Not equal:
expected: 200
actual : 405
Test: TestGit/SSH/MergeFork/CreatePRAndMerge/MergePR
Messages: Request: POST /api/v1/repos/user4/repo-tmp-18/pulls/1/merge?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9
testlogger.go:78: 2022/07/02 22:47:48 ...eb/routing/logger.go:99:func1() [I] [62c10354] router: completed GET /user4/repo-tmp-18/pulls/1 for , 200 OK in 88.7ms @ repo/issue.go:1122(repo.ViewIssue)
testlogger.go:78: 2022/07/02 22:47:48 ...eb/routing/logger.go:99:func1() [I] [62c10354-19] router: completed GET /user4/repo-tmp-18/pulls/1/files for , 200 OK in 83.1ms @ repo/pull.go:643(repo.ViewPullFiles)
testlogger.go:78: 2022/07/02 22:47:48 ...eb/routing/logger.go:99:func1() [I] [62c10354-41] router: completed GET /user4/repo-tmp-18/pulls/1/commits for , 200 OK in 66.4ms @ repo/pull.go:607(repo.ViewPullCommits)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10354-59] router: completed GET /api/v1/repos/user4/repo-tmp-18/pulls/1?token=aac490e562fb0f13f1cc09fe95b11d06f61528c9 for , 200 OK in 52.0ms @ repo/pull.go:134(repo.GetPullRequest)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-9] router: completed GET /user4/repo-tmp-18/pulls/1.diff for , 0 in 20.1ms @ repo/pull.go:1386(repo.DownloadPullDiff)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-16] router: completed GET /user4/repo-tmp-18/branches for , 200 OK in 33.6ms @ repo/branch.go:53(repo.Branches)
testlogger.go:78: 2022/07/02 22:47:49 ...s/web/repo/branch.go:107:DeleteBranchPost() [E] [62c10355-25] DeleteBranch: object does not exist [id: refs/heads/user2:master, rel_path: ]
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-25] router: completed POST /user4/repo-tmp-18/branches/delete?name=user2%3Amaster for , 200 OK in 17.7ms @ repo/branch.go:91(repo.DeleteBranchPost)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-31] router: completed GET /user4/repo-tmp-18/pulls/1 for , 200 OK in 82.7ms @ repo/issue.go:1122(repo.ViewIssue)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-49] router: completed GET /user4/repo-tmp-18/pulls/1/files for , 200 OK in 82.5ms @ repo/pull.go:643(repo.ViewPullFiles)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-71] router: completed GET /user4/repo-tmp-18/pulls/1/commits for , 200 OK in 63.4ms @ repo/pull.go:607(repo.ViewPullCommits)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-89] router: completed GET /user4/repo-tmp-18/pulls/1.diff for , 0 in 18.9ms @ repo/pull.go:1386(repo.DownloadPullDiff)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c102ff-8] router: completed DELETE /api/v1/repos/user2/repo-tmp-18?token=84398dee58528eec9311a94ac09601ff77ad218c for , 204 No Content in 114.7ms @ repo/repo.go:1013(repo.Delete)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-112] router: completed GET /user4/repo-tmp-18/pulls/1 for , 200 OK in 60.9ms @ repo/issue.go:1122(repo.ViewIssue)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-123] router: completed GET /user4/repo-tmp-18/pulls/1/files for , 200 OK in 57.0ms @ repo/pull.go:643(repo.ViewPullFiles)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-138] router: completed GET /user4/repo-tmp-18/pulls/1/commits for , 200 OK in 40.5ms @ repo/pull.go:607(repo.ViewPullCommits)
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-149] router: completed GET /user4/repo-tmp-18/pulls/1.diff for , 0 in 21.4ms @ repo/pull.go:1386(repo.DownloadPullDiff)
--- FAIL: TestGit/SSH/MergeFork/Raw (0.07s)
git_test.go:226:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:226
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Raw
Messages: Request: GET /user4/repo-tmp-18/raw/branch/master
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-156] router: completed GET /user4/repo-tmp-18/raw/branch/master for , 404 Not Found in 17.0ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:227:
Error Trace: git_test.go:227
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/MergeFork/Raw
git_test.go:232:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:232
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Raw
Messages: Request: GET /user4/repo-tmp-18/raw/branch/master
git_test.go:232: Response: Not found.
git_test.go:236:
Error Trace: git_test.go:236
Error: "Not found.\n" does not contain "version https://git-lfs.github.com/spec/v1"
Test: TestGit/SSH/MergeFork/Raw
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-162] router: completed GET /user4/repo-tmp-18/raw/branch/master for , 404 Not Found in 16.3ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:242:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:242
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Raw
Messages: Request: GET /user4/repo-tmp-18/raw/branch/master
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-168] router: completed GET /user4/repo-tmp-18/raw/branch/master for , 404 Not Found in 17.1ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:243:
Error Trace: git_test.go:243
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/MergeFork/Raw
git_test.go:247:
Error Trace: integration_test.go:503
integration_test.go:332
git_test.go:247
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Raw
Messages: Request: GET /user4/repo-tmp-18/raw/branch/master
git_test.go:247: Response: Not found.
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-174] router: completed GET /user4/repo-tmp-18/raw/branch/master for , 404 Not Found in 15.0ms @ repo/download.go:123(repo.SingleDownload)
git_test.go:250:
Error Trace: git_test.go:250
Error: "Not found.\n" does not contain "version https://git-lfs.github.com/spec/v1"
Test: TestGit/SSH/MergeFork/Raw
--- FAIL: TestGit/SSH/MergeFork/Media (0.07s)
git_test.go:268:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:268
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Media
Messages: Request: GET /user4/repo-tmp-18/media/branch/master
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-180] router: completed GET /user4/repo-tmp-18/media/branch/master for , 404 Not Found in 17.1ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:269:
Error Trace: git_test.go:269
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/MergeFork/Media
git_test.go:274:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:274
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Media
Messages: Request: GET /user4/repo-tmp-18/media/branch/master
git_test.go:275:
Error Trace: git_test.go:275
Error: Not equal:
expected: 1024
actual : 11
Test: TestGit/SSH/MergeFork/Media
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-186] router: completed GET /user4/repo-tmp-18/media/branch/master for , 404 Not Found in 15.3ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:280:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:280
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Media
Messages: Request: GET /user4/repo-tmp-18/media/branch/master
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-192] router: completed GET /user4/repo-tmp-18/media/branch/master for , 404 Not Found in 17.9ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:281:
Error Trace: git_test.go:281
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/MergeFork/Media
git_test.go:285:
Error Trace: integration_test.go:516
integration_test.go:349
git_test.go:285
Error: Not equal:
expected: 200
actual : 404
Test: TestGit/SSH/MergeFork/Media
Messages: Request: GET /user4/repo-tmp-18/media/branch/master
testlogger.go:78: 2022/07/02 22:47:49 ...eb/routing/logger.go:99:func1() [I] [62c10355-198] router: completed GET /user4/repo-tmp-18/media/branch/master for , 404 Not Found in 17.4ms @ repo/download.go:135(repo.SingleDownloadOrLFS)
git_test.go:286:
Error Trace: git_test.go:286
Error: Not equal:
expected: 134217728
actual : 11
Test: TestGit/SSH/MergeFork/Media
--- FAIL: TestGit/SSH/PushCreate (0.17s)
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:265:sshConnectionFailed() [W] [62c102ff-16] Failed connection from 127.0.0.1:43894 with error: [ssh: no auth passed yet]
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:267:sshConnectionFailed() [W] [62c102ff-16] Failed authentication attempt from 127.0.0.1:43894
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:265:sshConnectionFailed() [W] [62c102ff-16] Failed connection from 127.0.0.1:43896 with error: [ssh: no auth passed yet]
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:267:sshConnectionFailed() [W] [62c102ff-16] Failed authentication attempt from 127.0.0.1:43896
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:265:sshConnectionFailed() [W] [62c102ff-16] Failed connection from 127.0.0.1:43898 with error: [ssh: no auth passed yet]
testlogger.go:78: 2022/07/02 22:47:49 modules/ssh/ssh.go:267:sshConnectionFailed() [W] [62c102ff-16] Failed authentication attempt from 127.0.0.1:43898
--- FAIL: TestGit/SSH/PushCreate/SuccessfullyPushAndCreateTestRepository (0.05s)
git_helper_for_declarative_test.go:164:
Error Trace: git_helper_for_declarative_test.go:164
Error: Received unexpected error:
exit status 128 - Warning: Permanently added '[localhost]:2203' (RSA) to the list of known hosts.
git@localhost: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
- Warning: Permanently added '[localhost]:2203' (RSA) to the list of known hosts.
git@localhost: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Test: TestGit/SSH/PushCreate/SuccessfullyPushAndCreateTestRepository
git_test.go:594:
Error Trace: git_test.go:594
Error: Received unexpected error:
repository does not exist [id: 0, uid: 0, owner_name: user2, name: repo-tmp-push-create-ssh]
Test: TestGit/SSH/PushCreate
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x109 pc=0x21f982a]
goroutine 29461 [running]:
testing.tRunner.func1.2({0x258bde0, 0x4816840})
/usr/lib/go-1.18/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
/usr/lib/go-1.18/src/testing/testing.go:1392 +0x39f
panic({0x258bde0, 0x4816840})
/usr/lib/go-1.18/src/runtime/panic.go:838 +0x207
code.gitea.io/gitea/integrations.doPushCreate.func1(0xc00622dc00?)
/home/GRAMES.POLYMTL.CA/p115628/src/gitea/integrations/git_test.go:595 +0x3ea
testing.tRunner(0xc007028d00, 0xc0065e7320)
/usr/lib/go-1.18/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
/usr/lib/go-1.18/src/testing/testing.go:1486 +0x35f
make: *** [Makefile:401: test-sqlite#TestGit] Error 2
and the proper fix is Very Difficult because it's an incompatibility between two versions of ssh, openssh, which does the right thing, and golang's x/crypto/ssh, which took shortcuts that apparently imply an RSA key has to use the RSA SHA1 algorithm which has been defeated, even though there's other signature algorithms that can be used with RSA keys that are still fine.
)
EDIT: you can almost run the integration tests with the standard go syntax:
go test -v code.gitea.io/gitea/integrations -run TestGit/SSH
Because integrations/integration_test.go::TestMain takes care of setting up storage and HTTP routes, and integrations/git_helper_for_declarative_test.go:func onGiteaRun takes care of setting up a live HTTP listener for each test, so it's almost all self-contained
But:
you need to do
GITEA_ROOT="`pwd`" GITEA_CONF=integrations/sqlite.ini
go test -v code.gitea.io/gitea/integrations -run TestGit/SSH
because integrations/integration_test.go::TestMain looks at those two envvars
it still fails because go test sets up a tmpdir to operate in, but Makefile generates sqlite.ini, mostly so it can set ROOT = integrations/..., which is not in a tmpdir
the generated sqlite.ini is set up to always use the internal ssh server; this could probably have been set inside of TestMain but that's not how they have it set up (maybe to make it easier to debug since you can boot a copy of gitea with the same config right there?)
for some reason the make form gives interactive reports, while the other form doesn't print what it's doing until it finishes when it prints all the results at once
These tests are gettnig somewhat slow. Profiling (^) revealed:
withKeyFile() is slow because modules/ssh/ssh.go's GenKeyPair() is slow. And that's because it uses 4096 bit RSA keys. This could be fixed by switching to ed25519 keys, but those need to be saved in RFC4716 format which is not yet in the stdlib: x/crypto/ssh: add methods to marshal private keys to the OpenSSH format golang/go#37132 (parsing them has been in for a while, but writing has been stalled).
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
Activity
kousu commentedon May 16, 2022
Here's a sketch:
Cases to test:
writing and reading to/from:
a public repo that i own (=> should PASS) (expect: AccessModeWrite)
a public repo that someone else owns (=> should FAIL) (expect: AccessModeRead)
a private repo that i own (=> PASS) (expect: AccessModeWrite)
a private repo that someone else owns that I have write access to (expect: AccessModeWrite)
a private repo that someone else owns that I have read access to (expect: AccessModeRead)
a private repo someone else owns that I have no access to (=> FAIL) (expect: AccessModeReadNone)
a deploy key with read only access (should FAIL) (expect: AccessModeRead)
a deploy key with write access (should PASS) (expect: AccessModeWrite)
a nonexistent repo (-> this falls into the push-to-create cases)
There are two push-to-create settings: repository.ENABLE_PUSH_CREATE_USER, and ENABLE_PUSH_CREATE_ORG; for both, the user/org needs to already exist (you can't just say 'git push git@site:randomorg/repo1.git')
a nonexistent (i.e. push-to-create) in a personal repo (=> should PASS)
a nonexistent (i.e. push-to-create) in an organization that exists that i own (=> should PASS)
a nonexistent (i.e. push-to-create) push-to-create in an organization that exists that someone else owns (=> should FAIL)
a push-to-create in an organization that doesn't exist (=> should FAIL)
pushing / pulling to a .wiki
there are basically only: None, Read or Write (there's also Admin and Owner, but those are the same as Write as far as git-annex is concerned, they only add access to a repo's settings)
A catch tho: a site Admin can write to ANY repo. so you need to set up two unprivileged users for these tests.
The permission model in Gitea is None < Read < Write < Admin < Owner; for our purposes we only need to think about None/Read/Write:
Here's some scripts to write and read annexes:
And then maybe we'll do something like
To actually set up the repos we'll have to hit the API, and then figure out how to wrap these scripts inside of Go.
kousu commentedon Jun 29, 2022
I did some reconnaissance this morning to figure out how gitea handles tests currently.
The integrations/ folder seems to be where the main action is. It seems to consist solely of tests; I think unit tests are scattered through the tree, in files named
_test.go
, but I'm not interested in unit tests, I want to know if we can upload and download a complete annex, so I'll focus on this.PrepareTestEnv
is a helper that tests can call -- most of the tests in integrations/ call it -- which sets up the SQL database, filling it in with some test data, and copying the rest of the test data from integrations/gitea-repositories-meta/ to a (presumably empty and temporary)setting.RepoRootPath
. The SQL test data is in models/fixtures/.LFS is currently in a few files; the one closest to what I want to do with git-annex is
gitea/integrations/git_test.go
Lines 156 to 195 in 26ec628
and everything that calls it, especially this which tests both the HTTP and SSH workflows:
gitea/integrations/git_test.go
Lines 44 to 123 in 26ec628
There's also https://github.com/neuropoly/gitea/blob/26ec6286240ed02c7d427129e16c1f649085578b/integrations/lfs_getobject_test.go which uses the internal Go API to create LFS objects, but the HTTP API to download them back and check them. I don't think this is relevant to us; the server side of LFS is a custom HTTP server, and Gitea implemented that themselves.
Ditto for https://github.com/neuropoly/gitea/blob/26ec6286240ed02c7d427129e16c1f649085578b/integrations/api_repo_lfs_locks_test.go -- there's no analogue in git-annex for this.
There's also integrations/ssh_key_test.go which is for checking some extra subtle logics around adding/removing ssh keys. I think this might be a good model to start from -- it uses the same helpers as
testGit
likecreateSSHUrl
anddoGitPushTestRepository
, but without doing a kitchen-sink test. I'm wary of editingtestGit
directly -- for now I just want to testgit-annex-shell
's integration withgitea
, not withgit-lfs
or other obscure features of git and it would be a lot easier especially to maintain that from a fork if I could do that in its own file that will rarely have merge conflicts.Anyway, I think this looks good enough to get started.
doGitPushTestRepository
isgit push -u
,doGitAddRemote
isgit remote add ...
.Plan
Especially, how do I target specific tests to run?
integrations/git_helper_for_declarative_test.go
with helpers likedoGitAnnexCopy
,doGitAnnexSync
,doGitAnnexInit
, ...integrations/annex_test.go
with, to start,testGitAnnex
which just uploads and downloads to a public repo over sshtestGitAnnexHTTP
to cover downloading from a public repo over HTTPintegrations/gitea-repositories-meta/limited_org/public_repo_on_limited_org.git
gets used in the tests will show)Aside
There's also https://github.com/neuropoly/gitea/blob/26ec6286240ed02c7d427129e16c1f649085578b/integrations/api_repo_lfs_migrate_test.go, which uses https://github.com/neuropoly/gitea/tree/26ec6286240ed02c7d427129e16c1f649085578b/integrations/gitea-repositories-meta/migration/lfs-test.git to check if an LFS repo can be safely imported. We should probably test this too. But before that will work we'll need features.
kousu commentedon Jul 3, 2022
Running a specific test
Most of the tests exist as standard Go unit tests, meaning they're in
_test.go
files in the same folder; so target a specific one of those, you can do e.g.or you can do
to run a whole sub-folder (note to self/other golang newbies: code.gitea.io/gitea == ./ because ./go.mod declares that as that folder's namespace).
However, to test git-annex we need to set up an integration test that boots a complete gitea server + database behind it, and those have a special script (which seems a little flakey?):
You can also target a subtest with
(but not all of these actually work when run independently like this)
NB: '/'s become '.'s when targetting a subtest
This is good enough to get me going, I think.
(annoyingly,
TestGit
seems to be broken at the moment, which is too bad because that's what seemed the most similar to what I want to write?EDIT turns out it's go-gitea#17798 and the quick workaround is
and the proper fix is Very Difficult because it's an incompatibility between two versions of ssh, openssh, which does the right thing, and golang's x/crypto/ssh, which took shortcuts that apparently imply an RSA key has to use the RSA SHA1 algorithm which has been defeated, even though there's other signature algorithms that can be used with RSA keys that are still fine.
)
EDIT: you can almost run the integration tests with the standard go syntax:
Because integrations/integration_test.go::TestMain takes care of setting up storage and HTTP routes, and integrations/git_helper_for_declarative_test.go:func onGiteaRun takes care of setting up a live HTTP listener for each test, so it's almost all self-contained
But:
you need to do
because integrations/integration_test.go::TestMain looks at those two envvars
it still fails because
go test
sets up a tmpdir to operate in, but Makefile generates sqlite.ini, mostly so it can setROOT = integrations/...
, which is not in a tmpdirthe generated sqlite.ini is set up to always use the internal ssh server; this could probably have been set inside of TestMain but that's not how they have it set up (maybe to make it easier to debug since you can boot a copy of gitea with the same config right there?)
for some reason the make form gives interactive reports, while the other form doesn't print what it's doing until it finishes when it prints all the results at once
kousu commentedon Aug 7, 2022
Performance Profiling
A tip: to profile the tests, add:
then run the tests as normal (
make test-sqlite#TestGitAnnex
)Then use
go tool pprof mem.prof
andgo tool pprof cpu.prof
kousu commentedon Aug 7, 2022
Slowness
These tests are gettnig somewhat slow. Profiling (^) revealed:
withKeyFile()
is slow becausemodules/ssh/ssh.go
's GenKeyPair() is slow. And that's because it uses 4096 bit RSA keys. This could be fixed by switching to ed25519 keys, but those need to be saved in RFC4716 format which is not yet in the stdlib: x/crypto/ssh: add methods to marshal private keys to the OpenSSH format golang/go#37132 (parsing them has been in for a while, but writing has been stalled).A solution is to switch, temporarily, to https://github.com/ScaleFT/sshkeys, which is the source of the patch x/crypto/ssh: add methods to marshal private keys to the OpenSSH format golang/go#37132.
Test git-annex
318 remaining items
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)
git-annex tests (#13)