Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-side protocol support needs simplification #15

Open
awkay opened this issue Oct 6, 2016 · 1 comment
Open

Server-side protocol support needs simplification #15

awkay opened this issue Oct 6, 2016 · 1 comment

Comments

@awkay
Copy link
Contributor

awkay commented Oct 6, 2016

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.

@awkay
Copy link
Contributor Author

awkay commented Oct 6, 2016

Oh wait: one more unsolved problem. The seed function in this case does not have proper integration with the protocol data. So, at attempt to access a pre-existing thing on the server is kind of tough. Perhaps this isn't easy to simplify further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant