Swirrl / ook

Structural search engine
https://search-prototype.gss-data.org.uk/
Eclipse Public License 1.0
6 stars 0 forks source link

Setup CI for browser-based tests #10

Closed kiramclean closed 3 years ago

kiramclean commented 3 years ago

This turned out to be a massive pita and may involve writing a custom test runner that can collect the devcard tests and use karma to launch a browser and report the results for CI. Devcards may also not even be the best thing to use as a test harness for testing the reagent components.

Robsteranium commented 3 years ago

Maybe we can borrow the chromedriver setup from Muttnik?

What about etaoin + phantomjs?

I've not used devcards, I didn't realise they also had tests... I bet someone somewhere has figured out how to make that work on CI!

kiramclean commented 3 years ago

I was hoping to avoid webdriver (etaoin) as much as possible.. the tests are always flaky and slow, plus annoying to write with "wait"s all over the place.. would be ideal if we could have a test suite that takes a few seconds instead of a few minutes. It's probably inevitable because we should have at least some true end-to-end tests, but I was looking into different ways to tests all the million little UI interactions. On previous large front-end projects it was fairly common to load a component in some sort of test harness and interact with it with synthetic events, then test the actual resulting dom to see if it looked right. Seems like that's just not really how cljs people do things (though to be fair it seems like cljs just doesn't have a very good testing story yet). I got some useful feedback from clojurians slack and reddit.

But with re-frame now I could be convinced that view tests aren't necessary at all and maybe take a "test only the data" approach described in their docs, and facilitated by their testing library. It's different, but I can see where he's coming from.

kiramclean commented 3 years ago

This is done now. There aren't many tests, but there are cljs tests that run both in a usable way to develop against and in CI now, as of #51