-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* make fields in job retry config computed * add tests with retry config, remove beta gates for test Signed-off-by: Modular Magician <[email protected]>
- Loading branch information
1 parent
3f2123c
commit f619e40
Showing
6 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
cloudscheduler: Fixed permadiff for `google_cloud_scheduler_job.retry_config.*` block when API provides default values | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package google | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | ||
) | ||
|
||
func TestCloudScheduler_FlattenHttpHeaders(t *testing.T) { | ||
|
||
cases := []struct { | ||
Input map[string]interface{} | ||
Output map[string]interface{} | ||
}{ | ||
// simple, no headers included | ||
{ | ||
Input: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
|
||
// include the User-Agent header value Google-Cloud-Scheduler | ||
// Tests Removing User-Agent header | ||
{ | ||
Input: map[string]interface{}{ | ||
"User-Agent": "Google-Cloud-Scheduler", | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
|
||
// include the User-Agent header | ||
// Tests removing value AppEngine-Google; (+http://code.google.com/appengine) | ||
{ | ||
Input: map[string]interface{}{ | ||
"User-Agent": "My-User-Agent AppEngine-Google; (+http://code.google.com/appengine)", | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"User-Agent": "My-User-Agent", | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
|
||
// include the Content-Type header value application/octet-stream. | ||
// Tests Removing Content-Type header | ||
{ | ||
Input: map[string]interface{}{ | ||
"Content-Type": "application/octet-stream", | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
|
||
// include the Content-Length header | ||
// Tests Removing Content-Length header | ||
{ | ||
Input: map[string]interface{}{ | ||
"Content-Length": 7, | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
|
||
// include the X-Google- header | ||
// Tests Removing X-Google- header | ||
{ | ||
Input: map[string]interface{}{ | ||
"X-Google-My-Header": "x-google-my-header-value", | ||
"My-Header": "my-header-value", | ||
}, | ||
Output: map[string]interface{}{ | ||
"My-Header": "my-header-value", | ||
}, | ||
}, | ||
} | ||
|
||
for _, c := range cases { | ||
d := &schema.ResourceData{} | ||
output := flattenCloudSchedulerJobAppEngineHttpTargetHeaders(c.Input, d, &Config{}) | ||
if !reflect.DeepEqual(output, c.Output) { | ||
t.Fatalf("Error matching output and expected: %#v vs %#v", output, c.Output) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters