Skip to content

Git annex tests #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b92c372
Test git-annex
kousu Jul 6, 2022
81d112c
Test annex repo deletion.
kousu Jul 29, 2022
d804ef8
Run git-annex tests in CI
kousu Jul 6, 2022
b24da3a
Fully reset state at end of withKeyFile.
kousu Jul 31, 2022
7f1d99b
withCtxKeyFile()
kousu Jul 31, 2022
7cd4f7f
createHTTPUrl
kousu Aug 1, 2022
6cb27e6
Rearrange test
kousu Aug 1, 2022
a9d8298
AnnexObjectPath: handle non-bare repos, too
kousu Aug 1, 2022
0e073c1
filecmp
kousu Aug 1, 2022
5828e79
Test contribution by different users
kousu Aug 7, 2022
fa396cf
Test uploading/downloading Private annex repos
kousu Aug 8, 2022
8fc3239
Add a UUID to withCtxKeyFile()
kousu Aug 8, 2022
9318912
[WIP] Factor permissions tests into reusable subroutines
kousu Aug 10, 2022
71b47a5
Split up annex Init/Download/Upload tests into subroutines that *retu…
kousu Aug 10, 2022
7513957
Unroll annex permission tests, to specify the correct outcomes in all…
kousu Aug 10, 2022
9cd0c8e
Drop helper
kousu Aug 10, 2022
bcc00d7
Title
kousu Aug 10, 2022
666c168
explicit is better than implicit
kousu Aug 10, 2022
852f14d
Drop redundant code
kousu Aug 19, 2022
1e9aef6
Logic bug
kousu Aug 19, 2022
040ecd4
Clarify
kousu Aug 19, 2022
29a9cae
Clarify
kousu Aug 19, 2022
a073a7a
Remove debugging code
kousu Aug 19, 2022
3594864
Comment
kousu Aug 19, 2022
2002fc6
Clarify
kousu Aug 19, 2022
6bbb4c0
Clarify
kousu Aug 19, 2022
d0a505a
Return error from helper instead of passing in the testing.T
kousu Aug 19, 2022
8eec7fc
Use more obvious spelling
kousu Aug 19, 2022
6628a30
Rewrite filecmp to be safer.
kousu Aug 19, 2022
65b8706
gofmt
kousu Aug 19, 2022
0f48015
Only build the Go code for testing git-annex
kousu Aug 19, 2022
de51980
Factor, slightly
kousu Aug 19, 2022
0131112
tidy
kousu Aug 19, 2022
1e1ac78
Curtail
kousu Aug 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/test-git-annex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Test Git Annex
# Here we just test the git-annex feature, leaving
# the full test suite for upstream to watch over.

on:
push:
workflow_call: # so release.yml can depend on this (https://stackoverflow.com/a/71489231)

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install toolchain
run: |
sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y make git git-annex
# per README.md, building needs Go 1.17 and Node LTS
- uses: actions/setup-go@v2
with:
go-version: '^1.17' # The Go version to download (if necessary) and use.
- uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Build ./gitea
run: |
TAGS="bindata sqlite sqlite_unlock_notify" make backend

- name: Test
run: |
make 'test-sqlite#TestGitAnnex'
22 changes: 22 additions & 0 deletions integrations/api_helper_for_declarative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"testing"
"time"

"github.com/google/uuid"

"code.gitea.io/gitea/models/perm"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/json"
Expand Down Expand Up @@ -462,3 +464,23 @@ func doAPIAddRepoToOrganizationTeam(ctx APITestContext, teamID int64, orgName, r
ctx.Session.MakeRequest(t, req, http.StatusNoContent)
}
}

// generate and activate an ssh key for the user attached to the APITestContext
// TODO: pick a better name; golang doesn't do method overriding.
func withCtxKeyFile(t *testing.T, ctx APITestContext, callback func()) {
keyName := "One of " + ctx.Username + "'s keys: #" + uuid.New().String()
withKeyFile(t, keyName, func(keyFile string) {

var key api.PublicKey

doAPICreateUserKey(ctx, keyName, keyFile,
func(t *testing.T, _key api.PublicKey) {
// save the key ID so we can delete it at the end
key = _key
})(t)

defer doAPIDeleteUserKey(ctx, key.ID)(t)

callback()
})
}
Loading