Post 1479104 by fasterthanlime@mstdn.io
(DIR) More posts by fasterthanlime@mstdn.io
(DIR) Post #1479100 by fasterthanlime@mstdn.io
2018-11-22T11:13:14Z
0 likes, 0 repeats
Just got started on mitch, a mock http://itch.io server which I'm going to use for itch app + butlerd integration testshttps://github.com/itchio/mitchServes /profile for now, more endpoints to come. Stole the idea from stripe-mock!
(DIR) Post #1479101 by fasterthanlime@mstdn.io
2018-11-22T11:13:15Z
0 likes, 0 repeats
this is not (yet) useful to the general public, but running integration tests faster is good, yes?
(DIR) Post #1479102 by fasterthanlime@mstdn.io
2018-11-22T17:21:34Z
0 likes, 0 repeats
Getting somewhere! for this test I'm creating a public game with only one upload: a .love bundle.Even though it's technically a .zip, it shouldn't get extracted. It's a tiny regression test, but nice to be able to express it succintly.
(DIR) Post #1479103 by fasterthanlime@mstdn.io
2018-11-22T17:26:09Z
0 likes, 0 repeats
For this test mitch has to serveGET /profileGET /games/:idGET /games/:id/uploadsPOST /games/:id/download-sessionsGET /uploads/:id/downloadGET /_cdn/*And it works quite well! Two example endpoints:
(DIR) Post #1479104 by fasterthanlime@mstdn.io
2018-11-22T17:26:12Z
0 likes, 0 repeats
Not going to lie though, I would *kill* for even a tiny bit of inference in Go (and some generics seasoning). I could get rid of so much boilerplate, see these calls for example:
(DIR) Post #1479105 by fasterthanlime@mstdn.io
2018-11-22T17:47:53Z
0 likes, 0 repeats
Woops, I forgot the mock cdn has to implement HTTP ranges
(DIR) Post #1479106 by fasterthanlime@mstdn.io
2018-11-22T17:58:36Z
0 likes, 0 repeats
There, that should do it - panics be damned!
(DIR) Post #1479107 by fasterthanlime@mstdn.io
2018-11-23T12:11:30Z
0 likes, 0 repeats
"web uploads" work great with mitch, next step is butler uploads. Luckily, the wharf API has everything we need:(that's just for signing, diffing is next)
(DIR) Post #1479108 by fasterthanlime@mstdn.io
2018-11-23T18:01:50Z
0 likes, 0 repeats
soI didn't want to use a real database, but I got tired of writing ListGameAdminsByGameID functions and simultaneously remembered that go reflection is a thing, so...
(DIR) Post #1479109 by fasterthanlime@mstdn.io
2018-11-23T18:01:57Z
0 likes, 0 repeats
Of course, you don't want to see what code backs this, unless you do, in which case here it is:(all of this is, obviously, very unsafe and very naughty)
(DIR) Post #1479110 by fasterthanlime@mstdn.io
2018-11-25T13:28:11Z
0 likes, 0 repeats
https://github.com/itchio/mitch (mock http://itch.io server) now serves all endpoints used by https://github.com/itchio/butler integration testsbenefits:- declarative scenarios- no need for internet connection- tests now run 5x faster on my slowest laptop
(DIR) Post #1479111 by r0@social.stupid.team
2018-11-25T15:58:29Z
0 likes, 0 repeats
@fasterthanlime if you manage to crash that dummy serveris it a mitch murder