Skip to content

Commit baa0dbf

Browse files
committed
Add v15 support.
1 parent fc8f24a commit baa0dbf

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,8 @@ issues:
4848
- G104
4949
- (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
5050
- Potential file inclusion via variable
51+
exclude-rules:
52+
- path: '(.+)_test\.go'
53+
linters:
54+
- funlen
55+
- goconst

config.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ type PostgresVersion string
123123

124124
// Predefined supported Postgres versions.
125125
const (
126-
V14 = PostgresVersion("14.5.0")
127-
V13 = PostgresVersion("13.8.0")
128-
V12 = PostgresVersion("12.12.0")
129-
V11 = PostgresVersion("11.17.0")
130-
V10 = PostgresVersion("10.22.0")
126+
V15 = PostgresVersion("15.1.0")
127+
V14 = PostgresVersion("14.6.0")
128+
V13 = PostgresVersion("13.9.0")
129+
V12 = PostgresVersion("12.13.0")
130+
V11 = PostgresVersion("11.18.0")
131+
V10 = PostgresVersion("10.23.0")
131132
V9 = PostgresVersion("9.6.24")
132133
)

embedded_postgres.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func newDatabaseWithConfig(config Config) *EmbeddedPostgres {
5757

5858
// Start will try to start the configured Postgres process returning an error when there were any problems with invocation.
5959
// If any error occurs Start will try to also Stop the Postgres process in order to not leave any sub-process running.
60+
//
6061
//nolint:funlen
6162
func (ep *EmbeddedPostgres) Start() error {
6263
if ep.started {

embedded_postgres_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func Test_CustomConfig(t *testing.T) {
251251
Username("gin").
252252
Password("wine").
253253
Database("beer").
254-
Version(V12).
254+
Version(V15).
255255
RuntimePath(tempDir).
256256
Port(9876).
257257
StartTimeout(10 * time.Second).
@@ -401,7 +401,6 @@ func Test_CanStartAndStopTwice(t *testing.T) {
401401
}
402402
}
403403

404-
//nolint:funlen
405404
func Test_ReuseData(t *testing.T) {
406405
tempDir, err := ioutil.TempDir("", "embedded_postgres_test")
407406
if err != nil {
@@ -496,7 +495,7 @@ func Test_CustomBinariesRepo(t *testing.T) {
496495
Username("gin").
497496
Password("wine").
498497
Database("beer").
499-
Version(V12).
498+
Version(V15).
500499
RuntimePath(tempDir).
501500
BinaryRepositoryURL("https://repo.maven.apache.org/maven2").
502501
Port(9876).

platform-test/platform_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
func Test_AllMajorVersions(t *testing.T) {
1515
allVersions := []embeddedpostgres.PostgresVersion{
16+
embeddedpostgres.V15,
1617
embeddedpostgres.V14,
1718
embeddedpostgres.V13,
1819
embeddedpostgres.V12,

version_strategy.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ func defaultVersionStrategy(config Config, goos, arch string, linuxMachineName f
4040
// postgres below version 14.2 is not available for macos on arm
4141
if goos == "darwin" && arch == "arm64" {
4242
var majorVer, minorVer int
43-
fmt.Sscanf(string(config.version), "%d.%d", &majorVer, &minorVer)
44-
45-
if majorVer < 14 || (majorVer == 14 && minorVer < 2) {
43+
if _, err := fmt.Sscanf(string(config.version), "%d.%d", &majorVer, &minorVer); err == nil &&
44+
(majorVer < 14 || (majorVer == 14 && minorVer < 2)) {
4645
arch = "amd64"
4746
} else {
4847
arch += "v8"

version_strategy_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"github.com/stretchr/testify/assert"
99
)
1010

11-
//nolint:funlen
1211
func Test_DefaultVersionStrategy_AllGolangDistributions(t *testing.T) {
1312
allGolangDistributions := map[string][]string{
1413
"aix/ppc64": {"aix", "ppc64"},

0 commit comments

Comments
 (0)