You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: Supports running MacT tests at unit test stage (#3191)
* test: Support testing PlanModifier
* fix broken unit test
* test: Supports running MacT tests at unit test stage
* Address PR comments
* docs: Update testing best practices to include MipT for testing PlanModifier logic
* update docs based on suggestions
* pr suggestions
* test: Remove test files after usage
* add comment about signature
* chore: increase timeout (believe the high default parallel factor 50 might lead to longer test time)
* doc: Add docstrings and comments based on PR comments
Copy file name to clipboardExpand all lines: internal/testutil/unit/http_mocker.go
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -23,14 +23,14 @@ const (
23
23
)
24
24
25
25
typeMockHTTPDataConfigstruct {
26
-
RunBeforeEachfunc() error
27
-
RequestHandlerManualRequestHandler
28
-
FilePathOverridestring
29
-
IsDiffSkipSuffixes []string
30
-
IsDiffMustSubstrings []string
31
-
QueryVars []string
32
-
AllowMissingRequestsbool
33
-
AllowOutOfOrderbool
26
+
RunBeforeEachfunc() error// Run by TestCase.PreCheck. Useful for reducing retry timeouts.
27
+
RequestHandlerManualRequestHandler// Allow inspecting or overriding mocking behavior. Can be used to return 404 when a test has completed.
28
+
FilePathOverridestring// Read mock data file from specific filepath, otherwise using the test name in `MockConfigFilePath` to find mocked responses.
29
+
IsDiffSkipSuffixes []string// Can be used when a PATCH/POST request is creating noise for diffs, for example :validate endpoints.
30
+
IsDiffMustSubstrings []string// Only include diff request for specific substrings, for example /clusters (avoids project create requests)
31
+
QueryVars []string// Substitute this query vars. Useful when differentiating responses based on query args, for example ?providerName=AWS/AZURE returns different responses
32
+
AllowMissingRequestsbool// When false will require all API calls to be made.
33
+
AllowOutOfOrderbool// When true will allow a GET request returned after a POST to be returned before the POST.
34
34
}
35
35
36
36
func (cMockHTTPDataConfig) WithAllowOutOfOrder() MockHTTPDataConfig { //nolint: gocritic // Want each test run to have its own config (hugeParam: c is heavy (112 bytes); consider passing it by pointer)
0 commit comments