Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix synthetics browser test upload-files step #1219

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions datadog/resource_datadog_synthetics_test_.go
Original file line number Diff line number Diff line change
Expand Up @@ -2350,9 +2350,11 @@ func getParamsKeysForStepType(stepType datadogV1.SyntheticsStepType) []string {

func convertStepParamsValueForConfig(stepType datadogV1.SyntheticsStepType, key string, value interface{}) interface{} {
switch key {
case "element", "email", "file", "request":
result := make(map[string]interface{})
utils.GetMetadataFromJSON([]byte(value.(string)), &result)
case "element", "email", "file", "files", "request":
var result interface{}
if err := utils.GetMetadataFromJSON([]byte(value.(string)), &result); err != nil {
log.Printf("[ERROR] Error converting step param %s: %v", key, err)
}
return result

case "playing_tab_id":
Expand All @@ -2376,7 +2378,7 @@ func convertStepParamsValueForConfig(stepType datadogV1.SyntheticsStepType, key

func convertStepParamsValueForState(key string, value interface{}) interface{} {
switch key {
case "element", "email", "file", "request":
case "element", "email", "file", "files", "request":
result, _ := json.Marshal(value)
return string(result)

Expand Down