Skip to content
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

Test views of LFS files #22196

Merged
merged 3 commits into from
Dec 22, 2022
Merged

Test views of LFS files #22196

merged 3 commits into from
Dec 22, 2022

Commits on Dec 22, 2022

  1. Test views of LFS files

    Follow up to go-gitea#22195:
    that happened because there was no testing of how the UI
    reacts to LFS files.
    
    Until now Gitea has tested LFS via:
    
    - the internal go API
    - the external HTTP API
    - the external git+http:// protocol
    - the external git+ssh:// protocol
    
    The first is small unit tests, and can create LFS structs in memory
    as necessary. The latter all run `git lfs track *` and upload two random
    binaries. ("code.gitea.io/gitea/tests/integration".lfsCommitAndPushTest)
    In both cases, the LFS data are created by procedural code.
    
    This is different: it adds declaractive LFS fixtures. That means a new
    repo in gitea-repositories-meta/, a new folder for LFS objects in
    gitea-lfs-meta/, and associated database entries in models/fixtures/.
    
    Using this, it can easily add testing LFS via:
    
    - the internal HTTP UI
    
    Sources
    -------
    
    - lfs.git was hand-crafted using git commands, then `git push`ed into an
      empty bare repo.
    
    Its contents:
    
    - CONTRIBUTING.md (LFS object 7b6b2c88dba9f760a1a58469b67fee2b698ef7e9399c4ca4f34a14ccbe39f623)
      was hand-written.
    - subdir/README.md (LFS object 9d172e5c64b4f0024b9901ec6afe9ea052f3c9b6ff9f4b07956d8c48c86fca82)
      was also hand-written.
    - jpeg.jpg (LFS object 0b8d8b5f15046343fd32f451df93acc2bdd9e6373be478b968e4cad6b6647351)
      was copied from tests/gitea-repositories-meta/user2/repo1.wiki.git/
    - crypt.bin (LFS object 2eccdb43825d2a49d99d542daa20075cff1d97d9d2349a8977efe9c03661737c)
      was generated with `dd if=/dev/urandom bs=1k count=2`
    kousu committed Dec 22, 2022
    Configuration menu
    Copy the full SHA
    b6b2b6b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    571a36c View commit details
    Browse the repository at this point in the history
  3. Drop unused fixture repo files

    Feedback from @lunny: go-gitea#22196
    kousu committed Dec 22, 2022
    Configuration menu
    Copy the full SHA
    99d05b3 View commit details
    Browse the repository at this point in the history