From 52e24167e5ebe0297f7630e9daecd6ffc9570a99 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 8 Mar 2023 20:24:23 -0500 Subject: [PATCH] Test renderReadmeFile (#23185) Add test coverage to the important features of [`routers.web.repo.renderReadmeFile`](https://github.com/go-gitea/gitea/blob/067b0c2664d127c552ccdfd264257caca4907a77/routers/web/repo/view.go#L273); namely that: - it can handle looking in docs/, .gitea/, and .github/ - it can handle choosing between multiple competing READMEs - it prefers the localized README to the markdown README to the plaintext README - it can handle broken symlinks when processing all the options - it uses the name of the symlink, not the name of the target of the symlink --- models/db/iterate_test.go | 2 +- models/db/list_test.go | 4 +- models/fixtures/repo_unit.yml | 6 + models/fixtures/repository.yml | 13 +++ models/fixtures/user.yml | 2 +- .../user2/readme-test.git/HEAD | 1 + .../user2/readme-test.git/config | 4 + .../user2/readme-test.git/info/exclude | 6 + .../user2/readme-test.git/info/refs | 21 ++++ .../12/11481f7314efbfe4e44703170d96c8fac8172b | Bin 0 -> 169 bytes .../17/2343566bf11fc71ba4acf8d2ea70d12bc1d037 | Bin 0 -> 214 bytes .../1a/48cae3f18ccd9c929e6608f67087dbaac3cf9e | Bin 0 -> 167 bytes .../1e/1e08102cf1b1fc01c069c88ee75445974363ab | Bin 0 -> 83 bytes .../21/470f9b3e8ff24e0fa083d2dbc447f4c3401355 | 2 + .../23/65bfe0c5714e2e3f2d53bb302b10d8d5b4fc7d | Bin 0 -> 175 bytes .../38/9d08c6a71d024a91f14089007cd789cd977ca6 | Bin 0 -> 48 bytes .../3a/a8f4e0e1a535f0f9e0ae40e6ec1bce42642bc4 | Bin 0 -> 140 bytes .../3b/23d7f1a9cb904cb46f5f2272bfa5ed5f871fb9 | 1 + .../50/6ff7310f420e878595b4bc8f11688e3f0ae14e | Bin 0 -> 166 bytes .../58/3eb775c596858380273492759d39081d65d029 | Bin 0 -> 169 bytes .../60/ea618ae7d4ecbe9c1962591c7da1b05bb1a5c8 | 3 + .../6a/b05db4c52530726c1856eb558228e9d1949e7f | Bin 0 -> 169 bytes .../71/60a063b5544b5a78131b94f47bfd200046eda2 | Bin 0 -> 167 bytes .../75/6c70c97047d8aeb11ca3c71edd9fb76cefee9c | Bin 0 -> 28 bytes .../7f/2b9f991d99362eb827b67f4ae2f5fbc5fa2271 | Bin 0 -> 211 bytes .../7f/792e709143fb0f021da2371e5f40d1bcc284fd | Bin 0 -> 166 bytes .../82/817856dadc7f6b944633e1b77d5b6e302dde06 | Bin 0 -> 51 bytes .../8b/4149e7dede3cd53ba11c64c88b057c5fe2c200 | Bin 0 -> 169 bytes .../93/54813d81053c14afe878a9f056b937ec42bb48 | Bin 0 -> 28 bytes .../9c/72c10e55e7d6ea21f591aa424e2625e8ad8094 | Bin 0 -> 136 bytes .../a3/cd04bb110e17591ac04e156c7df2c2f5c96fa6 | Bin 0 -> 82 bytes .../b0/e851a5619e2d6cee1da25a15ab67305f0861ec | Bin 0 -> 76 bytes .../b4/4c8eb00bdaf0522de61e591fee5f66851ef4b5 | Bin 0 -> 112 bytes .../b8/eaa80ad86072e1f23d2638842154ce9aceff8d | Bin 0 -> 77 bytes .../d5/34f914944c3c943a6bdb677d869ac54934928d | Bin 0 -> 31 bytes .../e2/f9904cd97b4045feecfffef5a426e9461bee70 | Bin 0 -> 117 bytes .../e3/a6fd8fe49e323ee10017f72b777a53fbd8076f | 3 + .../e7/bf02fcfa7a86f7fe9e8158b55d58ddf9d877ec | Bin 0 -> 171 bytes .../ea/57c91ddb8b4ac705b5ac4c34c7a48f2d0fc180 | Bin 0 -> 77 bytes .../fe/495ea336f079ef2bed68648d0ba9a37cdbd4aa | Bin 0 -> 197 bytes .../readme-test.git/objects/info/commit-graph | Bin 0 -> 2612 bytes .../user2/readme-test.git/objects/info/packs | 2 + ...d634b76f8154310cccb52537a0195e43166.bitmap | Bin 0 -> 1642 bytes ...33bd634b76f8154310cccb52537a0195e43166.idx | Bin 0 -> 4012 bytes ...3bd634b76f8154310cccb52537a0195e43166.pack | Bin 0 -> 7854 bytes .../user2/readme-test.git/packed-refs | 22 ++++ .../refs/heads/fallbacks-broken-symlinks | 1 + tests/integration/repo_test.go | 105 ++++++++++++++++++ 48 files changed, 194 insertions(+), 4 deletions(-) create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/HEAD create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/config create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/info/exclude create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/info/refs create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/12/11481f7314efbfe4e44703170d96c8fac8172b create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/17/2343566bf11fc71ba4acf8d2ea70d12bc1d037 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/1a/48cae3f18ccd9c929e6608f67087dbaac3cf9e create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/1e/1e08102cf1b1fc01c069c88ee75445974363ab create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/21/470f9b3e8ff24e0fa083d2dbc447f4c3401355 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/23/65bfe0c5714e2e3f2d53bb302b10d8d5b4fc7d create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/38/9d08c6a71d024a91f14089007cd789cd977ca6 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/3a/a8f4e0e1a535f0f9e0ae40e6ec1bce42642bc4 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/3b/23d7f1a9cb904cb46f5f2272bfa5ed5f871fb9 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/50/6ff7310f420e878595b4bc8f11688e3f0ae14e create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/58/3eb775c596858380273492759d39081d65d029 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/60/ea618ae7d4ecbe9c1962591c7da1b05bb1a5c8 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/6a/b05db4c52530726c1856eb558228e9d1949e7f create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/71/60a063b5544b5a78131b94f47bfd200046eda2 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/75/6c70c97047d8aeb11ca3c71edd9fb76cefee9c create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/7f/2b9f991d99362eb827b67f4ae2f5fbc5fa2271 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/7f/792e709143fb0f021da2371e5f40d1bcc284fd create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/82/817856dadc7f6b944633e1b77d5b6e302dde06 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/8b/4149e7dede3cd53ba11c64c88b057c5fe2c200 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/93/54813d81053c14afe878a9f056b937ec42bb48 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/9c/72c10e55e7d6ea21f591aa424e2625e8ad8094 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/a3/cd04bb110e17591ac04e156c7df2c2f5c96fa6 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/b0/e851a5619e2d6cee1da25a15ab67305f0861ec create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/b4/4c8eb00bdaf0522de61e591fee5f66851ef4b5 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/b8/eaa80ad86072e1f23d2638842154ce9aceff8d create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/d5/34f914944c3c943a6bdb677d869ac54934928d create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/e2/f9904cd97b4045feecfffef5a426e9461bee70 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/e3/a6fd8fe49e323ee10017f72b777a53fbd8076f create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/e7/bf02fcfa7a86f7fe9e8158b55d58ddf9d877ec create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/ea/57c91ddb8b4ac705b5ac4c34c7a48f2d0fc180 create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/fe/495ea336f079ef2bed68648d0ba9a37cdbd4aa create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/info/commit-graph create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/info/packs create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.bitmap create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.idx create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.pack create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/packed-refs create mode 100644 tests/gitea-repositories-meta/user2/readme-test.git/refs/heads/fallbacks-broken-symlinks diff --git a/models/db/iterate_test.go b/models/db/iterate_test.go index a713fe0d8b8..6bcf740c238 100644 --- a/models/db/iterate_test.go +++ b/models/db/iterate_test.go @@ -25,7 +25,7 @@ func TestIterate(t *testing.T) { return nil }) assert.NoError(t, err) - assert.EqualValues(t, 83, repoCnt) + assert.EqualValues(t, 84, repoCnt) err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error { reopUnit2 := repo_model.RepoUnit{ID: repoUnit.ID} diff --git a/models/db/list_test.go b/models/db/list_test.go index ffef1e4948e..1295692cec8 100644 --- a/models/db/list_test.go +++ b/models/db/list_test.go @@ -35,11 +35,11 @@ func TestFind(t *testing.T) { var repoUnits []repo_model.RepoUnit err := db.Find(db.DefaultContext, &opts, &repoUnits) assert.NoError(t, err) - assert.EqualValues(t, 83, len(repoUnits)) + assert.EqualValues(t, 84, len(repoUnits)) cnt, err := db.Count(db.DefaultContext, &opts, new(repo_model.RepoUnit)) assert.NoError(t, err) - assert.EqualValues(t, 83, cnt) + assert.EqualValues(t, 84, cnt) repoUnits = make([]repo_model.RepoUnit, 0, 10) newCnt, err := db.FindAndCount(db.DefaultContext, &opts, &repoUnits) diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index 503b8c9ddfa..ef0b7c1a941 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -569,3 +569,9 @@ type: 3 config: "{\"IgnoreWhitespaceConflicts\":false,\"AllowMerge\":true,\"AllowRebase\":true,\"AllowRebaseMerge\":true,\"AllowSquash\":true}" created_unix: 946684810 + +- + id: 84 + repo_id: 56 + type: 1 + created_unix: 946684810 diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index dd8facb7a31..32ba8744d45 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -1634,3 +1634,16 @@ is_private: true num_issues: 1 status: 0 + +- + id: 56 + owner_id: 2 + owner_name: user2 + lower_name: readme-test + name: readme-test + default_branch: master + is_empty: false + is_archived: false + is_private: true + status: 0 + num_issues: 0 diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml index c6081f07d06..ce54defacdc 100644 --- a/models/fixtures/user.yml +++ b/models/fixtures/user.yml @@ -66,7 +66,7 @@ num_followers: 2 num_following: 1 num_stars: 2 - num_repos: 11 + num_repos: 12 num_teams: 0 num_members: 0 visibility: 0 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/HEAD b/tests/gitea-repositories-meta/user2/readme-test.git/HEAD new file mode 100644 index 00000000000..cb089cd89a7 --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/config b/tests/gitea-repositories-meta/user2/readme-test.git/config new file mode 100644 index 00000000000..07d359d07cf --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/config @@ -0,0 +1,4 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/info/exclude b/tests/gitea-repositories-meta/user2/readme-test.git/info/exclude new file mode 100644 index 00000000000..a5196d1be8f --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/info/refs b/tests/gitea-repositories-meta/user2/readme-test.git/info/refs new file mode 100644 index 00000000000..fd5f1b98ebd --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/info/refs @@ -0,0 +1,21 @@ +ea9ef877d1d88af76682d8798418081264f10cfc refs/heads/fallbacks +0d4c14db927c9ffba01fa7e126cc748b5c02c01e refs/heads/fallbacks2 +c66d5b07c2063d3268707f22226c708b589574ef refs/heads/fallbacks3 +89f8426e9eb5eff35c09b3565836c8f8e15d0ce9 refs/heads/fallbacks4 +b0e902496eae435ad03c92a5d479f916ef2d4893 refs/heads/fallbacks5 +84a5500b5cc040b11daf53fc42c542a99589dc76 refs/heads/fallbacks6 +cf406a96e416d7de5c4c1bbfffdd672300c822bf refs/heads/fallbacks7 +0d6ac644b969e9199915a492da9dba08c179fd23 refs/heads/fallbacks8 +5038febc0c57215beb3748d7ae4091a25a4acc93 refs/heads/fallbacks9 +9134e1f178ca4cccf1a197142646f2d7627e8cd5 refs/heads/i18n +744d2441e55bc0010d6b340d303f0106a627ad29 refs/heads/master +3c492566170b057e962c025515ab38bbd7444077 refs/heads/plain +3882d6373a0882a6739b3cd9b24d21c630621234 refs/heads/sp-ace +bf5ed898252eaa50dcc01108ed4417c3ea98a294 refs/heads/special-subdir-.gitea +c03543573ab088ce1cf7090a387d2be621426234 refs/heads/special-subdir-.github +e75957ad9b7e6ed16dda183529ec283db0bbc5fe refs/heads/special-subdir-docs +46f5d5ab33d701642e08c713fab42af89fdd4fea refs/heads/special-subdir-nested +9c0f872256b839c2b97ec22fd348d87b14045513 refs/heads/subdir +d7a854fff61e45b98234d7aa79ecbcb1619cd3dd refs/heads/symlink +30b9c0ed4b1039dbd99f3fb537b84ca507e0549d refs/heads/symlink-loop +41489b7be5c2244d2b7b524dcb31caf3bd1f9ccc refs/heads/txt diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/12/11481f7314efbfe4e44703170d96c8fac8172b b/tests/gitea-repositories-meta/user2/readme-test.git/objects/12/11481f7314efbfe4e44703170d96c8fac8172b new file mode 100644 index 0000000000000000000000000000000000000000..b9009e32444a4be9dd189dc611880aef4f0d8b02 GIT binary patch literal 169 zcmV;a09OBa0iDh{4#F@Hg<)!+VlF^5cDzMGh>nhm3wW6!5zeCE6x^N&aRSP}_?}*x z$8o5jv^vz42%^@>Q$&n8FdC&YSxKgoOk~(vZzQpfMl4~ase)tIDRS6J-Eu@mC38@% z+YM{XGNz=w<}AWi`+0@ike+becG}Ylr)kgT@yp9Hm-kpplfoIKb07%!ZqC`y+u{{YMSK(^sz);i_ygQEL^6jO{e zZ)T|OdloQidXa+}u3^&C%r0_dLlI5zT9cjVdJPI4;ld-0N)2~^a1pQ=J^Bfq!Z3~o z?QE2G+S%wGd&01gUFN6;e@dzcd}mtW>+ERa1Kvxwm)p~R-s|?W%XT6E0opo;IHEQ1 zrmzpv-&5(-e><$1pB+PcWT6C7fy-^nEkR)NXJg0^Yk3t|OMO7<>Y3fI4E-nwH)(L3 Q1#$sOxp3p*7x&_1XWgo56#xJL literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/1a/48cae3f18ccd9c929e6608f67087dbaac3cf9e b/tests/gitea-repositories-meta/user2/readme-test.git/objects/1a/48cae3f18ccd9c929e6608f67087dbaac3cf9e new file mode 100644 index 0000000000000000000000000000000000000000..d8522ae6d3319a48188c99be269b1622f89e7030 GIT binary patch literal 167 zcmV;Y09gNc0iBLJ4#GeT1*!KGz5vMHFGvW{(NS>$uj3^V`6(;~wQSQ#Wl?XVw^_WIdC{=~CF{HkG3G*4BvEG1Qud8i zPT0`8r3PIx{HpD=z_pVHTwbf%>H^1c#ohgf=XvViL+y9MC!m;82sTlGEe1p*-=}r8 V{%@F@J}VUN`^@rqnhyv1PZ>ILQ$7Fy literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/1e/1e08102cf1b1fc01c069c88ee75445974363ab b/tests/gitea-repositories-meta/user2/readme-test.git/objects/1e/1e08102cf1b1fc01c069c88ee75445974363ab new file mode 100644 index 0000000000000000000000000000000000000000..d4152e535edee4dede53f2b78c5890f6010635bb GIT binary patch literal 83 zcmV-Z0IdIb0V^p=O;s>AWH2-^Ff%bx2y%6F@pWa`@t!|y#UeLtnFArh>nhm3v8SkFzih!6D0#a;)ZwSdIk(g4FWSNYUKu$Lz9@WCDOc?~pa~)axw&jwzZiIq1 zuJ+oU1dS;ror2~UDQriI8Ozu=MS&TJnUm0s>m16&U;JVSO-V6h$?=c d=3@Q7p&qhjh#mKnw6N{t&`+;TeE>rzQOAB&RpI~u literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/38/9d08c6a71d024a91f14089007cd789cd977ca6 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/38/9d08c6a71d024a91f14089007cd789cd977ca6 new file mode 100644 index 0000000000000000000000000000000000000000..c5929ae89288aa30a1a891326bc8bb9f340640f8 GIT binary patch literal 48 zcmV-00MGw;0V^p=O;s>9W-u`T0tLPF%#zeZ2HRsE+r`do2(@WGwr9=%yg1I;B`E+G GZx5ikFcZ80 literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/3a/a8f4e0e1a535f0f9e0ae40e6ec1bce42642bc4 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/3a/a8f4e0e1a535f0f9e0ae40e6ec1bce42642bc4 new file mode 100644 index 0000000000000000000000000000000000000000..106393d722517fe5c97ef75e78200b79654ea7ab GIT binary patch literal 140 zcmV;70CWF%0V^p=O;s>7Hf1m|00ITQ^vsgfLg 27Q. (c"onM<[6_^橼ZTU n qO*3{N\ \ No newline at end of file diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/50/6ff7310f420e878595b4bc8f11688e3f0ae14e b/tests/gitea-repositories-meta/user2/readme-test.git/objects/50/6ff7310f420e878595b4bc8f11688e3f0ae14e new file mode 100644 index 0000000000000000000000000000000000000000..a7f4501ea2e8b7d2c984dcf2f926497f5b9597b3 GIT binary patch literal 166 zcmV;X09pTd0iBLH4#F@H0IB_o{Q%M0@p{)1LUeRge84!%A#y1=1;58aynu3w8BLys z;ZeYOw<(J%By>uA70(!0I5Gw7qT1ldv)C*w>PWMh)1qSml2$Lwlqm+OAn3UD(J{rY zjVQJY)S-(et>r!~aC+n?9M`Jeb%EVjvAO;5Fi-t^D1DRD9&D&pvcw*?NQfqXPfNA_ UZb3S3j)Us8UW4?((1W7)${?*IS* literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/58/3eb775c596858380273492759d39081d65d029 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/58/3eb775c596858380273492759d39081d65d029 new file mode 100644 index 0000000000000000000000000000000000000000..a2dadacf8ac5c581336a8fec56846cc07f12f8ac GIT binary patch literal 169 zcmV;a09OBa0iBL9Zo@DP06Xgy{6Gv+kwgh7if-95^#c^eG(qe*aOEMtk5S|W8E?45 z={!xB4nFvgzL>#2mxfuBFg5f+3Y{omE{Lp+bJ13qRg$~QVz&+nO%i1>Zo#x#Q7XyD zLds33Vyu-UYId^r^Sr?EqE|Sqn|ihdK5rWizc2j0&*Nk2!քLuUl#qlQ,ꔡlCBn$6XDɹbbҖR0y[/On +i21Ї@epdiޭ殯 !<N \ No newline at end of file diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/6a/b05db4c52530726c1856eb558228e9d1949e7f b/tests/gitea-repositories-meta/user2/readme-test.git/objects/6a/b05db4c52530726c1856eb558228e9d1949e7f new file mode 100644 index 0000000000000000000000000000000000000000..3e4c8247d906f07f3985a58a76b08000a1d661f2 GIT binary patch literal 169 zcmV;a09OBa0V^p=O;s>7H)Sv}00ITQ^vsgfLxl>Fpkh6NdXlWfkP XQ?xj?zbJXp^RpMsW-0*yojgaTO}bCn literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/71/60a063b5544b5a78131b94f47bfd200046eda2 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/71/60a063b5544b5a78131b94f47bfd200046eda2 new file mode 100644 index 0000000000000000000000000000000000000000..477d5b1f1f4312265b57e9f6403dc133ddd83c81 GIT binary patch literal 167 zcmV;Y09gNc0iBLJ4#F@H1*v_Cy#UcVvDZdIh>nhm3)tov5Y9)zDY!im;slga%xKcs z_m4`gX*YES$XOR9!)OuX!4Zru$`1C59MBmbSfhP8}43Q9A$t literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/75/6c70c97047d8aeb11ca3c71edd9fb76cefee9c b/tests/gitea-repositories-meta/user2/readme-test.git/objects/75/6c70c97047d8aeb11ca3c71edd9fb76cefee9c new file mode 100644 index 0000000000000000000000000000000000000000..3ef17969867f6a1e4c2138ae8d469601e3c1fb5f GIT binary patch literal 28 kcmbDbEm{|z*nLb?q@?IA8^a9ULSw;^I5j2 zc&p%o+tfuBJoByuMYT+x3YJ!pHK0Znn?-|*!DR{N!HZ56B6Un0C?RF%JjK?dO*X}j zld@1Q5=+~m;aBbF16`jPaYEJa*lGXHNtRod7H)Sv}00ITQ^vsgfLqpAZcI(ND9+HwZ@WUXx$Eao>!0_~^7Hf1m|00ITQ^vsgfL$*TcJIW-;CK0dJk literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/a3/cd04bb110e17591ac04e156c7df2c2f5c96fa6 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/a3/cd04bb110e17591ac04e156c7df2c2f5c96fa6 new file mode 100644 index 0000000000000000000000000000000000000000..6d9bc2a7664fe2968b95869b01587b4eaa61a4fe GIT binary patch literal 82 zcmV-Y0ImOc0V^p=O;s?nWH2-`00M;|S4S6LSH0X6h6P%IvU?Y)CvG|R|7KUck;K%O or+%1#)#R6Cq!uv*co<)>wEEN6zbbUcs*pz-KP}|_02Heo?n7)OQvd(} literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/b0/e851a5619e2d6cee1da25a15ab67305f0861ec b/tests/gitea-repositories-meta/user2/readme-test.git/objects/b0/e851a5619e2d6cee1da25a15ab67305f0861ec new file mode 100644 index 0000000000000000000000000000000000000000..2f88dbd361ae06a6ca6202ea1441b965b36a145a GIT binary patch literal 76 zcmV-S0JHyi0V^p=O;s>6VK6ZO0tLPF%#zeZ2HRsE+r`do2(@WGwr9=%yg1I;B`FXE iDf!9848easzi??;<(R6yt3=9gw&*v>c|QTPTpYU4?IQ>P literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/b4/4c8eb00bdaf0522de61e591fee5f66851ef4b5 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/b4/4c8eb00bdaf0522de61e591fee5f66851ef4b5 new file mode 100644 index 0000000000000000000000000000000000000000..55bb8491afef625eeeb1af14dd0b3cd87974c3f3 GIT binary patch literal 112 zcmV-$0FVE80V^p=O;xb8U@$QN0tLPF%#zeZ2HRsE+r`do2(@WGwr9=%yg1I;B`Jmm z24*HE3PG-pF21e|m#6VK6ZO0tLPF%#zeZ2HRsE+r`do2(@WGwr9=%yg1I;B`FXE jDf!983=1;&CfS@nr)Y6(e^K(H=VvdN%~S#at56)Q)g~dT literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/d5/34f914944c3c943a6bdb677d869ac54934928d b/tests/gitea-repositories-meta/user2/readme-test.git/objects/d5/34f914944c3c943a6bdb677d869ac54934928d new file mode 100644 index 0000000000000000000000000000000000000000..7bb434442f72d254b112e2740ebf900a8bcd1e73 GIT binary patch literal 31 ncmb7Fk>(@G5`XFAXi5hUst`{6b8%sw0Rmmf%9Jnzj)s0?^SW} zGS5X5u$toh+*F3eXIXX&@`*=E9q<#)sr_{5>&g6OP%}!35_1dkb29T%8JyT;7#ALA Xn11m|__kh3)c literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/e3/a6fd8fe49e323ee10017f72b777a53fbd8076f b/tests/gitea-repositories-meta/user2/readme-test.git/objects/e3/a6fd8fe49e323ee10017f72b777a53fbd8076f new file mode 100644 index 00000000000..2307ba82dca --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/objects/e3/a6fd8fe49e323ee10017f72b777a53fbd8076f @@ -0,0 +1,3 @@ +xM +1 a=E.m Νwh#"A&L \ No newline at end of file diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/e7/bf02fcfa7a86f7fe9e8158b55d58ddf9d877ec b/tests/gitea-repositories-meta/user2/readme-test.git/objects/e7/bf02fcfa7a86f7fe9e8158b55d58ddf9d877ec new file mode 100644 index 0000000000000000000000000000000000000000..9f898ef87387dc17cf15c794fd48d43921ddccbc GIT binary patch literal 171 zcmV;c095~Y0hNw94#F@H0IB_o{Q!~e_>>T$qod*j>&==(ITf6O-xHyHfO3i%4b9`& z70^bX%E}DM7z&)EObupfwQkrcwozqfo1F_*aW=_{1y`O5C^UhP>#PD%6DjJ*&dHFS zm%%p)k!s431#YFCS9o;P!+qP;mRGn;J65j)Z_7M<#xhidS5VG-YgKImoTZgg(C@VD Z)}IaSwLco-$?pOghan;L;tL^5Pf1exQLg|1 literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/ea/57c91ddb8b4ac705b5ac4c34c7a48f2d0fc180 b/tests/gitea-repositories-meta/user2/readme-test.git/objects/ea/57c91ddb8b4ac705b5ac4c34c7a48f2d0fc180 new file mode 100644 index 0000000000000000000000000000000000000000..d1eff52868d457865f396c829e7060972f4f3ac8 GIT binary patch literal 77 zcmV-T0J8sh0V^p=O;s>6VK6ZO0tLPF%#zeZ2HRsE+r`do2(@WGwr9=%yg1I;B`FXE jDf!9841Xgw?YVe?)2-mtT+c<4vwUKHHtqxfy8Rtw@<$_V literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/fe/495ea336f079ef2bed68648d0ba9a37cdbd4aa b/tests/gitea-repositories-meta/user2/readme-test.git/objects/fe/495ea336f079ef2bed68648d0ba9a37cdbd4aa new file mode 100644 index 0000000000000000000000000000000000000000..48c0b5a4d621e0a9c34ca50ef4b53faef90a273a GIT binary patch literal 197 zcmV;$06PD80iBLJPQ@?~0I7Y7y#P>Y-s!xWb5UIux&=!md zok5Mp23L*FH7h!0+BE5Aa}QWMT04ba7*V02d(J2f}1=advSGfw0*u+~I7_Jy5kkic0~(CW*xaR80zI z2CAnOW&xUw53>U0kue*PkB-@aV(6FyC`JtC1gfJp<^q~YF6IX6r3CW;^`m26pcp>P z2b3ok^8?jV6AJ*%BNqz-^$Ov@!a#9CSOlmB9~K456T)IZHMp=iP!5JAfNV;!B+v{L z%8zK1&YU-HHxe zmCLN&ILp~k?&R0C20IVD^%k(aeRID3R`VS`OW7ZU%(ZB`W^TpNw5)ix&CN}|ipLC+ zgiLHaRnx?|S?i|hFolY)w%C2$#i88MV|Mk^Ln^-7)j__e4NraED?jIq+t;hBjjuDN z=y4nu{a%$(Dvd$k)dGofu z{~W`)IV{5L#E*xuJTE7jJp5R3%ID0-h0{gU+&*1Ts_VHrhreAZY=`Bcopp!wFMHgm z7GVh$-tdyiGjE-9)CHSKORrS^6nn4hF?oO7jTx$Xs{-yE5af94B7XSQj73upm^z1B zZRj{B^PQ8+qE`EvqEnK|vD|3(Lu|H283px9N;w7H5mQUvpLfWb_C)OZy%-Ix>+JAjT$p3G0t~;AduCJ$FT zc6MFf#oSvGrkZawY&Yya`tQ}eALSQsbb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7gFUJa0%1r@SjNiFDB4lp)~)olHmxHKvXsjg4lcwxWUsJQ7 z@UMW>dKV%d-C{LcpOn>QUQwocle<|k?zc@QOZR2Y!kYOd^oxFS4Mh**I;r_W=R*eq=2NAYGG|-jj0Ssv;q{a%WiEK2 uw}0273(tKwB>v_j;V$YM?vyFwlKmG$ksnc)( literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.idx b/tests/gitea-repositories-meta/user2/readme-test.git/objects/pack/pack-8933bd634b76f8154310cccb52537a0195e43166.idx new file mode 100644 index 0000000000000000000000000000000000000000..561e0f2e9d241a658eca432443f071acb88482ce GIT binary patch literal 4012 zcmb7{c{J7g*T)YTjw!^!$rP@cB1497%(Fy>GGq=JawAh_U9&PK3in(yAqtU9nTN<6 zGF&1<5i;}J*5X-~)$@DS^T%uL;q&?Iy}xIzv(|nexL&hFAP~3!&XGOzPjUugJOCdc zI0X{o-$4X!#2s*H6;QR>~z-K%K z6U3)shTJh1z(0ib2sW^PoPZttlW;)H32^-e9?0>YfDioB@I&sHi{SrnT!J%!BLu+; z{RUyk9U^jsDA;4JfPWG(h{b<{1mup91pgQ*@J}KQ@kwMLJ_ZB6{BKZ%+)0!mK1Lb* zLsX7X1*>)nb%+nq1hoDO+HiLL6gm(eas$viLLcmD3?OHCiklFhS=j@=<@z$?&|37rW?LgVP9B(_3oii9`3Vzp;~hZ=Ip~884LZvWzR?Wj@<7vE-0qgEMUo z*so23WddZtHn%!G~gj16L%Ffm!!ct`3)IvNQ=;oD&xJvq|NOyq>n8J2x9}P0gdH zm$XNMIA`o0?G^ptC$8)Ys-okyW?@2CRoQK5N$`CW`Ed16`C?Ur3K(~(CY5rUj$*y5 zK~3)p4xCJhQe3U1xh}Aip(eb9H1HBd5v!^iW_41sDk|W z+pl>x)5fmNt82Q)284Ew1}Oi$796>E`?l7@hgt`VdpiiPpTXD?mgf5ecjK>$<7kWR zzauqZFK2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X%RUxXC09N#s$^_9wS z!D5cZ(z2j>t$w@N3g|O|SU2Ff!%;s%@c1zN{wyZ`3I!+Ug<_>YRXgzdZ<(4J0c z4~76>q9uFxI|lSn#c5*I>4oO~$!P%_?@whJ*S9MTIR`a-34q!xNJ91>CBadAbi=ic zZ{HW!T|x?U_#a&4W)_5Zr@^juo&fOtAZt%?qTAxr6TGT+r2{&w*8%10!Yttf0#!tk zkNzsz)(hUl*(M-E>*mWnfu1GPrg^_;EIua5bwu z?kA3f=i$(hTQj#pR%p_LdPmIbwm~CP;s$ueqCBhrkA5kV`Lf@BhWB}IL|tcL^If+o zx$dePctGw=X2stNai~vX_jBJ)yPr#qbUIW1Mm$I~z02g&8Z8i>38Fo2jl&$i|J-s+*VqtehCp8HaknnRW0{e}(|$bD+elzF)r@1%EK6-c*~*4Q^los;0s9e{=N< zWX+gD9B&N6Adk%zv*PM_qzf}64FbpZ-21`o@Y42}51fwz8hvg@h zCL=Pm>?bjNDaSX6p_RM$^*mz*5s=AFD)UPW9j?-Qv-20ErPuET&|CJFFjnh#Pm=-D z!4RI~`HE{P4P1XM%(`|9^6PVTV0gK&cIX)3rk)Pp0It^xnn~~f{Z*3(?a6P*Z1dfF z^!mfYCnxc5OfJ6Mzyqp=z@+s!1>WxB>(cHq=qSFzCD5sZ6}YOV12ydE5Y)+^#|It| zpKN~ehc6sIun$L*&D*tZd5T6Jz?}UpsUek2{Laj)F>DD*!!b_MJhW{VoRCZec literal 0 HcmV?d00001 diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/packed-refs b/tests/gitea-repositories-meta/user2/readme-test.git/packed-refs new file mode 100644 index 00000000000..2399a8008dc --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/packed-refs @@ -0,0 +1,22 @@ +# pack-refs with: peeled fully-peeled sorted +ea9ef877d1d88af76682d8798418081264f10cfc refs/heads/fallbacks +0d4c14db927c9ffba01fa7e126cc748b5c02c01e refs/heads/fallbacks2 +c66d5b07c2063d3268707f22226c708b589574ef refs/heads/fallbacks3 +89f8426e9eb5eff35c09b3565836c8f8e15d0ce9 refs/heads/fallbacks4 +b0e902496eae435ad03c92a5d479f916ef2d4893 refs/heads/fallbacks5 +84a5500b5cc040b11daf53fc42c542a99589dc76 refs/heads/fallbacks6 +cf406a96e416d7de5c4c1bbfffdd672300c822bf refs/heads/fallbacks7 +0d6ac644b969e9199915a492da9dba08c179fd23 refs/heads/fallbacks8 +5038febc0c57215beb3748d7ae4091a25a4acc93 refs/heads/fallbacks9 +9134e1f178ca4cccf1a197142646f2d7627e8cd5 refs/heads/i18n +744d2441e55bc0010d6b340d303f0106a627ad29 refs/heads/master +3c492566170b057e962c025515ab38bbd7444077 refs/heads/plain +3882d6373a0882a6739b3cd9b24d21c630621234 refs/heads/sp-ace +bf5ed898252eaa50dcc01108ed4417c3ea98a294 refs/heads/special-subdir-.gitea +c03543573ab088ce1cf7090a387d2be621426234 refs/heads/special-subdir-.github +e75957ad9b7e6ed16dda183529ec283db0bbc5fe refs/heads/special-subdir-docs +46f5d5ab33d701642e08c713fab42af89fdd4fea refs/heads/special-subdir-nested +9c0f872256b839c2b97ec22fd348d87b14045513 refs/heads/subdir +d7a854fff61e45b98234d7aa79ecbcb1619cd3dd refs/heads/symlink +30b9c0ed4b1039dbd99f3fb537b84ca507e0549d refs/heads/symlink-loop +41489b7be5c2244d2b7b524dcb31caf3bd1f9ccc refs/heads/txt diff --git a/tests/gitea-repositories-meta/user2/readme-test.git/refs/heads/fallbacks-broken-symlinks b/tests/gitea-repositories-meta/user2/readme-test.git/refs/heads/fallbacks-broken-symlinks new file mode 100644 index 00000000000..cf36865a712 --- /dev/null +++ b/tests/gitea-repositories-meta/user2/readme-test.git/refs/heads/fallbacks-broken-symlinks @@ -0,0 +1 @@ +fe495ea336f079ef2bed68648d0ba9a37cdbd4aa diff --git a/tests/integration/repo_test.go b/tests/integration/repo_test.go index 7c3eac20cfa..cef9dccf24f 100644 --- a/tests/integration/repo_test.go +++ b/tests/integration/repo_test.go @@ -257,6 +257,111 @@ func TestViewRepoDirectory(t *testing.T) { assert.Zero(t, repoSummary.Length()) } +// ensure that the all the different ways to find and render a README work +func TestViewRepoDirectoryReadme(t *testing.T) { + defer tests.PrepareTestEnv(t)() + + // there are many combinations: + // - READMEs can be .md, .txt, or have no extension + // - READMEs can be tagged with a language and even a country code + // - READMEs can be stored in docs/, .gitea/, or .github/ + // - READMEs can be symlinks to other files + // - READMEs can be broken symlinks which should not render + // + // this doesn't cover all possible cases, just the major branches of the code + + session := loginUser(t, "user2") + + check := func(name, url, expectedFilename, expectedReadmeType, expectedContent string) { + t.Run(name, func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + + req := NewRequest(t, "GET", url) + resp := session.MakeRequest(t, req, http.StatusOK) + + htmlDoc := NewHTMLParser(t, resp.Body) + readmeName := htmlDoc.doc.Find("h4.file-header") + readmeContent := htmlDoc.doc.Find(".file-view") // TODO: add a id="readme" to the output to make this test more precise + readmeType, _ := readmeContent.Attr("class") + + assert.Equal(t, expectedFilename, strings.TrimSpace(readmeName.Text())) + assert.Contains(t, readmeType, expectedReadmeType) + assert.Contains(t, readmeContent.Text(), expectedContent) + }) + } + + // viewing the top level + check("Home", "/user2/readme-test/", "README.md", "markdown", "The cake is a lie.") + + // viewing different file extensions + check("md", "/user2/readme-test/src/branch/master/", "README.md", "markdown", "The cake is a lie.") + check("txt", "/user2/readme-test/src/branch/txt/", "README.txt", "plain-text", "My spoon is too big.") + check("plain", "/user2/readme-test/src/branch/plain/", "README", "plain-text", "Birken my stocks gee howdy") + check("i18n", "/user2/readme-test/src/branch/i18n/", "README.zh.md", "markdown", "蛋糕是一个谎言") + + // viewing different subdirectories + check("subdir", "/user2/readme-test/src/branch/subdir/libcake", "README.md", "markdown", "Four pints of sugar.") + check("docs-direct", "/user2/readme-test/src/branch/special-subdir-docs/docs/", "README.md", "markdown", "This is in docs/") + check("docs", "/user2/readme-test/src/branch/special-subdir-docs/", "docs/README.md", "markdown", "This is in docs/") + check(".gitea", "/user2/readme-test/src/branch/special-subdir-.gitea/", ".gitea/README.md", "markdown", "This is in .gitea/") + check(".github", "/user2/readme-test/src/branch/special-subdir-.github/", ".github/README.md", "markdown", "This is in .github/") + + // symlinks + // symlinks are subtle: + // - they should be able to handle going a reasonable number of times up and down in the tree + // - they shouldn't get stuck on link cycles + // - they should determine the filetype based on the name of the link, not the target + check("symlink", "/user2/readme-test/src/branch/symlink/", "README.md", "markdown", "This is in some/other/path") + check("symlink-multiple", "/user2/readme-test/src/branch/symlink/some/", "README.txt", "plain-text", "This is in some/other/path") + check("symlink-up-and-down", "/user2/readme-test/src/branch/symlink/up/back/down/down", "README.md", "markdown", "It's a me, mario") + + // testing fallback rules + // READMEs are searched in this order: + // - [README.zh-cn.md, README.zh_cn.md, README.zh.md, README_zh.md, README.md, README.txt, README, + // docs/README.zh-cn.md, docs/README.zh_cn.md, docs/README.zh.md, docs/README_zh.md, docs/README.md, docs/README.txt, docs/README, + // .gitea/README.zh-cn.md, .gitea/README.zh_cn.md, .gitea/README.zh.md, .gitea/README_zh.md, .gitea/README.md, .gitea/README.txt, .gitea/README, + + // .github/README.zh-cn.md, .github/README.zh_cn.md, .github/README.zh.md, .github/README_zh.md, .github/README.md, .github/README.txt, .github/README] + // and a broken/looped symlink counts as not existing at all and should be skipped. + // again, this doesn't cover all cases, but it covers a few + check("fallback/top", "/user2/readme-test/src/branch/fallbacks/", "README.en.md", "markdown", "This is README.en.md") + check("fallback/2", "/user2/readme-test/src/branch/fallbacks2/", "README.md", "markdown", "This is README.md") + check("fallback/3", "/user2/readme-test/src/branch/fallbacks3/", "README", "plain-text", "This is README") + check("fallback/4", "/user2/readme-test/src/branch/fallbacks4/", "docs/README.en.md", "markdown", "This is docs/README.en.md") + check("fallback/5", "/user2/readme-test/src/branch/fallbacks5/", "docs/README.md", "markdown", "This is docs/README.md") + check("fallback/6", "/user2/readme-test/src/branch/fallbacks6/", "docs/README", "plain-text", "This is docs/README") + check("fallback/7", "/user2/readme-test/src/branch/fallbacks7/", ".gitea/README.en.md", "markdown", "This is .gitea/README.en.md") + check("fallback/8", "/user2/readme-test/src/branch/fallbacks8/", ".gitea/README.md", "markdown", "This is .gitea/README.md") + check("fallback/9", "/user2/readme-test/src/branch/fallbacks9/", ".gitea/README", "plain-text", "This is .gitea/README") + + // this case tests that broken symlinks count as missing files, instead of rendering their contents + check("fallbacks-broken-symlinks", "/user2/readme-test/src/branch/fallbacks-broken-symlinks/", "docs/README", "plain-text", "This is docs/README") + + // some cases that should NOT render a README + // - /readme + // - /.github/docs/README.md + // - a symlink loop + + missing := func(name, url string) { + t.Run("missing/"+name, func(t *testing.T) { + defer tests.PrintCurrentTest(t)() + + req := NewRequest(t, "GET", url) + resp := session.MakeRequest(t, req, http.StatusOK) + + htmlDoc := NewHTMLParser(t, resp.Body) + _, exists := htmlDoc.doc.Find(".file-view").Attr("class") + fmt.Printf("%s", resp.Body) + + assert.False(t, exists, "README should not have rendered") + }) + } + missing("sp-ace", "/user2/readme-test/src/branch/sp-ace/") + missing("nested-special", "/user2/readme-test/src/branch/special-subdir-nested/subproject") // the special subdirs should only trigger on the repo root + // missing("special-subdir-nested", "/user2/readme-test/src/branch/special-subdir-nested/") // This is currently FAILING, due to a bug introduced in https://github.com/go-gitea/gitea/pull/22177 + missing("symlink-loop", "/user2/readme-test/src/branch/symlink-loop/") +} + func TestMarkDownImage(t *testing.T) { defer tests.PrepareTestEnv(t)()