Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fixtures/util/dynatrace/vcap_services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"some-dynatrace": [
{
"name": "some-dynatrace",
"credentials": {
"apitoken": "secretpaastoken",
"apiurl": "http://localhost:8080",
"environmentid": "envid"
}
}
]
}
23 changes: 23 additions & 0 deletions src/nodejs/integration/dynatrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,28 @@ func testDynatrace(platform switchblade.Platform, fixtures, uri string) func(*te
))
})
})

context("when VCAP_SERVICES_FILE_PATH environment variable is set", func() {
it("reads VCAP_SERVICES from the file path", func() {
vcapServicesFile := filepath.Join(fixtures, "util", "dynatrace", "vcap_services.json")

_, logs, err := platform.Deploy.
WithEnv(map[string]string{
"BP_DEBUG": "true",
"VCAP_SERVICES_FILE_PATH": vcapServicesFile,
}).
Execute(name, filepath.Join(fixtures, "simple"))
Expect(err).NotTo(HaveOccurred())

Expect(logs.String()).To(SatisfyAll(
ContainSubstring("Reading VCAP_SERVICES from file"),
ContainSubstring("Dynatrace service credentials found. Setting up Dynatrace OneAgent."),
ContainSubstring("Starting Dynatrace OneAgent installer"),
ContainSubstring("Copy dynatrace-env.sh"),
ContainSubstring("Dynatrace OneAgent installed."),
ContainSubstring("Dynatrace OneAgent injection is set up."),
))
})
})
}
}
31 changes: 28 additions & 3 deletions vendor/github.com/Dynatrace/libbuildpack-dynatrace/hook.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.