Skip to content

Commit e43f7f8

Browse files
authored
ci: Update gh-actions tests executions
- Set terraform versions matrix to support 1.11 and 1.12 - Set Go versions matrix to support 1.24
1 parent 3b2e1f5 commit e43f7f8

7 files changed

Lines changed: 34 additions & 13 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ jobs:
4949
fail-fast: false
5050
matrix:
5151
go-version:
52-
- '1.21'
53-
- '1.22'
52+
- '1.24'
5453
needs:
5554
- build
5655
steps:
@@ -87,17 +86,16 @@ jobs:
8786
fail-fast: false
8887
matrix:
8988
tf-version:
90-
- '1.9.*'
91-
- '1.10.*'
9289
- '1.11.*'
90+
- '1.12.*'
9391
steps:
9492
- name: Checkout 💻
9593
uses: actions/checkout@v4.2.2
9694

9795
- name: Setup Go environment ⚙️
9896
uses: actions/setup-go@v5.5.0
9997
with:
100-
go-version: '1.21'
98+
go-version: '1.24'
10199

102100
- name: Terraform Setup 🏗️
103101
uses: hashicorp/setup-terraform@v3.1.1

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ provider "postgresql" {
5858
- `host` (String) The hostname of the PostgreSQL server. May be set via the environment variable `POSTGRES_HOST`.
5959
- `password` (String, Sensitive) The password to use when connecting to the PostgreSQL server. May be set via the environment variable `POSTGRES_PASSWORD`.
6060
- `port` (Number) The port of the PostgreSQL server. May be set via the environment variable `POSTGRES_PORT`. (default: 5432)
61-
- `scheme` (String) The schema to use when connecting to the PostgreSQL database. The value must be one of the following:
61+
- `scheme` (String) The scheme to use when connecting to the PostgreSQL database. The value must be one of the following:
6262
* 'postgres' (default)
6363
* 'gcppostgres'
6464
* 'awspostgres'
65-
May be set via the environment variable 'POSTGRES_SCHEMA'. (default: 'postgres')
65+
May be set via the environment variable 'POSTGRES_SCHEME'. (default: 'postgres')
6666
- `sslmode` (String) The SSL mode to use when connecting to the PostgreSQL server. The value must be one of the following:
6767
* 'disable' (No SSL)
6868
* 'require' (*default*. Always SSL, skip verification)

docs/resources/role.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ resource "postgresql_role" "john_doe" {
7171

7272
```terraform
7373
# Postgresql Role can be imported by specifying the id with the format <role_name>
74-
terraform import postgresql_role.jhon_doe "john_doe"
74+
terraform import postgresql_role.john_doe "john_doe"
7575
```

docs/resources/user_function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ resource "postgresql_user_function" "greet_example" {
2727
EOT
2828
2929
comment = "A simple greeting function"
30-
owner = "jhon_doe"
30+
owner = "john_doe"
3131
}
3232
```
3333

internal/provider/provider.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ func (p *PostgresqlProvider) Schema(_ context.Context, _ provider.SchemaRequest,
9797
"scheme": schema.StringAttribute{
9898
Optional: true,
9999
Description: `
100-
The schema to use when connecting to the PostgreSQL database. The value must be one of the following:
100+
The scheme to use when connecting to the PostgreSQL database. The value must be one of the following:
101101
* 'postgres' (default)
102102
* 'gcppostgres'
103103
* 'awspostgres'
104-
May be set via the environment variable 'POSTGRES_SCHEMA'. (default: 'postgres')
105-
`,
104+
May be set via the environment variable 'POSTGRES_SCHEME'. (default: 'postgres')
105+
`,
106106
Validators: []validator.String{
107107
stringvalidator.OneOf("postgres", "gcppostgres", "awspostgres"),
108108
},

internal/test/testcontainer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,7 @@ func GetPostgresConnectionString(t *testing.T, container *postgres.PostgresConta
8787
queryParams.Set("sslmode", "disable")
8888
}
8989

90-
return connString + queryParams.Encode()
90+
u.RawQuery = queryParams.Encode()
91+
92+
return u.String()
9193
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package test
2+
3+
import (
4+
"context"
5+
"github.com/stretchr/testify/assert"
6+
"net/url"
7+
"testing"
8+
)
9+
10+
func TestGetPostgresConnectionString(t *testing.T) {
11+
pgContainer := LoadPostgresTestContainer(t, PostgresContainerRunOptions{}, false)
12+
t.Cleanup(func() {
13+
assert.NoError(t, pgContainer.Terminate(context.Background()))
14+
})
15+
16+
connString := GetPostgresConnectionString(t, pgContainer)
17+
18+
u, err := url.Parse(connString)
19+
assert.NoError(t, err)
20+
assert.Equal(t, "disable", u.Query().Get("sslmode"))
21+
}

0 commit comments

Comments
 (0)