Closed ccutrer closed 1 year ago
Do you envision that we'll be converting more cucumber tests, whenever applicable, into rspec in the future, in separate PRs?
Yes. I've got a whole bunch done already: https://github.com/ccutrer/openhab-jruby/commits/main. The GitHub actions runtime is down from ~10 minutes for the longest Cucumber job to less than 7 minutes. I want to get it down under 3, maybe even 2.
@jimtng: done
:tada: This PR is included in version 4.46.0 :tada:
The release is available on:
4.46.0
Your semantic-release bot :package::rocket:
🤦 I did it again. This time the gem had time to build. @boc-tothefuture can you yank 4.46.0 from rubygems?
and convert (most) _type.feature tests to rspec in-process tests.
By running tests in-line, and in-process, massive speed increases are possible, as well as ease of writing tests. You don't have to wrap everything in a rules file, that then gets deployed, wait for OpenHAB to detect it, and then check the results by continually checking the log file. This also allows more particular testing (like the rspec be matcher in the PercentType spec that also checks for type equality).
For this initial proof-of-concept, I converted 28+ cucumber scenarios to specs. The runtime on my computer:
The vast majority of that time is booting up - the actual specs (all of them, not each one) took a fraction of a second to run. This is in stark contrast to cucumber's infrastructure that takes 30-60s to start openhab, and then a minimum of 5 seconds per scenario.
Note this is a re-open of #639