cloudfoundry-attic / bosh-notes

Collection of proposals for BOSH
Apache License 2.0
51 stars 23 forks source link

Unit tests for releases #5

Closed allomov closed 6 years ago

allomov commented 9 years ago

I feel strong demand in writing tests while I develop BOSH releases.

There are lots of positive sides of it. First of all it could speed up development process, when developer will not be needed to deploy bosh-release to separate test infrastructure. Another positive side of tested releases would be possibility to check that PRs work (for instance you'll be 100% sure that merging some PR from side developer to admin-iu-boshrelease will not break any features from acceptance tests).

I guess we can run this tests inside of containers on developers host, possibly we can use Docker there. What are your thoughts on this?

TDD+BOSH FTW!

cppforlife commented 9 years ago

Can you go into a bit more detail about which things you would like to test?

allomov commented 9 years ago

Developing BOSH release from scratch can require deploying this release for many times. It can really take time. It also requires running deployed BOSH somewhere, which is not always possible.

It would be nice to have something similar with bosh-init, that can unpack and build packages, also trying to render jobs templates using sample manifest and stabs. This will allow to run such tests locally and on travisci. Also it would be easy for new comers to learn how particular BOSH release work using this tests.

voelzmo commented 8 years ago

I agree, that would be a highly appreciated feature. Especially when your release gets a little more complicated, with more logic in the .erb templates or startup scripts.

I wonder how to test these things without having to build a release and re-deploy, because the turnaround times here really suck :(

I saw that for bosh itself there are some tests concerning rendering: https://github.com/cloudfoundry/bosh/blob/master/release/spec/director.yml.erb.erb_spec.rb that would probably already be a first step.

cppforlife commented 6 years ago

Documented use of bosh-template v2 gem: https://github.com/cloudfoundry/docs-bosh/blob/master/job-templates.html.md.erb