chore(tests): add more tests
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 6s
CI Workflow / Test readiness for publishing provider (pull_request) Has been cancelled
CI Workflow / CI run tests (pull_request) Has been cancelled
CI Workflow / CI run build and linting (pull_request) Has been cancelled
CI Workflow / Code coverage report (pull_request) Has been cancelled
CI Workflow / Prepare GO cache (pull_request) Has been cancelled

fix: asjust linter settings
This commit is contained in:
Marcel S. Henselin 2026-03-13 16:52:59 +01:00
parent f84399f5a3
commit 40e96de685
8 changed files with 274 additions and 752 deletions

View file

@ -12,8 +12,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Self-hosted Renovate
uses: renovatebot/github-action@v41.0.0
uses: renovatebot/github-action@v46.1.4
with:
configurationFile: .github/renovate.json
token: ${{ secrets.RENOVATE_TOKEN }}
# token: ${{ secrets.RENOVATE_TOKEN }}
token: ${{ env.FORGEJO_TOKEN }}

View file

@ -31,10 +31,10 @@ linters:
main:
list-mode: lax
allow:
- tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview
- github.com/hashicorp/terraform-plugin-framework
- github.com/hashicorp/terraform-plugin-log
- github.com/stackitcloud/stackit-sdk-go
- tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview
deny:
- pkg: github.com/stretchr/testify
desc: Do not use a testing framework
@ -76,6 +76,7 @@ linters:
exclusions:
paths:
- generator/
- internal/testutils
generated: lax
warn-unused: true
# Excluding configuration per-path, per-linter, per-text and per-source.
@ -86,7 +87,7 @@ linters:
- gochecknoinits
formatters:
enable:
#- gofmt
- gofmt
- goimports
settings:
goimports:

View file

@ -53,7 +53,7 @@ func CreateTemporaryHome(createValidCredentialsFile bool, t *testing.T) string {
// Define content, default = invalid token
token := "foo_token"
//if createValidCredentialsFile {
// if createValidCredentialsFile {
// token = GetTestProjectServiceAccountJson("")
//}
if _, err = file.WriteString(token); err != nil {

View file

@ -99,7 +99,7 @@ func ResourceNameWithDateTime(name string) string {
return fmt.Sprintf("tf-acc-%s-%s", name, dateTimeTrimmed)
}
//func GetTestProjectServiceAccountJson(path string) string {
// func GetTestProjectServiceAccountJson(path string) string {
// var err error
// json, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_JSON_CONTENT")
// if !ok || json == "" {
@ -153,7 +153,7 @@ func ResourceNameWithDateTime(name string) string {
// return credentials.TF_ACC_TEST_PROJECT_SERVICE_ACCOUNT_TOKEN, nil
//}
//func readTestServiceAccountJsonFromFile(path string) (string, error) {
// func readTestServiceAccountJsonFromFile(path string) (string, error) {
// if path == "" {
// customPath, ok := os.LookupEnv("TF_ACC_SERVICE_ACCOUNT_FILE")
// if !ok || customPath == "" {

View file

@ -23,7 +23,7 @@ resource "stackitprivatepreview_postgresflexalpha_instance" "{{ .TfName }}" {
}
{{ end }}
network = {
acl = ["{{ .ACLString }}"]
acl = [{{ range $i, $v := .ACLStrings }}{{if $i}},{{end}}"{{$v}}"{{end}}]
access_scope = "{{ .AccessScope }}"
}
version = {{ .Version }}

View file

@ -198,7 +198,7 @@ func TestAccInstanceNoEncryption(t *testing.T) {
Roles: []string{
"##STACKIT_DatabaseManager##",
"##STACKIT_LoginManager##",
//"##STACKIT_ProcessManager##",
// "##STACKIT_ProcessManager##",
//"##STACKIT_SQLAgentManager##",
//"##STACKIT_SQLAgentUser##",
//"##STACKIT_ServerManager##",

View file

@ -161,7 +161,7 @@ func CreateInstanceWaitHandler(
if !ok {
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 {
return true, instanceGetResponse, fmt.Errorf(
"users request after instance creation returned %d status code",