Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bosh int doesn't work for scenarios without bosh variables #2

Open
dennisjbell opened this issue May 21, 2020 · 2 comments
Open

bosh int doesn't work for scenarios without bosh variables #2

dennisjbell opened this issue May 21, 2020 · 2 comments

Comments

@dennisjbell
Copy link
Member

Getting the following error when testing on a bosh 1.x line:

• Failure [8.380 seconds]
BOSH Kit
/Users/dbell/code/src/github.com/genesis-community/bosh-genesis-kit/spec/spec_test.go:11
  cpis
  /Users/dbell/code/src/github.com/genesis-community/bosh-genesis-kit/spec/spec_test.go:48
    given a environment manifest: spec/deployments/aws.yml
    /Users/dbell/lib/go/pkg/mod/github.com/genesis-community/[email protected]/testing/testing.go:72
      renders a manifest which matches: spec/results/aws.yml [It]
      /Users/dbell/lib/go/pkg/mod/github.com/genesis-community/[email protected]/testing/testing.go:49

      Expected
          <int>: -1
      to equal
          <int>: 0

      /Users/dbell/lib/go/pkg/mod/github.com/genesis-community/[email protected]/testing/bosh.go:42

This version of the bosh kit doesn't use bosh-variables, which results in having an empty hash as the value, which seems to result in bosh int returning a -1 without stderr or stdout output. My naive solution is to apply the following to testing/testing.go, but there may be a more golang-way of doing it.

53c53,56
<                       manifest := b.Interpolate(manifestResult.raw, manifestResult.boshVariables)
---
>                       manifest := manifestResult.raw
>                       if string(manifestResult.boshVariables) != "{}\n" {
>                               manifest = b.Interpolate(manifestResult.raw, manifestResult.boshVariables)
>                       }

@rkoster
Copy link
Contributor

rkoster commented May 26, 2020

which version of the bosh-cli did you use? Asking because there are tests for this case already in the spec dir, baseline.yml for example does not use bosh-variables.

@rkoster
Copy link
Contributor

rkoster commented May 26, 2020

was related to bosh being a bash function on the reports system. Could be fixed by using bosh via the go library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants