airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 214 forks source link

Any plans for creating tests for the client spec? #9

Closed zephraph closed 8 years ago

zephraph commented 8 years ago

I'm really excited about this project. Unfortunately I'm locked into a java platform so I'd have to write a client to be able to use it. I don't mind doing that on the surface of it, but it'd be extremely useful to have a general test suite for validating the clients against the spec. That would also make it easier to write other clients in other languages.

Do any such tests exist? If not, would that be something the team would be interested in helping support if someone started it?

ljharb commented 8 years ago

That is an excellent question and I think we'd all very much like to have a set of tests like this! Both to test against the clients we use and maintain ourselves, and to make it easier for people like you to create new flavors of hypernova clients.

We'd be happy to help if you were willing to start that sort of project - ideally we'd like it to be written using node, so that it's the same language as hypernova itself, and thus easier to maintain. Is that something you'd be interested in working on a PR for?

zephraph commented 8 years ago

Definitely. Where would it be best to put the tests? Is this repo the right place for it or should there be a generic hypernova-client repo with the tests and spec?

ljharb commented 8 years ago

That's a really good question. I'd say the best place is a repo underneath airbnb, if you're amenable to that. I've created https://github.com/airbnb/hypernova-client if you want to make the PR into it?

zephraph commented 8 years ago

Will do!

goatslacker commented 8 years ago

How are you planning on creating generic tests for these clients? I'm guessing tests will have to be written in every language that a client exists.

zephraph commented 8 years ago

Currently my idea is an RPC setup. I'm leaning more towards xml-rpc, but I'd definitely like to discuss the options with you folks.

Basically we'll set up scenarios where we tell the client's rpc setup to call a method in the client's code with given arguments, expect it to submit a specific request, and expect it to respond (again via the rpc connection) to the test runner with whatever result.

So, you're right, there will definitely have to be code written for every client because we need some way to execute their code. The trick is making whatever that glue code is both extremely portable between languages and as minimal as possible.

It seems a little cumbersome, but having a central point for tests should definitely make our lives easier. I'm also open for any other ideas you may have.

ljharb commented 8 years ago

Nobody's come up with a practical way of accomplishing this - so for now, I'm going to delete the hypernova-client repository.

Please feel free to comment here, or file a new issue, if anyone comes up with a practical way to achieve this.