pulumi/tests
bors[bot] b27c71f5bd
Merge #12377
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>
2023-03-10 20:33:51 +00:00
..
benchmarks/go-alias-norm Bump go-git to v5.6.0 to remove cgo dependency fixing 2023-02-28 16:01:31 -08:00
examples Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
integration sdk/go: Add common/testing/iotest package 2023-03-07 11:27:47 -08:00
testprovider all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
.gitignore ci: Use reduced smoke testing on Windows & macOS targets 2022-09-21 09:55:06 -07:00
README.md Rename "Smoke" test to "Acceptance" tests 2023-01-30 15:38:37 -05:00
about_test.go test: fix regex used to test Go version output in about command. (#10499) 2022-08-29 11:53:03 -07:00
config_test.go ci: adjust test based on new yaml library 2022-12-10 14:26:14 -08:00
go.mod pkg: Dedupe "open in browser" library 2023-03-10 10:57:33 -07:00
go.sum pkg: Dedupe "open in browser" library 2023-03-10 10:57:33 -07:00
history_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
login_test.go ci: radical idea - what if slow tests & no stdout makes GH consider runner dead? 2022-03-06 14:52:13 -08:00
main_test.go [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
remote_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
roundtrip_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00
stack_test.go all: Assert => Assertf 2023-03-03 14:37:43 -08:00

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