Tapico / tapico-turborepo-remote-cache

A server for TurboRepo Remote Cache to store cache artefacts in Google Cloud Storage or Amazon S3
MIT License
133 stars 10 forks source link

Adding tests #14

Open amirilovic opened 2 years ago

amirilovic commented 2 years ago

How about adding tests to the project?

Usually with project like this I would add integration tests with docker compose where in the tests your are simulating real requests to the server and checking if expected things happened in the database (in this case s3 or gcs).

In nodejs I used https://www.npmjs.com/package/supertest to simulate http requests to the server without the need of actually server listening on a port, which makes it easy to run tests in parallel if needed. Not sure if same exists in golang land.

Of course, very interested to help with writing of the tests.

What do you think?

tapico-weyert commented 2 years ago

Yeah, definitely want to have tests in the project. Only I have been struggling to write them so far. I still quite new in the Go language. Yeah, so I am looking to find out how the 'supertest' or 'msw' way in Golang land is.

I am planning to look into it over the holidays

amirilovic commented 2 years ago

this one looks very close to supertest https://github.com/gavv/httpexpect. But it seems to be just a wrapper around standard httptest package which is already pretty good: https://golang.cafe/blog/golang-httptest-example.html.

weyert commented 2 years ago

Thank you @amirilovic I will check it out :)

Are you so far enjoying the project? Any concerns or experiences you want to share?