@@ -140,27 +140,28 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
140140 })
141141
142142 wg := & sync.WaitGroup {}
143-
144- d , err := driver .New (
145- context .Background (),
146- os .Stderr ,
147- driver .WithConfigOptions (
148- configx .WithValues (map [string ]any {
149- config .ViperKeyDSN : url ,
150- config .ViperKeyPublicBaseURL : "https://www.ory.sh/" ,
151- config .ViperKeyIdentitySchemas : config.Schemas {{ID : "default" , URL : "file://stub/default.schema.json" }},
152- config .ViperKeySecretsDefault : []string {"secret" },
153- }),
154- configx .SkipValidation (),
155- ),
143+ opts := driver .WithConfigOptions (
144+ configx .WithValues (map [string ]any {
145+ config .ViperKeyDSN : url ,
146+ config .ViperKeyPublicBaseURL : "https://www.ory.sh/" ,
147+ config .ViperKeyIdentitySchemas : config.Schemas {{ID : "default" , URL : "file://stub/default.schema.json" }},
148+ config .ViperKeySecretsDefault : []string {"secret" },
149+ }),
150+ configx .SkipValidation (),
156151 )
157- require .NoError (t , err )
158152
159153 t .Run ("case=identity" , func (t * testing.T ) {
160154 wg .Add (1 )
161155 defer wg .Done ()
162156 t .Parallel ()
163157
158+ d , err := driver .New (
159+ context .Background (),
160+ os .Stderr ,
161+ opts ,
162+ )
163+ require .NoError (t , err )
164+
164165 ids , _ , err := d .PrivilegedIdentityPool ().ListIdentities (context .Background (), identity.ListIdentityParameters {Expand : identity .ExpandEverything , KeySetPagination : []keysetpagination.Option {keysetpagination .WithSize (1000 )}})
165166 require .NoError (t , err )
166167 require .NotEmpty (t , ids )
@@ -189,6 +190,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
189190 defer wg .Done ()
190191 t .Parallel ()
191192
193+ d , err := driver .New (
194+ context .Background (),
195+ os .Stderr ,
196+ opts ,
197+ )
198+ require .NoError (t , err )
199+
192200 ids , _ , err := d .PrivilegedIdentityPool ().ListIdentities (context .Background (), identity.ListIdentityParameters {Expand : identity .ExpandNothing , KeySetPagination : []keysetpagination.Option {keysetpagination .WithSize (1000 )}})
193201 require .NoError (t , err )
194202 require .NotEmpty (t , ids )
@@ -229,6 +237,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
229237 require .NoError (t , c .Select ("id" ).All (& ids ))
230238 require .NotEmpty (t , ids )
231239
240+ d , err := driver .New (
241+ context .Background (),
242+ os .Stderr ,
243+ opts ,
244+ )
245+ require .NoError (t , err )
246+
232247 var found []string
233248 for _ , id := range ids {
234249 found = append (found , id .ID .String ())
@@ -249,6 +264,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
249264 require .NoError (t , c .Select ("id" ).All (& ids ))
250265 require .NotEmpty (t , ids )
251266
267+ d , err := driver .New (
268+ context .Background (),
269+ os .Stderr ,
270+ opts ,
271+ )
272+ require .NoError (t , err )
273+
252274 var found []string
253275 for _ , id := range ids {
254276 found = append (found , id .ID .String ())
@@ -268,6 +290,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
268290 require .NoError (t , c .Select ("id" ).All (& ids ))
269291 require .NotEmpty (t , ids )
270292
293+ d , err := driver .New (
294+ context .Background (),
295+ os .Stderr ,
296+ opts ,
297+ )
298+ require .NoError (t , err )
299+
271300 var found []string
272301 for _ , id := range ids {
273302 found = append (found , id .ID .String ())
@@ -287,6 +316,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
287316 require .NoError (t , c .Select ("id" ).All (& ids ))
288317 require .NotEmpty (t , ids )
289318
319+ d , err := driver .New (
320+ context .Background (),
321+ os .Stderr ,
322+ opts ,
323+ )
324+ require .NoError (t , err )
325+
290326 var found []string
291327 for _ , id := range ids {
292328 found = append (found , id .ID .String ())
@@ -306,6 +342,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
306342 require .NoError (t , c .Select ("id" ).All (& ids ))
307343 require .NotEmpty (t , ids )
308344
345+ d , err := driver .New (
346+ context .Background (),
347+ os .Stderr ,
348+ opts ,
349+ )
350+ require .NoError (t , err )
351+
309352 var found []string
310353 for _ , id := range ids {
311354 found = append (found , id .ID .String ())
@@ -325,6 +368,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
325368 require .NoError (t , c .Select ("id" ).All (& ids ))
326369 require .NotEmpty (t , ids )
327370
371+ d , err := driver .New (
372+ context .Background (),
373+ os .Stderr ,
374+ opts ,
375+ )
376+ require .NoError (t , err )
377+
328378 var found []string
329379 for _ , id := range ids {
330380 found = append (found , id .ID .String ())
@@ -408,6 +458,13 @@ func testDatabase(t *testing.T, db string, c *pop.Connection) {
408458 t .Parallel ()
409459 wg .Wait ()
410460
461+ d , err := driver .New (
462+ context .Background (),
463+ os .Stderr ,
464+ opts ,
465+ )
466+ require .NoError (t , err )
467+
411468 sr , err := d .SettingsFlowPersister ().GetSettingsFlow (context .Background (), x .ParseUUID ("a79bfcf1-68ae-49de-8b23-4f96921b8341" ))
412469 require .NoError (t , err )
413470
0 commit comments