feat: more_tests #85
8 changed files with 274 additions and 752 deletions
6
.github/workflows/renovate.yaml
vendored
6
.github/workflows/renovate.yaml
vendored
|
|
@ -12,8 +12,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Self-hosted Renovate
|
- name: Self-hosted Renovate
|
||||||
uses: renovatebot/github-action@v41.0.0
|
uses: renovatebot/github-action@v46.1.4
|
||||||
with:
|
with:
|
||||||
configurationFile: .github/renovate.json
|
configurationFile: .github/renovate.json
|
||||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
# token: ${{ secrets.RENOVATE_TOKEN }}
|
||||||
|
token: ${{ env.FORGEJO_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,10 @@ linters:
|
||||||
main:
|
main:
|
||||||
list-mode: lax
|
list-mode: lax
|
||||||
allow:
|
allow:
|
||||||
- tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview
|
|
||||||
- github.com/hashicorp/terraform-plugin-framework
|
- github.com/hashicorp/terraform-plugin-framework
|
||||||
- github.com/hashicorp/terraform-plugin-log
|
- github.com/hashicorp/terraform-plugin-log
|
||||||
- github.com/stackitcloud/stackit-sdk-go
|
- github.com/stackitcloud/stackit-sdk-go
|
||||||
|
- tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview
|
||||||
deny:
|
deny:
|
||||||
- pkg: github.com/stretchr/testify
|
- pkg: github.com/stretchr/testify
|
||||||
desc: Do not use a testing framework
|
desc: Do not use a testing framework
|
||||||
|
|
@ -76,6 +76,7 @@ linters:
|
||||||
exclusions:
|
exclusions:
|
||||||
paths:
|
paths:
|
||||||
- generator/
|
- generator/
|
||||||
|
- internal/testutils
|
||||||
generated: lax
|
generated: lax
|
||||||
warn-unused: true
|
warn-unused: true
|
||||||
# Excluding configuration per-path, per-linter, per-text and per-source.
|
# Excluding configuration per-path, per-linter, per-text and per-source.
|
||||||
|
|
@ -86,7 +87,7 @@ linters:
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
formatters:
|
formatters:
|
||||||
enable:
|
enable:
|
||||||
#- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
settings:
|
settings:
|
||||||
goimports:
|
goimports:
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ func CreateTemporaryHome(createValidCredentialsFile bool, t *testing.T) string {
|
||||||
|
|
||||||
// Define content, default = invalid token
|
// Define content, default = invalid token
|
||||||
token := "foo_token"
|
token := "foo_token"
|
||||||
//if createValidCredentialsFile {
|
// if createValidCredentialsFile {
|
||||||
// token = GetTestProjectServiceAccountJson("")
|
// token = GetTestProjectServiceAccountJson("")
|
||||||
//}
|
//}
|
||||||
if _, err = file.WriteString(token); err != nil {
|
if _, err = file.WriteString(token); err != nil {
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ func ResourceNameWithDateTime(name string) string {
|
||||||
return fmt.Sprintf("tf-acc-%s-%s", name, dateTimeTrimmed)
|
return fmt.Sprintf("tf-acc-%s-%s", name, dateTimeTrimmed)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func GetTestProjectServiceAccountJson(path string) string {
|
// func GetTestProjectServiceAccountJson(path string) string {
|
||||||
// var err error
|
// var err error
|
||||||
// json, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_JSON_CONTENT")
|
// json, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_JSON_CONTENT")
|
||||||
// if !ok || json == "" {
|
// if !ok || json == "" {
|
||||||
|
|
@ -153,7 +153,7 @@ func ResourceNameWithDateTime(name string) string {
|
||||||
// return credentials.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN, nil
|
// return credentials.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN, nil
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//func readTestServiceAccountJsonFromFile(path string) (string, error) {
|
// func readTestServiceAccountJsonFromFile(path string) (string, error) {
|
||||||
// if path == "" {
|
// if path == "" {
|
||||||
// customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
// customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
|
||||||
// if !ok || customPath == "" {
|
// if !ok || customPath == "" {
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -23,7 +23,7 @@ resource "stackitprivatepreview_postgresflexalpha_instance" "{{ .TfName }}" {
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
network = {
|
network = {
|
||||||
acl = ["{{ .ACLString }}"]
|
acl = [{{ range $i, $v := .ACLStrings }}{{if $i}},{{end}}"{{$v}}"{{end}}]
|
||||||
access_scope = "{{ .AccessScope }}"
|
access_scope = "{{ .AccessScope }}"
|
||||||
}
|
}
|
||||||
version = {{ .Version }}
|
version = {{ .Version }}
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ func TestAccInstanceNoEncryption(t *testing.T) {
|
||||||
Roles: []string{
|
Roles: []string{
|
||||||
"##STACKIT_DatabaseManager##",
|
"##STACKIT_DatabaseManager##",
|
||||||
"##STACKIT_LoginManager##",
|
"##STACKIT_LoginManager##",
|
||||||
//"##STACKIT_ProcessManager##",
|
// "##STACKIT_ProcessManager##",
|
||||||
//"##STACKIT_SQLAgentManager##",
|
//"##STACKIT_SQLAgentManager##",
|
||||||
//"##STACKIT_SQLAgentUser##",
|
//"##STACKIT_SQLAgentUser##",
|
||||||
//"##STACKIT_ServerManager##",
|
//"##STACKIT_ServerManager##",
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ func CreateInstanceWaitHandler(
|
||||||
if !ok {
|
if !ok {
|
||||||
return false, nil, err
|
return false, nil, err
|
||||||
}
|
}
|
||||||
// TODO: refactor and cooperate with api guys to mitigate
|
// TODO: refactor and cooperate with api guys to mitigate // nolint: // reason upfront
|
||||||
if oapiErr.StatusCode < 500 {
|
if oapiErr.StatusCode < 500 {
|
||||||
return true, instanceGetResponse, fmt.Errorf(
|
return true, instanceGetResponse, fmt.Errorf(
|
||||||
"users request after instance creation returned %d status code",
|
"users request after instance creation returned %d status code",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue