Skip to content

Draft: WIP on porcelain layer

Edmund Smith requested to merge eds/porcelain into main

This contains essentially one reworked full-size test, in lava-api/src/job.rs (test_basic), plus a much smaller, specific test in test_basic_porcelain.

The porcelain object itself is another layer on top of the lava mock. It incorporates a SimClock, which is often what you want for reliable, sensible testing of time behaviour (where the time is whatever you say it is).

The main inelegancies here:

  • The proxy interface is optional until it isn't: there's no disguising that once you got hold of an object, it contains proxies.

  • There's very limited customisation, and it bridges poorly with other ways of constructing more customised options. It effectively functions as a simplified mode, with no clean escapes to "advanced" mode.

  • Because you do not have a context for accessing data in the shared state, you always have to poke whatever you want to poke from within a lambda.

The job interface is incomplete; the idea is to be able to push a job along as desired just by calling the lifecycle methods on the porcelain object.

Two sets of generators are maintained. The first generators are used when calling add_job and friends, to populate the vast majority of the fields in the job object itself. The second bank of generators (bulk_) are used when generating large numbers of items at once. In this case, there are no available fields from the user at all, so the generator needs to fill in additional data (and filling in that data can have side effects, which is why we don't fill in and overwrite).

Merge request reports