e2e

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(url string) error

HttpGet 指定のURLにGETでリクエストを行い、ステータスコード200以外の場合はエラーを返す

func HttpGetWithResponse added in v0.0.5

func HttpGetWithResponse(url string) ([]byte, error)

HttpGetWithResponse 指定のURLにGETでリクエストを行い、ステータスコード200以外の場合はエラーを返す

func HttpRequestUntilSuccess

func HttpRequestUntilSuccess(url string, timeout time.Duration) error

HttpRequestUntilSuccess ステータス200が返ってくるまで定期的に指定のURLにGETでリクエストを行う

func InitializeWithTerraform

func InitializeWithTerraform(t *testing.T) func()

InitializeWithTerraform カレントディレクトリで`terraform init & terraform apply --auto-approve`を実行し、 `terraform destroy --auto-approve`するfuncを返す

各テストコードで`defer InitializeWithTerraform()()`のように利用する。

func RunCommand

func RunCommand(t *testing.T, command string, args ...string) error

func RunCommandWithCombinedOutput

func RunCommandWithCombinedOutput(t *testing.T, command string, args ...string) ([]byte, error)

func RunCommandWithOutput

func RunCommandWithOutput(t *testing.T, command string, args ...string) ([]byte, error)

func StartCommand added in v0.0.5

func StartCommand(t *testing.T, command string, args ...string) error

func StartCommandWithStdErr added in v0.0.5

func StartCommandWithStdErr(t *testing.T, command string, args ...string) (io.Reader, error)

func StartCommandWithStdOut added in v0.0.5

func StartCommandWithStdOut(t *testing.T, command string, args ...string) (io.Reader, error)

func TerraformApply

func TerraformApply() error

func TerraformDestroy

func TerraformDestroy() error

func TerraformInit

func TerraformInit() error

func TerraformRefresh

func TerraformRefresh() error

Types

type Output

type Output struct {
	// contains filtered or unexported fields
}

func NewOutput added in v0.0.5

func NewOutput(reader io.Reader, logPrefix string) *Output

func (*Output) Body

func (o *Output) Body() string

Body 現在までの出力バッファの内容を返す

func (*Output) Contains

func (o *Output) Contains(substr string) bool

Contains 出力バッファの中に指定の文字が含まれる場合trueを返す

func (*Output) Fatal

func (o *Output) Fatal(t *testing.T, args ...interface{})

Fatal 出力バッファの内容を標準エラーに出力した上でテストをFatalさせる

func (*Output) Fatalf

func (o *Output) Fatalf(t *testing.T, format string, args ...interface{})

Fatalf 出力バッファの内容を標準エラーに出力した上でテストをFatalさせる

func (*Output) Output

func (o *Output) Output()

Output 出力バッファの内容を標準エラーに出力

func (*Output) WaitOutput

func (o *Output) WaitOutput(substr string, timeout time.Duration) error

WaitOutput 出力バッファの中に指定の文字が現れるまで待つ

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL