2022-11-16 09:55:36 +03:00
|
|
|
package terraform_module_test_helper
|
|
|
|
|
|
|
|
import (
|
2024-08-20 04:09:01 +03:00
|
|
|
"github.com/stretchr/testify/require"
|
2022-11-16 12:49:41 +03:00
|
|
|
"os"
|
2022-11-16 09:55:36 +03:00
|
|
|
"testing"
|
2023-01-19 10:22:18 +03:00
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2022-11-16 09:55:36 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestLoadRetryableErrors(t *testing.T) {
|
2022-11-22 13:46:00 +03:00
|
|
|
cfg, err := os.ReadFile("retryable_errors_sample.hcl.json")
|
2024-08-20 04:09:01 +03:00
|
|
|
require.NoError(t, err)
|
2022-11-22 13:46:00 +03:00
|
|
|
retryableErrors := ReadRetryableErrors(cfg, t)
|
2022-11-16 09:55:36 +03:00
|
|
|
assert.Equal(t, 1, len(retryableErrors))
|
|
|
|
desc, ok := retryableErrors["GatewayTimeout"]
|
|
|
|
assert.True(t, ok)
|
2022-11-22 13:46:00 +03:00
|
|
|
assert.Equal(t, "retryable errors set by test", desc)
|
2022-11-16 09:55:36 +03:00
|
|
|
}
|