Skip to content

Server-side protocol support needs simplification #15

@awkay

Description

@awkay

We should be able to make the server-side bits easier. The basic idea would be to make it possible to write the test as:

(helper/with-db-fixture user-db
     (let [server (server/make-untangled-test-server
                    :parser demo/server-parser
                    :parser-injections #{:user-database}
                    :components {:user-database user-db})]
       (specification "Server tx executes properly"
         (behavior "Adds user to database"
           (ps/check-response-to-client server add-user-protocol))))
     :migrations "app.sample-migrations"
     :seed-fn user-seed)

where tempid remapping (seed results) could be found by scanning the parser injections for databases (and use (:seed-result (get-info DatabaseComponent))).

There are two major changes that need to be made for this to work right:

  • Make it so that start on a DatabaseComponent is idempotent (so we don't try to restart it)
  • Collect ID remaps from all of the databases injected into the parser so that ID support works properly.

I'd suggest we make a new method and deprecate the old, since there are existing users of the old support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions