diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-12-17 10:32:08 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-12-17 10:32:08 +0300 |
commit | 29330e9d6cca6bbd408f0248b700e6a32bf9b871 (patch) | |
tree | 82690c5a2be8780fd94a5b657eba800bcdaf8e8f | |
parent | 3d3e591a6caacfde7fbc58c7838af014d7e21f10 (diff) |
Fix tests failing due to test-repo change
-rw-r--r-- | _support/gitlab-git-test.git-packed-refs | 20 | ||||
-rw-r--r-- | _support/gitlab-test.git-packed-refs | 94 | ||||
-rw-r--r-- | _support/makegen.go | 8 | ||||
-rw-r--r-- | changelogs/unreleased/fix-lfs-test.yml | 5 | ||||
-rw-r--r-- | doc/test_repos.md | 18 | ||||
-rw-r--r-- | internal/service/blob/lfs_pointers_test.go | 18 |
6 files changed, 162 insertions, 1 deletions
diff --git a/_support/gitlab-git-test.git-packed-refs b/_support/gitlab-git-test.git-packed-refs new file mode 100644 index 000000000..4fed4130f --- /dev/null +++ b/_support/gitlab-git-test.git-packed-refs @@ -0,0 +1,20 @@ +# pack-refs with: peeled fully-peeled sorted +0b4bc9a49b562e85de7cc9e834518ea6828729b9 refs/heads/feature +12d65c8dd2b2676fa3ac47d955accc085a37a9c1 refs/heads/fix +6473c90867124755509e100d0d35ebdc85a0b6ae refs/heads/fix-blob-path +58fa1a3af4de73ea83fe25a1ef1db8e0c56f67e5 refs/heads/fix-existing-submodule-dir +40f4a7a617393735a95a0bb67b08385bc1e7c66d refs/heads/fix-mode +9abd6a8c113a2dd76df3fdb3d58a8cec6db75f8d refs/heads/gitattributes +46e1395e609395de004cacd4b142865ab0e52a29 refs/heads/gitattributes-updated +4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 refs/heads/master +5937ac0a7beb003549fc5fd26fc247adbce4a52e refs/heads/merge-test +c54ad072fabee9f7bf9b2c6c67089db97ebfbecd refs/heads/rd-add-file-larger-than-1-mb +4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 refs/heads/Ääh-test-utf-8 +f4e6814c3e4e7a0de82a9e7cd20c626cc963a2f8 refs/tags/v1.0.0 +^6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 +8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b refs/tags/v1.1.0 +^5937ac0a7beb003549fc5fd26fc247adbce4a52e +10d64eed7760f2811ee2d64b44f1f7d3b364f17b refs/tags/v1.2.0 +^eb49186cfa5c4338011f5f590fac11bd66c5c631 +2ac1f24e253e08135507d0830508febaaccf02ee refs/tags/v1.2.1 +^fa1b1e6c004a68b7d8763b86455da9e6b23e36d6 diff --git a/_support/gitlab-test.git-packed-refs b/_support/gitlab-test.git-packed-refs new file mode 100644 index 000000000..42df2144a --- /dev/null +++ b/_support/gitlab-test.git-packed-refs @@ -0,0 +1,94 @@ +# pack-refs with: peeled fully-peeled sorted +e56497bb5f03a90a51293fc6d516788730953899 refs/heads/'test' +1b12f15a11fc6e62177bef08f47bc7b5ce50b141 refs/heads/100%branch +1942eed5cc108b19c7405106e81fa96125d0be22 refs/heads/1942eed5cc108b19c7405106e81fa96125d0be22 +bf12d2567099e26f59692896f73ac819bae45b00 refs/heads/2-mb-file +b89b56d795dcf0351e9d627b58fd2fc67616da05 refs/heads/add-balsamiq-file +93ee73207dcfa56fe60ab8245e0623160ab8b212 refs/heads/add-ipython-files +e774ebd33ca5de8e6ef1e633fd887bb52b9d0a7a refs/heads/add-pdf-file +79faa7bfb522480533f4d60368d8f6ecc1e03d9b refs/heads/add-pdf-text-binary +010d10642f5950c8d5041f0469593ccc5c646521 refs/heads/add_images_and_changes +ba3faa7dbecdb555c748b36e8bc0f427e69de5e7 refs/heads/after-create-delete-modify-move +77e835ef0856f33c4f0982f84d10bdb0567fe440 refs/heads/author-committer-different +845009f4d7bdc9e0d8f26b1c6fb6e108aaff9314 refs/heads/before-create-delete-modify-move +ef16b8d2b204706bd8dc211d4011a5bffb6fc0c2 refs/heads/big-files +7b1cf4336b528e0f3d1d140ee50cafdbc703597c refs/heads/binary-encoding +4e07b243e436fd6ca00ca421fa507daad3310839 refs/heads/blob-with-tricky-encoding +498214de67004b1da3d820901307bed2a68a8ef6 refs/heads/branch-merged +259a6fba859cc91c54cd86a2cbd4c2f720e3a19d refs/heads/conflict-binary-file +78a30867c755d774340108cdad5f11254818fb0c refs/heads/conflict-contains-conflict-markers +eb227b3e214624708c474bdab7bde7afc17cefcc refs/heads/conflict-missing-side +d0a293c0ac821fadfdc086fe528f79423004229d refs/heads/conflict-non-utf8 +1450cd639e0bc6721eb02800169e464f212cde06 refs/heads/conflict-resolvable +824be604a34828eb682305f0d963056cfac87b2d refs/heads/conflict-start +39fa04f48a13ea003c4db3623b4decc9df887c48 refs/heads/conflict-too-large +5b4bb08538b9249995b94aa69121365ba9d28082 refs/heads/conflict_branch_a +f0f390655872bb2772c85a0128b2fbc2d88670cb refs/heads/conflict_branch_b +593890758a6f845c600f38ffa05be2749211caee refs/heads/crlf-diff +3dd08961455abf80ef9115f4afdc1c6f968b503c refs/heads/csv +1eda481c3d5499e81cbbe15d34c53282e87627d2 refs/heads/custom-encoding +6c177980d2073c20c4e4f0f45253a5500f1b23e1 refs/heads/deleted-image-test +7efb185dd22fd5c51ef044795d62b7847900c341 refs/heads/empty-branch +98b0d8b3aec8e7f7b339fd40c446ad22cbc565fe refs/heads/ends-with.json +4842455ecb8ec1428d0e83ee6389885bf98919d3 refs/heads/expand-collapse-diffs +025db92c6c720f030b936133cb44a16de3445daa refs/heads/expand-collapse-files +238e82dcc48eebf0036fdd23dd234ee950f0e0d3 refs/heads/expand-collapse-lines +0b4bc9a49b562e85de7cc9e834518ea6828729b9 refs/heads/feature +1a35b5a77cf6af7edf6703f88e82f6aff613666f refs/heads/feature-and-encoding +8309e68585b28d61eb85b7e2834849dda6bf1733 refs/heads/feature-encoding-conflict +5a62481d563af92b8e32d735f2fa63b94e806835 refs/heads/feature.custom-highlighting +bb5206fee213d983da88c47f9cf4cc6caf9c66dc refs/heads/feature_conflict +0031876facac3f2b2702a0e53a26e89939a42209 refs/heads/few-commits +06041ab2037429d243a38abb55957818dd9f948d refs/heads/file-mode-change +48f0be4bd10c1decee6fae52f9ae6d10f77b60f4 refs/heads/fix +ce369011c189f62c815f5971d096b26759bab0d1 refs/heads/flat-path +d25b6d94034242f3930dfcfeb6d8d9aac3583992 refs/heads/flat-path-2 +e56497bb5f03a90a51293fc6d516788730953899 refs/heads/flatten-dirs +ab2c9622c02288a2bbaaf35d96088cfdff31d9d9 refs/heads/gitaly-diff-stuff +0999bb770f8dc92ab5581cc0b474b3e31a96bf5c refs/heads/gitaly-non-utf8-commit +94bb47ca1297b7b3731ff2a36923640991e9236f refs/heads/gitaly-rename-test +cb19058ecc02d01f8e4290b7e79cafd16a8839b6 refs/heads/gitaly-stuff +e63f41fe459e62e1228fcef60d7189127aeba95a refs/heads/gitaly-test-ref +c809470461118b7bcab850f6e9a7ca97ac42f8ea refs/heads/gitaly-windows-1251 +5937ac0a7beb003549fc5fd26fc247adbce4a52e refs/heads/improve/awesome +7df99c9ad5b8c9bfc5ae4fb7a91cc87adcce02ef refs/heads/jv-conflict-1 +bd493d44ae3c4dd84ce89cb75be78c4708cbd548 refs/heads/jv-conflict-2 +d23bddc916b96c98ff192e198b1adee0f6871085 refs/heads/many_files +0ed8c6c6752e8c6ea63e7b92a517bf5ac1209c80 refs/heads/markdown +1e292f8fedd741b75372e19097c76d327140c312 refs/heads/master +646ece5cfed840eca0a4feb21bcd6a81bb19bda3 refs/heads/merge-commit-analyze-after +21751bf5cb2b556543a11018c1f13b35e44a99d7 refs/heads/merged-target +46abbb087fcc0fd02c340f0f2f052bd2c7708da3 refs/heads/moar-lfs-ptrs +b83d6e391c22777fca1ed3012fce84f633d7fed0 refs/heads/not-merged-branch +b83d6e391c22777fca1ed3012fce84f633d7fed0 refs/heads/not-mergéd-branch +45127a93e4fa99ee1709a3a9aed3d677d78cbf1b refs/heads/orphaned-branch +7897d5b9c5e420760eb63782ebae25371ad2325c refs/heads/pages-deploy +7975be0116940bf2ad4321f79d02a55c5f7779aa refs/heads/pages-deploy-target +fe42f41cdc7ca97ae200fb50a268431add95901a refs/heads/png-lfs +c84ff944ff4529a70788a5e9003c2b7feae29047 refs/heads/rd-add-file-larger-than-1-mb +ca47bfd5e930148c42ed74c3b561a8783e381f7f refs/heads/rebase-encoding-failure-trigger +6101e87e575de14b38b4e1ce180519a813671e10 refs/heads/signed-commits +ba3343bc4fa403a8dfbfcab7fc1a8c29ee34bd69 refs/heads/spooky-stuff +35236eac0ce603467ba37d2f99cb591df4cb8f63 refs/heads/squash-encoding-error-trigger +54cec5282aa9f21856362fe321c800c236a61615 refs/heads/squash-large-files +b491b929a311ca258a0731e58d73b7b089c7c358 refs/heads/submodule_inside_folder +81e6355ce4e1544a3524b230952c12455de0777b refs/heads/symlink-expand-diff +899d3d27b04690ac1cd9ef4d8a74fde0667c57f1 refs/heads/test-do-not-touch +304d257dcb821665ab5110318fc58a007bd104ed refs/heads/two-commits +2f61d70f862c6a4f782ef7933e020a118282db29 refs/heads/use-gitlab-shell-v-6-0-1 +de78448b0b504f3f60093727bddfda1ceee42345 refs/heads/use-gitlab-shell-v-6-0-3 +f05a98786e4274708e1fa118c7ad3a29d1d1b9a3 refs/heads/utf-16 +816c271cd6398818b04f974780a2b87162718c80 refs/heads/utf-16-2 +4451372901c41a32f985a54c526da03ce8312291 refs/heads/utf-dir +b83d6e391c22777fca1ed3012fce84f633d7fed0 refs/heads/v1.1.0 +f3ec7ba3fd368de6663df341bc25f6bb2fa18135 refs/heads/very-large-diff-ordered +88790590ed1337ab189bccaa355f068481c90bec refs/heads/video +b9238ee5bf1d7359dd3b8c89fd76c1c7f8b75aba refs/heads/wip +219560e1a2bd7db7753f179a164483761089a53b refs/heads/with-codeowners +6b8dc4a827797aa025ff6b8f425e583858a10d4f refs/heads/with-executables +7975be0116940bf2ad4321f79d02a55c5f7779aa refs/heads/Ääh-test-utf-8 +e63f41fe459e62e1228fcef60d7189127aeba95a refs/heads/ʕ•ᴥ•ʔ +f4e6814c3e4e7a0de82a9e7cd20c626cc963a2f8 refs/tags/v1.0.0 +^6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9 +8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b refs/tags/v1.1.0 +^5937ac0a7beb003549fc5fd26fc247adbce4a52e diff --git a/_support/makegen.go b/_support/makegen.go index 949fed8f3..202357cc7 100644 --- a/_support/makegen.go +++ b/_support/makegen.go @@ -289,9 +289,17 @@ binaries: assemble git clone --bare --quiet https://gitlab.com/gitlab-org/gitlab-test.git $@ # Git notes aren't fetched by default with git clone git -C $@ fetch origin refs/notes/*:refs/notes/* + rm -rf $@/refs + mkdir -p $@/refs/heads $@/refs/tags + cp {{ .SourceDir }}/_support/gitlab-test.git-packed-refs $@/packed-refs + git -C $@ fsck --no-progress {{ .GitTestRepo }}: git clone --bare --quiet https://gitlab.com/gitlab-org/gitlab-git-test.git $@ + rm -rf $@/refs + mkdir -p $@/refs/heads $@/refs/tags + cp {{ .SourceDir }}/_support/gitlab-git-test.git-packed-refs $@/packed-refs + git -C $@ fsck --no-progress .PHONY: prepare-tests prepare-tests: {{ .TestRepo }} {{ .GitTestRepo }} ../.ruby-bundle diff --git a/changelogs/unreleased/fix-lfs-test.yml b/changelogs/unreleased/fix-lfs-test.yml new file mode 100644 index 000000000..9b28722c8 --- /dev/null +++ b/changelogs/unreleased/fix-lfs-test.yml @@ -0,0 +1,5 @@ +--- +title: Fix tests failing due to test-repo change +merge_request: 1004 +author: +type: other diff --git a/doc/test_repos.md b/doc/test_repos.md new file mode 100644 index 000000000..96ad9f06d --- /dev/null +++ b/doc/test_repos.md @@ -0,0 +1,18 @@ +# Repositories used by the Gitaly test suite + +Gitaly uses two test repositories. One should be enough but we got a +second one for free when importing code from gitlab-ce. + +These repositories get cloned by `make prepare-tests`. They end up in: + +- `internal/testhelper/testdata/data/gitlab-test.git` +- `internal/testhelper/testdata/data/gitlab-git-test.git` + +To prevent fragile tests, we use fixed `packed-refs` files for these +repositories. They get installed by make (see `_support/makegen.go`) +from files in `_support`. + +To update `packed-refs` run `git gc` in your test repo and copy the new +`packed-refs` to the right location in `_support`. + +**TODO** define workflow "for dummies" to update packed-refs. diff --git a/internal/service/blob/lfs_pointers_test.go b/internal/service/blob/lfs_pointers_test.go index 3dedf32af..86025f816 100644 --- a/internal/service/blob/lfs_pointers_test.go +++ b/internal/service/blob/lfs_pointers_test.go @@ -386,8 +386,24 @@ func TestSuccessfulGetAllLFSPointersRequest(t *testing.T) { Data: []byte("version https://git-lfs.github.com/spec/v1\noid sha256:bad71f905b60729f502ca339f7c9f001281a3d12c68a5da7f15de8009f4bd63d\nsize 18\n"), Oid: "bab31d249f78fba464d1b75799aad496cc07fa3b", }, + { + Size: 132, + Data: []byte("version https://git-lfs.github.com/spec/v1\noid sha256:96f74c6fe7a2979eefb9ec74a5dfc6888fb25543cf99b77586b79afea1da6f97\nsize 1219696\n"), + Oid: "ff0ab3afd1616ff78d0331865d922df103b64cf0", + }, + { + Size: 129, + Data: []byte("version https://git-lfs.github.com/spec/v1\noid sha256:8c1e8de917525f83104736f6c64d32f0e2a02f5bf2ee57843a54f222cba8c813\nsize 2797\n"), + Oid: "0360724a0d64498331888f1eaef2d24243809230", + }, + { + Size: 129, + Data: []byte("version https://git-lfs.github.com/spec/v1\noid sha256:47997ea7ecff33be61e3ca1cc287ee72a2125161518f1a169f2893a5a82e9d95\nsize 7501\n"), + Oid: "125fcc9f6e33175cb278b9b2809154d2535fe19f", + }, } - require.ElementsMatch(t, getAllPointers(t, c), expectedLFSPointers) + + require.ElementsMatch(t, expectedLFSPointers, getAllPointers(t, c)) } func getAllPointers(t *testing.T, c gitalypb.BlobService_GetAllLFSPointersClient) []*gitalypb.LFSPointer { |