Skip to content

Commit

Permalink
created initial test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Dixler committed Dec 12, 2022
1 parent 56be165 commit d8b2671
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/integration/integration_nodejs_test.go
Expand Up @@ -1166,6 +1166,34 @@ func TestESMTSCompiled(t *testing.T) {
})
}

// Test that the resource stopwatch doesn't contain a negative time.
func TestNoNegativeTimingsOnRefresh(t *testing.T) {
if runtime.GOOS == WindowsOS {
t.Skip("Skip on windows because we lack yarn")
}
t.Parallel()

dir := filepath.Join("empty", "nodejs")
e := ptesting.NewEnvironment(t)
defer func() {
if !t.Failed() {
e.DeleteEnvironment()
}
}()
e.ImportDirectory(dir)

e.RunCommand("yarn", "link", "@pulumi/pulumi")
e.RunCommand("yarn", "install")
e.RunCommand("pulumi", "login", "--cloud-url", e.LocalURL())
e.RunCommand("pulumi", "stack", "init", "negative-timings")
e.RunCommand("pulumi", "stack", "select", "negative-timings")
e.RunCommand("pulumi", "up", "--yes")
stdout, _ := e.RunCommand("pulumi", "destroy", "--skip-preview", "--refresh=true")
// Assert there are no negative times in the output.
assert.NotContainsf(t, stdout, " (-",
"`pulumi destroy --skip-preview --refresh=true` contains a negative time")
}

// Test that the about command works as expected. Because about parses the
// results of each runtime independently, we have an integration test in each
// language.
Expand Down

0 comments on commit d8b2671

Please sign in to comment.