dd66327b

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Decode Prometheus's answer with a codec

It was JSON.decode and a walk down the KeyMap, which is the same mistake one
layer out that this library exists to stop: the shape of the response written
as a sequence of lookups, with every step that could go wrong answered by a
guess.  The response is a discriminated union on status, so it is written as
one.

Two things fall out of that.

A response that is neither answer now throws rather than coming back as
Unparseable.  It is not a refusal: a refusal is Prometheus saying what is
wrong with the query, and a test told that would go looking at the query when
the thing to look at is the server.

And the refusal half of the envelope is now read by something.  Every property
in the suite asserts that Prometheus parsed what it was given, so none of them
ever sees one, and a wrong discriminator would have turned every rejected
query into an exception with nothing to say.  There is a test for it now.

Total

48s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 0s 0s 0s 0s 0s
Eval 0s 7s 7s 8s 0s
Build 8s 43s 39s 48s 0s
Suite 0s 52s 48s 48s 0s

Timeline

Config Eval Build
0s10s20s30s40s