Are there library versions of pulumi's CLI, I'd li...
# general
g
Are there library versions of pulumi's CLI, I'd like to be able to spin up and tear down some infra as part of some tests it would be nice if the tests could call pulumi up and destroy themeselves?
s
Not sure if there's a public safe to use API/SDK available, but you could always mimic what the CLI source does: https://github.com/pulumi/pulumi/blob/master/cmd/up.go
👍 1
(Assuming you're writing in Go and willing to live on the wild side)
g
We have some work coming soon that will make this easier (https://github.com/pulumi/pulumi/issues/2287), but for now you can do more-or-less how we do this with a Go test harness - https://github.com/pulumi/pulumi/blob/master/examples/examples_test.go.