Improve CI error messages

Failures unique to windows require a more informative error message to
diagnose.
This commit is contained in:
Ian Wahbe 2021-08-30 12:55:30 -07:00
parent 1e0019340d
commit 8150ef0880
2 changed files with 4 additions and 3 deletions

View file

@ -120,7 +120,7 @@ func (e *Environment) ImportDirectory(path string) {
func (e *Environment) DeleteEnvironment() {
e.Helper()
err := os.RemoveAll(e.RootPath)
assert.NoError(e, err, "cleaning up the test directory")
assert.NoErrorf(e, err, "cleaning up test directory %q", e.RootPath)
}
// DeleteIfNotFailed deletes the environment's RootPath if the test hasn't failed. Otherwise

View file

@ -1154,8 +1154,9 @@ func TestAboutNodeJS(t *testing.T) {
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
e.RunCommand("pulumi", "stack", "init", "about-nodejs")
e.RunCommand("pulumi", "stack", "select", "about-nodejs")
stdout, _ := e.RunCommand("pulumi", "about")
stdout, stderr := e.RunCommand("pulumi", "about")
e.RunCommand("pulumi", "stack", "rm", "--yes")
// Assert we parsed the dependencies
assert.Contains(t, stdout, "@types/node")
assert.Containsf(t, stdout, "@types/node",
"Did not contain expected output. stderr: \n%q", stderr)
}