@@ -1365,20 +1365,28 @@ async fn extends_config() -> Result<()> {
1365
1365
. await
1366
1366
. expect ( "Failed to setup test database" ) ;
1367
1367
1368
+ tracing:: info!(
1369
+ "writing to {:?}" ,
1370
+ url!( "postgrestools.jsonc" ) . to_file_path( ) . unwrap( ) ,
1371
+ ) ;
1372
+
1368
1373
// shared config with default db connection
1369
1374
let conf_with_db = PartialConfiguration :: init ( ) ;
1370
1375
fs. insert (
1371
1376
url ! ( "postgrestools.jsonc" ) . to_file_path ( ) . unwrap ( ) ,
1372
1377
serde_json:: to_string_pretty ( & conf_with_db) . unwrap ( ) ,
1373
1378
) ;
1374
1379
1380
+ let relative_path = if cfg ! ( windows) {
1381
+ "..\\ postgrestools.jsonc"
1382
+ } else {
1383
+ "../postgrestools.jsonc"
1384
+ } ;
1385
+
1375
1386
// test_one extends the shared config but sets our test db
1376
1387
let mut conf_with_db = PartialConfiguration :: init ( ) ;
1377
1388
conf_with_db. merge_with ( PartialConfiguration {
1378
- extends : Some ( StringSet :: from_iter ( [ Path :: new ( ".." )
1379
- . join ( "postgrestools.jsonc" )
1380
- . to_string_lossy ( )
1381
- . to_string ( ) ] ) ) ,
1389
+ extends : Some ( StringSet :: from_iter ( [ relative_path. to_string ( ) ] ) ) ,
1382
1390
db : Some ( PartialDatabaseConfiguration {
1383
1391
database : Some (
1384
1392
test_db
@@ -1391,6 +1399,7 @@ async fn extends_config() -> Result<()> {
1391
1399
} ) ,
1392
1400
..Default :: default ( )
1393
1401
} ) ;
1402
+
1394
1403
fs. insert (
1395
1404
url ! ( "test_one/postgrestools.jsonc" ) . to_file_path ( ) . unwrap ( ) ,
1396
1405
serde_json:: to_string_pretty ( & conf_with_db) . unwrap ( ) ,
@@ -1399,10 +1408,7 @@ async fn extends_config() -> Result<()> {
1399
1408
// test_two extends it but keeps the default one
1400
1409
let mut conf_without_db = PartialConfiguration :: init ( ) ;
1401
1410
conf_without_db. merge_with ( PartialConfiguration {
1402
- extends : Some ( StringSet :: from_iter ( [ Path :: new ( ".." )
1403
- . join ( "postgrestools.jsonc" )
1404
- . to_string_lossy ( )
1405
- . to_string ( ) ] ) ) ,
1411
+ extends : Some ( StringSet :: from_iter ( [ relative_path. to_string ( ) ] ) ) ,
1406
1412
..Default :: default ( )
1407
1413
} ) ;
1408
1414
fs. insert (
0 commit comments