@@ -1230,6 +1230,27 @@ def test_native_split_continue( # pylint: disable=too-many-locals
1230
1230
},
1231
1231
"uuid" : "5" ,
1232
1232
}
1233
+ dashboard_deleted_chart = {
1234
+ "dashboard_title" : "Dashboard with deleted chart" ,
1235
+ "is_managed_externally" : False ,
1236
+ "position" : {
1237
+ "DASHBOARD_VERSION_KEY" : "v2" ,
1238
+ "CHART-BVI44PWH" : {
1239
+ "type" : "CHART" ,
1240
+ "meta" : {
1241
+ "uuid" : "3" ,
1242
+ },
1243
+ },
1244
+ "CHART-BLAH" : {
1245
+ "type" : "CHART" ,
1246
+ "meta" : {
1247
+ "uuid" : None ,
1248
+ },
1249
+ },
1250
+ },
1251
+ "metadata" : {},
1252
+ "uuid" : "6" ,
1253
+ }
1233
1254
1234
1255
fs .create_file (
1235
1256
root / "databases/gsheets.yaml" ,
@@ -1251,6 +1272,10 @@ def test_native_split_continue( # pylint: disable=too-many-locals
1251
1272
root / "dashboards/dashboard_deleted_dataset.yaml" ,
1252
1273
contents = yaml .dump (dashboard_deleted_dataset ),
1253
1274
)
1275
+ fs .create_file (
1276
+ root / "dashboards/dashboard_deleted_chart.yaml" ,
1277
+ contents = yaml .dump (dashboard_deleted_chart ),
1278
+ )
1254
1279
1255
1280
SupersetClient = mocker .patch (
1256
1281
"preset_cli.cli.superset.sync.native.command.SupersetClient" ,
@@ -1262,6 +1287,8 @@ def test_native_split_continue( # pylint: disable=too-many-locals
1262
1287
mocker .patch ("preset_cli.cli.superset.main.UsernamePasswordAuth" )
1263
1288
mocker .patch ("preset_cli.cli.superset.lib.LOG_FILE_PATH" , Path ("progress.log" ))
1264
1289
1290
+ assert not Path ("progress.log" ).exists ()
1291
+
1265
1292
runner = CliRunner ()
1266
1293
result = runner .invoke (
1267
1294
superset_cli ,
@@ -1330,6 +1357,43 @@ def test_native_split_continue( # pylint: disable=too-many-locals
1330
1357
any_order = True ,
1331
1358
)
1332
1359
1360
+ with open ("progress.log" , encoding = "utf-8" ) as log :
1361
+ content = yaml .load (log , Loader = yaml .SafeLoader )
1362
+
1363
+ assert content ["ownership" ] == []
1364
+ assert content ["assets" ] == [
1365
+ {
1366
+ "path" : "bundle/databases/gsheets.yaml" ,
1367
+ "uuid" : "1" ,
1368
+ "status" : "SUCCESS" ,
1369
+ },
1370
+ {
1371
+ "path" : "bundle/datasets/gsheets/test.yaml" ,
1372
+ "uuid" : "2" ,
1373
+ "status" : "SUCCESS" ,
1374
+ },
1375
+ {
1376
+ "path" : "bundle/charts/chart.yaml" ,
1377
+ "uuid" : "3" ,
1378
+ "status" : "SUCCESS" ,
1379
+ },
1380
+ {
1381
+ "path" : "bundle/dashboards/dashboard_deleted_chart.yaml" ,
1382
+ "uuid" : "6" ,
1383
+ "status" : "FAILED" ,
1384
+ },
1385
+ {
1386
+ "path" : "bundle/dashboards/dashboard_deleted_dataset.yaml" ,
1387
+ "uuid" : "5" ,
1388
+ "status" : "SUCCESS" ,
1389
+ },
1390
+ {
1391
+ "path" : "bundle/dashboards/dashboard.yaml" ,
1392
+ "uuid" : "4" ,
1393
+ "status" : "SUCCESS" ,
1394
+ },
1395
+ ]
1396
+
1333
1397
1334
1398
def test_native_continue_without_split (
1335
1399
mocker : MockerFixture ,
0 commit comments