vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
refactor
c5902451905acdaa478f8476844ccd4a510d9ca9 · Keenan Nemetz · 17d ago · parent ec2aba4b
internal/acl/runners_test.go → forge/access/runners_test.go +1−5
| @@ -1,10 +1,9 @@ | |||
| 1 | package acl | ||
| 1 | package access | ||
| 2 | 2 | ||
| 3 | 3 | // Who may report a CI result is an allowlist, not a role: it answers "may this | |
| 4 | 4 | // account's build be believed about this repository", not "may this account push to | |
| 5 | 5 | // it". These tests pin the two halves of that rule — the list, and the admins who are | |
| 6 | 6 | // implicit in it. | |
| 7 | |||
| 8 | 7 | import "testing" | |
| 9 | 8 | ||
| 10 | 9 | func TestOnlyRunnersAndAdminsCount(t *testing.T) { | |
| @@ -13,7 +12,6 @@ func TestOnlyRunnersAndAdminsCount(t *testing.T) { | |||
| 13 | 12 | a.Entries["writer-id"] = "write" | |
| 14 | 13 | a.Entries["reader-id"] = "read" | |
| 15 | 14 | a.SetRunners([]string{"ci-runner", "writer-id"}) | |
| 16 | |||
| 17 | 15 | for _, tc := range []struct { | |
| 18 | 16 | account string | |
| 19 | 17 | want bool | |
| @@ -44,7 +42,6 @@ func TestAnEmptyRunnerListStillLetsAdminsReport(t *testing.T) { | |||
| 44 | 42 | t.Fatal("a stranger's result counted") | |
| 45 | 43 | } | |
| 46 | 44 | } | |
| 47 | |||
| 48 | 45 | func TestRunnerListIsNormalised(t *testing.T) { | |
| 49 | 46 | t.Parallel() | |
| 50 | 47 | a := Empty("owner-id") | |
| @@ -52,7 +49,6 @@ func TestRunnerListIsNormalised(t *testing.T) { | |||
| 52 | 49 | if len(a.Runners) != 3 || a.Runners[0] != "a" || a.Runners[1] != "b" || a.Runners[2] != "c" { | |
| 53 | 50 | t.Fatalf("runners = %#v, want a b c with no blanks or duplicates", a.Runners) | |
| 54 | 51 | } | |
| 55 | |||
| 56 | 52 | // The same rule on the way in from disk, so a hand-edited file cannot leave a | |
| 57 | 53 | // list that reads differently from how it behaves. | |
| 58 | 54 | parsed, err := Parse([]byte(`{"version":1,"default":"none","runners":["b","a","b",""]}`)) | |