mirror of https://github.com/pulumi/pulumi.git
b27c71f5bd
12377: sdk/go: Add common/testing/iotest package r=abhinav a=abhinav Adds a new iotest subpackage to the common/testing package and moves the testLogWriter used in a prior integration test into this directory. The new API is: package iotest func LogWriter(testing.TB) io.Writer This is a generally useful utility in any test that needs an io.Writer, where we want them to not pollute actual stdout or stderr. There are a few direct uses of os.Stderr and os.Stdout in our tests. The second commit switches these to use iotest.LogWriter where appropriate, Uses of os.Stdout/Stderr that were omitted: - Example tests: These don't have a testing.TB to log to. - pulumi/main_test: Replaces the global os.Stdout/Stderr in TestMain. LogWriter isn't relevant there. Co-authored-by: Abhinav Gupta <abhinav@pulumi.com> |
||
---|---|---|
.. | ||
benchmarks/go-alias-norm | ||
examples | ||
integration | ||
testprovider | ||
.gitignore | ||
README.md | ||
about_test.go | ||
config_test.go | ||
go.mod | ||
go.sum | ||
history_test.go | ||
login_test.go | ||
main_test.go | ||
remote_test.go | ||
roundtrip_test.go | ||
stack_test.go |
README.md
Integration Tests
This module provides integration tests for the Pulumi CLI.
The tests can be run via:
make test_all
Usage of Go build tags
In order to speed up integration tests in GitHub actions, Go build tags are used to conditionally compile the desired test cases.
// integration_nodejs_test.go
//go:build (nodejs || all) && !xplatform-acceptance
// integration_nodejs_acceptance_test.go
//go:build nodejs || all