mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Adding '-verbose' will print out the allocation information for the deployment. This also changes the job run command so that it now blocks until deployment is complete and adds timestamps to the output so that it's more in line with the output of node drain. This uses glint to print in place in running in a tty. Because glint doesn't yet support cmd/powershell, Windows workflows use a different library to print in place, which results in slightly different formatting: 1) different margins, and 2) no spinner indicating deployment in progress.
20 lines
563 B
Go
20 lines
563 B
Go
package glint
|
|
|
|
import (
|
|
"github.com/mitchellh/go-testing-interface"
|
|
)
|
|
|
|
// TestRender renders the component using the string renderer and returns
|
|
// the string. This is a test helper function for writing components.
|
|
func TestRender(t testing.T, c Component) string {
|
|
// Note that nothing here fails at the moment so the t param above is
|
|
// unneeded but we're gonna keep it around in case we need it in the future
|
|
// so we don't have to break API.
|
|
r := &StringRenderer{}
|
|
d := New()
|
|
d.SetRenderer(r)
|
|
d.Append(c)
|
|
d.RenderFrame()
|
|
return r.Builder.String()
|
|
}
|