You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if there is a way to specify a custom cloud config? I've been copying an erb template into the templates folder in my test automation, which feels really hackish but does work.
Looking at the code, I see the load_template method which seems to be the only impacted code/spec location.
I'm copying a file into that location to run the BATs. What I'm wondering is if there is an environment variable or argument that can be passed into the bats to just say "use this erb"?
Perhaps there might be value in allowing some kind of override of the default location that templates are loaded from?
I'd generally prefer passing a solution that passes some kind of config explicitly rather than loading an ENV var in some deeply nested function. I haven't looked at the internals of these specs in a while so I'm not sure what to suggest specifically.
I think it should work but I don't have the time at the moment to properly tests so I'm leaving it as draft.
I'm on holiday until the first week of August but perhaps you or someone else can validate this this works, or comment on the PR if it doesn't provide what you're looking for.
Activity
aramprice commentedon Jul 16, 2026
Maybe this would help: https://bosh.io/docs/configs/
If not perhaps you can provide more context?
a2geek commentedon Jul 16, 2026
No, this is not a CPI configuration question.
What I mean is when I run the BATs against my CPI, my CPI is not a part of the BATs template folder here: https://github.com/cloudfoundry/bosh-acceptance-tests/tree/master/templates
I'm copying a file into that location to run the BATs. What I'm wondering is if there is an environment variable or argument that can be passed into the bats to just say "use this erb"?
aramprice commentedon Jul 16, 2026
Ah, thanks for the context.
I don't know of anything off-hand. The template loading seems to happen in https://github.com/cloudfoundry/bosh-acceptance-tests/blob/master/lib/bat/cloud_config.rb#L56
Perhaps there might be value in allowing some kind of override of the default location that templates are loaded from?
I'd generally prefer passing a solution that passes some kind of config explicitly rather than loading an ENV var in some deeply nested function. I haven't looked at the internals of these specs in a while so I'm not sure what to suggest specifically.
@rkoster may have some thoughts.
a2geek commentedon Jul 16, 2026
Exactly! I'd attempt it, but Ruby and I don't get along. ;-)
Most of the configuration for the the bats run are environmental variables. So that does have a precedent...
It just seemed "fidgety" that I needed to copy a custom template in. Figured there is a better way.
-Rob
aramprice commentedon Jul 16, 2026
I created a draft PR => #65
I think it should work but I don't have the time at the moment to properly tests so I'm leaving it as draft.
I'm on holiday until the first week of August but perhaps you or someone else can validate this this works, or comment on the PR if it doesn't provide what you're looking for.