Skip to content

Improve testing infra for fetchTree/fetchGit #9388

Open

Description

@DavHau

Is your feature request related to a problem? Please describe.
None of the code paths that could trigger actual networking seem to be tested as of now, limiting the test coverage to only file:// based actions.
I would like to add tests for potential bugs like this.

Describe the solution you'd like
Git already offers the git-http-backend CGI script. Therefore, all that's needed is a cgi capable http server. Python could be used, as it has all of that already built in, but having python as a dependency might be undesired due to bootstrapping complexity. Maybe there is a simpler cpp based http server that can be used.

Describe alternatives you've considered
Not testing network related code paths -> Instead rely on humans to find bugs during code review -> slow and unreliable.

Additional context

Priorities

Add 👍 to issues you find important.

Activity

  1. added
    feature
    on Nov 19, 2023
  2. roberth commented on Nov 19, 2023

    @roberth
    Member

    I'd be happy to upstream into nixpkgs these modules that help set up a gitea. https://github.com/hercules-ci/hercules-ci-effects/tree/master/effects/testsupport

    gitea is fairly quick to launch (unlike, say, gitlab) VM+gitea take about 10 s.

    OTOH these a lot of value in keeping the test setup minimal.

    might be undesired due to bootstrapping complexity.

    Bootstrapping should be done without tests.

    1. bootstrap without tests
    2. have a Nix
    3. bootstrap with tests, using Nix to get the test deps

    Also this could be a checks test instead of an installCheckPhase test.

  3. added
    fetching
    on Nov 19, 2023
  4. DavHau commented on Nov 19, 2023

    @DavHau
    MemberAuthor

    Yes, it would be nice if you could upstream these modules. I played around a bit wit the python http server, but it seems like advanced path rewriting capabilities are required in order to use thegit-http-backend. Just using gitea might be simpler.

  5. added
    idea approved
    on Dec 1, 2023
  6. nixos-discourse commented on Dec 3, 2023

    @nixos-discourse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurefetchingidea approvedtests

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions