Skip to content

proof of concept: serve local git repos via http#6094

Draft
allisonkarlitskaya wants to merge 1 commit intomainfrom
git-serve
Draft

proof of concept: serve local git repos via http#6094
allisonkarlitskaya wants to merge 1 commit intomainfrom
git-serve

Conversation

@allisonkarlitskaya
Copy link
Copy Markdown
Member

This might be useful to help us do a more-complete mocking of github...

Write a small job-runner test based on this (although this isn't proper unit testing in any sense)

This might be useful to help us do a more-complete mocking of github...

Write a small job-runner test based on this (although this isn't
proper unit testing in any sense)
Comment thread test/simhub.py
status, _, reason = message.get('Status', '200 OK').partition(' ')
return web.Response(status=int(status), reason=reason, headers=dict(message), body=body)

return await repository(request).http_backend(request)

Check warning

Code scanning / CodeQL

Unreachable code

This statement is unreachable.
@martinpitt martinpitt removed their request for review April 23, 2024 04:09
@jscotka
Copy link
Copy Markdown
Collaborator

jscotka commented Aug 29, 2024

Hi @allisonkarlitskaya We've done somethins similar for packit projects, to mock whole communication with gitlab/github

https://github.com/packit/requre

usage is then like:
https://github.com/packit/ogr/blob/main/tests/integration/github/test_pull_requests.py#L12
then you have to run it first time it stores all necessary communication, and then in test it replay it back to code.

In this case it mocks python github library communication,
but possible to use if to wrap any especially remote communication.

There exists also projects like: https://vcrpy.readthedocs.io/en/latest/ but these projects are simplier and we've needed also to cover e.g. also SOAP/XML-RPC api, what was not covered by this.

@allisonkarlitskaya
Copy link
Copy Markdown
Member Author

hi @jscotka, thanks for the link.

We already have a few different versions of mocked GitHub API as well, but the thing that this PR aims to do is to enable serving of the repo content as well, so that you can do things like git clone against the mock server. Is that implemented as well in your solution?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants