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
Add server API test tool #868
Conversation
Avoids getting warnings we don't need
Convenient for me, means I don't have to empty the repo between tests
Finally sat down to play around with this. I did have to fix a small merge conflict with your Also, it kept saying I wonder if the compilation should happen in |
Ah, sorry about that - we were using this tool but built it directly in the dir rather from the script, I forgot that because there are no dependencies from main.go to the other files the compiler wouldn't build them from outside the dir. I'd only put it in here to catch build errors & hadn't run it from there.
I don't understand - it's in setup() which is called at the start of the integration tests, it's what builds the other tools like lfstest-gitserver? |
Those utilities are exclusively for the integration tests. I just thought running |
Oh I see, sure; I included it in the integration test as a way to not miss breaking changes during dev. When we were using it here we just built it separately. If you're ok with building it all the time it's fine with me to include it in the bootstrap. It might be easier to just |
Another option is something like |
Created a tool called
git-lfs-test-server-api
which can be pointed at either an API URL or a clone URL and will run through a series of tests to ensure the responses are as expected. See theReadme.md
for details of how to use it.Currently only tests the API responses to upload/download and through inference correct authentication; HTTPS or SSH, works with both via
--clone=<url>
. Relies on the internal methods to test that content types etc are respected. In order to try to keep it simple to update in future, it just calls theBatch()
method rather than trying to dig any deeper than that.It can either generate its own test data (in which case it needs to be able to upload some initial state, although it doesn't push any commits, only LFS files), or it can be given lists of data to test with, in which case no server state is modified. In the latter case the content server is not hit at all, only the API.
I wrote this to provide a repeatable smoke test for API implementations, extensions for cases I haven't thought of are welcome, although as mentioned I didn't really want to go any lower than
Batch
to make it easier to keep in sync later.