Skip to content

Commit a2779de

Browse files
authored
Test views of LFS files (#22196)
1 parent ea5a752 commit a2779de

25 files changed

+174
-2
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ To maintain understandable code and avoid circular dependencies it is important
190190
- **templates:** Golang templates for generating the html output.
191191
- **tests/e2e:** End to end tests
192192
- **tests/integration:** Integration tests
193+
- **tests/gitea-repositories-meta:** Sample repos used in integration tests. Adding a new repo requires editing `models/fixtures/repositories.yml` and `models/fixtures/repo_unit.yml` to match.
194+
- **tests/gitea-lfs-meta:** Sample LFS objects used in integration tests. Adding a new object requires editing `models/fixtures/lfs_meta_object.yml` to match.
193195
- **vendor:** External code that Gitea depends on.
194196

195197
## Documentation

models/db/iterate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestIterate(t *testing.T) {
2525
return nil
2626
})
2727
assert.NoError(t, err)
28-
assert.EqualValues(t, 80, repoCnt)
28+
assert.EqualValues(t, 81, repoCnt)
2929

3030
err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error {
3131
reopUnit2 := repo_model.RepoUnit{ID: repoUnit.ID}

models/fixtures/lfs_meta_object.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# These are the LFS objects in user2/lfs.git
2+
-
3+
4+
id: 1
5+
oid: 0b8d8b5f15046343fd32f451df93acc2bdd9e6373be478b968e4cad6b6647351
6+
size: 107
7+
repository_id: 54
8+
created_unix: 1671607299
9+
10+
-
11+
12+
id: 2
13+
oid: 2eccdb43825d2a49d99d542daa20075cff1d97d9d2349a8977efe9c03661737c
14+
size: 107
15+
repository_id: 54
16+
created_unix: 1671607299
17+
18+
-
19+
20+
id: 3
21+
oid: 7b6b2c88dba9f760a1a58469b67fee2b698ef7e9399c4ca4f34a14ccbe39f623
22+
size: 27
23+
repository_id: 54
24+
created_unix: 1671607299
25+
26+
-
27+
28+
id: 4
29+
oid: 9d172e5c64b4f0024b9901ec6afe9ea052f3c9b6ff9f4b07956d8c48c86fca82
30+
size: 25
31+
repository_id: 54
32+
created_unix: 1671607299

models/fixtures/repo_unit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,9 @@
550550
repo_id: 53
551551
type: 1
552552
created_unix: 946684810
553+
554+
-
555+
id: 81
556+
repo_id: 54
557+
type: 1
558+
created_unix: 946684810

models/fixtures/repository.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,3 +1585,14 @@
15851585
size: 0
15861586
is_fsck_enabled: true
15871587
close_issues_via_commit_in_any_branch: false
1588+
1589+
-
1590+
id: 54
1591+
owner_id: 2
1592+
owner_name: user2
1593+
lower_name: lfs
1594+
name: lfs
1595+
is_empty: false
1596+
is_archived: false
1597+
is_private: true
1598+
status: 0

models/fixtures/user.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
num_followers: 2
6767
num_following: 1
6868
num_stars: 2
69-
num_repos: 9
69+
num_repos: 10
7070
num_teams: 0
7171
num_members: 0
7272
visibility: 0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Testing documents in LFS
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Testing READMEs in LFS

0 commit comments

Comments
 (0)