Documentation ¶
Index ¶
- Variables
- func AzureUserAgentPrefix(api string) string
- func NewAWSSession(t *testing.T, region string) (e error, sess *session.Session, cleanup func())
- func NewAzureTestPipeline(t *testing.T, api string, credential azblob.Credential) (error, pipeline.Pipeline, func())
- func NewGCPClient(ctx context.Context, t *testing.T) (e error, client *gcp.HTTPClient, done func())
- func NewRecordReplayClient(t *testing.T, suffix string, rf func(r *httpreplay.Recorder)) (e error, c *http.Client, cleanup func(), initState int64)
- func NewURLMux() *blob.URLMux
- func SetCurrentTest(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
var Record = flag.Bool("record", false, "whether to run tests against cloud resources and record the interactions")
Record is true iff the tests are being run in "record" mode.
Functions ¶
func AzureUserAgentPrefix ¶
AzureUserAgentPrefix returns a prefix that is used to set Azure SDK User-Agent to help with diagnostics.
func NewAWSSession ¶
NewAWSSession creates a new session for testing against AWS. If the test is in --record mode, the test will call out to AWS, and the results are recorded in a replay file. Otherwise, the session reads a replay file and runs the test as a replay, which never makes an outgoing HTTP call and uses fake credentials. An initState is returned for tests that need a state to have deterministic results, for example, a seed to generate random sequences.
func NewAzureTestPipeline ¶
func NewAzureTestPipeline(t *testing.T, api string, credential azblob.Credential) (error, pipeline.Pipeline, func())
NewAzureTestPipeline creates a new connection for testing against Azure Blob.
func NewGCPClient ¶
NewGCPClient creates a new HTTPClient for testing against GCP. If the test is in --record mode, the client will call out to GCP, and the results are recorded in a replay file. Otherwise, the session reads a replay file and runs the test as a replay, which never makes an outgoing HTTP call and uses fake credentials.
func NewRecordReplayClient ¶
func NewRecordReplayClient(t *testing.T, suffix string, rf func(r *httpreplay.Recorder)) (e error, c *http.Client, cleanup func(), initState int64)
NewRecordReplayClient creates a new http.Client for tests. This client's activity is being either recorded to files (when *Record is set) or replayed from files. rf is a modifier function that will be invoked with the address of the httpreplay.Recorder object used to obtain the client; this function can mutate the recorder to add service-specific header filters, for example. An initState is returned for tests that need a state to have deterministic results, for example, a seed to generate random sequences.
func SetCurrentTest ¶
Types ¶
This section is empty.