11package flypg
22
33import (
4+ "context"
45 "fmt"
56 "os"
67 "strings"
@@ -25,6 +26,8 @@ func TestPGConfigInitialization(t *testing.T) {
2526 }
2627 defer cleanup ()
2728
29+ ctx := context .TODO ()
30+
2831 pgConf := & PGConfig {
2932 DataDir : pgTestDirectory ,
3033 Port : 5433 ,
@@ -41,7 +44,7 @@ func TestPGConfigInitialization(t *testing.T) {
4144
4245 t .Run ("initialize" , func (t * testing.T ) {
4346 store , _ := state .NewStore ()
44- if err := pgConf .initialize (store ); err != nil {
47+ if err := pgConf .initialize (ctx , store ); err != nil {
4548 t .Fatal (err )
4649 }
4750 })
@@ -98,7 +101,7 @@ func TestPGConfigInitialization(t *testing.T) {
98101 t .Setenv ("TIMESCALEDB_ENABLED" , "true" )
99102 store , _ := state .NewStore ()
100103
101- if err := pgConf .initialize (store ); err != nil {
104+ if err := pgConf .initialize (ctx , store ); err != nil {
102105 t .Fatal (err )
103106 }
104107
@@ -129,7 +132,7 @@ func TestPGConfigInitialization(t *testing.T) {
129132 }
130133
131134 t .Run ("defaults" , func (t * testing.T ) {
132- if err := pgConf .initialize (store ); err != nil {
135+ if err := pgConf .initialize (ctx , store ); err != nil {
133136 t .Fatal (err )
134137 }
135138
@@ -160,7 +163,7 @@ func TestPGConfigInitialization(t *testing.T) {
160163 t .Fatal (err )
161164 }
162165
163- if err := pgConf .initialize (store ); err != nil {
166+ if err := pgConf .initialize (ctx , store ); err != nil {
164167 t .Fatal (err )
165168 }
166169
@@ -181,7 +184,7 @@ func TestPGConfigInitialization(t *testing.T) {
181184 t .Fatal (err )
182185 }
183186
184- if err := pgConf .initialize (store ); err != nil {
187+ if err := pgConf .initialize (ctx , store ); err != nil {
185188 t .Fatal (err )
186189 }
187190
@@ -202,7 +205,7 @@ func TestPGConfigInitialization(t *testing.T) {
202205 t .Fatal (err )
203206 }
204207
205- if err := pgConf .initialize (store ); err != nil {
208+ if err := pgConf .initialize (ctx , store ); err != nil {
206209 t .Fatal (err )
207210 }
208211
@@ -223,7 +226,7 @@ func TestPGConfigInitialization(t *testing.T) {
223226 t .Fatal (err )
224227 }
225228
226- if err := pgConf .initialize (store ); err != nil {
229+ if err := pgConf .initialize (ctx , store ); err != nil {
227230 t .Fatal (err )
228231 }
229232
@@ -242,7 +245,7 @@ func TestPGConfigInitialization(t *testing.T) {
242245 t .
Setenv (
"S3_ARCHIVE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory" )
243246 store , _ := state .NewStore ()
244247
245- if err := pgConf .initialize (store ); err != nil {
248+ if err := pgConf .initialize (ctx , store ); err != nil {
246249 t .Fatal (err )
247250 }
248251
@@ -257,7 +260,7 @@ func TestPGConfigInitialization(t *testing.T) {
257260
258261 t .Setenv ("S3_ARCHIVE_CONFIG" , "" )
259262
260- if err := pgConf .initialize (store ); err != nil {
263+ if err := pgConf .initialize (ctx , store ); err != nil {
261264 t .Fatal (err )
262265 }
263266
@@ -275,7 +278,7 @@ func TestPGConfigInitialization(t *testing.T) {
275278 t .
Setenv (
"S3_ARCHIVE_REMOTE_RESTORE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory?targetTime=2024-06-30T11:15:00-06:00" )
276279 store , _ := state .NewStore ()
277280
278- if err := pgConf .initialize (store ); err != nil {
281+ if err := pgConf .initialize (ctx , store ); err != nil {
279282 t .Fatal (err )
280283 }
281284
@@ -293,7 +296,7 @@ func TestPGConfigInitialization(t *testing.T) {
293296 t .
Setenv (
"S3_ARCHIVE_REMOTE_RESTORE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory?targetName=20240626T172443" )
294297 store , _ := state .NewStore ()
295298
296- if err := pgConf .initialize (store ); err != nil {
299+ if err := pgConf .initialize (ctx , store ); err != nil {
297300 t .Fatal (err )
298301 }
299302
@@ -311,7 +314,7 @@ func TestPGConfigInitialization(t *testing.T) {
311314 t .
Setenv (
"S3_ARCHIVE_REMOTE_RESTORE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory?target=immediate" )
312315 store , _ := state .NewStore ()
313316
314- if err := pgConf .initialize (store ); err != nil {
317+ if err := pgConf .initialize (ctx , store ); err != nil {
315318 t .Fatal (err )
316319 }
317320
@@ -329,7 +332,7 @@ func TestPGConfigInitialization(t *testing.T) {
329332 t .
Setenv (
"S3_ARCHIVE_REMOTE_RESTORE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory?targetTime=2024-06-30T11:15:00Z&targetInclusive=false" )
330333 store , _ := state .NewStore ()
331334
332- if err := pgConf .initialize (store ); err != nil {
335+ if err := pgConf .initialize (ctx , store ); err != nil {
333336 t .Fatal (err )
334337 }
335338
@@ -351,7 +354,7 @@ func TestPGConfigInitialization(t *testing.T) {
351354 t .
Setenv (
"S3_ARCHIVE_REMOTE_RESTORE_CONFIG" ,
"https://my-key:[email protected] /my-bucket/my-directory?targetTime=2024-06-30T11:15:00-06:00&targetTimeline=2" )
352355 store , _ := state .NewStore ()
353356
354- if err := pgConf .initialize (store ); err != nil {
357+ if err := pgConf .initialize (ctx , store ); err != nil {
355358 t .Fatal (err )
356359 }
357360
@@ -391,7 +394,7 @@ func TestPGUserConfigOverride(t *testing.T) {
391394 }
392395
393396 store , _ := state .NewStore ()
394- if err := pgConf .initialize (store ); err != nil {
397+ if err := pgConf .initialize (context . TODO (), store ); err != nil {
395398 t .Error (err )
396399 }
397400
@@ -542,7 +545,7 @@ func TestValidateCompatibility(t *testing.T) {
542545 }
543546
544547 store , _ := state .NewStore ()
545- if err := pgConf .initialize (store ); err != nil {
548+ if err := pgConf .initialize (context . TODO (), store ); err != nil {
546549 t .Fatal (err )
547550 }
548551 t .Run ("SharedPreloadLibraries" , func (t * testing.T ) {
0 commit comments