Skip to content

Commit 910dccb

Browse files
authored
Preload datasets (#1458)
## Changes - Preload recent updates and their events when opening partial refresh Quick Pick - Add warning if the Full Refresh option is selected (the same we show in the workspace UI) - Fix small bug with run state (which I introduced in the previous PR) ![Screen Recording 2024-11-20 at 11 28 19](https://github.com/user-attachments/assets/a5448845-8068-4d41-90c6-f12eb1c6af40) ## Tests Manually and existing tests
1 parent b7cbe4c commit 910dccb

File tree

8 files changed

+296
-118
lines changed

8 files changed

+296
-118
lines changed

packages/databricks-vscode/src/bundle/BundlePipelinesManager.test.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import {mock, instance, when} from "ts-mockito";
55
import assert from "assert";
66
import {EventEmitter} from "vscode";
77
import {install, InstalledClock} from "@sinonjs/fake-timers";
8+
import {ConnectionManager} from "../configuration/ConnectionManager";
89

910
describe(__filename, () => {
11+
let connectionManager: ConnectionManager;
1012
let runStatusManager: BundleRunStatusManager;
1113
let configModel: ConfigModel;
1214
let manager: BundlePipelinesManager;
@@ -18,6 +20,7 @@ describe(__filename, () => {
1820
eventEmitter = new EventEmitter();
1921
runStatusManager = mock<BundleRunStatusManager>();
2022
configModel = mock<ConfigModel>();
23+
connectionManager = mock<ConnectionManager>();
2124
when(runStatusManager.onDidChange).thenReturn(eventEmitter.event);
2225
when(configModel.onDidChangeKey("remoteStateConfig")).thenReturn(
2326
new EventEmitter<void>().event
@@ -26,6 +29,7 @@ describe(__filename, () => {
2629
new EventEmitter<void>().event
2730
);
2831
manager = new BundlePipelinesManager(
32+
instance(connectionManager),
2933
instance(runStatusManager),
3034
instance(configModel)
3135
);
@@ -44,9 +48,7 @@ describe(__filename, () => {
4448

4549
/* eslint-disable @typescript-eslint/naming-convention */
4650
const firstRun = {
47-
data: {
48-
update: {creation_time: 10},
49-
},
51+
data: {creation_time: 10},
5052
events: [
5153
{origin: {dataset_name: "table1"}},
5254
{origin: {not_a_dataset_name: "table1.5"}},
@@ -67,10 +69,8 @@ describe(__filename, () => {
6769
/* eslint-disable @typescript-eslint/naming-convention */
6870
const secondPartialRun = {
6971
data: {
70-
update: {
71-
creation_time: 100,
72-
refresh_selection: ["table3", "table4"],
73-
},
72+
creation_time: 100,
73+
refresh_selection: ["table3", "table4"],
7474
},
7575
events: [
7676
{origin: {dataset_name: "table3"}},
@@ -94,10 +94,8 @@ describe(__filename, () => {
9494
/* eslint-disable @typescript-eslint/naming-convention */
9595
const finalFullRefreshRun = {
9696
data: {
97-
update: {
98-
creation_time: 200,
99-
refresh_selection: [],
100-
},
97+
creation_time: 200,
98+
refresh_selection: [],
10199
},
102100
events: [
103101
{origin: {dataset_name: "table_new"}},

0 commit comments

Comments
 (0)