Skip to content

Commit

Permalink
Preload datasets (#1458)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
ilia-db authored Nov 20, 2024
1 parent b7cbe4c commit 910dccb
Show file tree
Hide file tree
Showing 8 changed files with 296 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {mock, instance, when} from "ts-mockito";
import assert from "assert";
import {EventEmitter} from "vscode";
import {install, InstalledClock} from "@sinonjs/fake-timers";
import {ConnectionManager} from "../configuration/ConnectionManager";

describe(__filename, () => {
let connectionManager: ConnectionManager;
let runStatusManager: BundleRunStatusManager;
let configModel: ConfigModel;
let manager: BundlePipelinesManager;
Expand All @@ -18,6 +20,7 @@ describe(__filename, () => {
eventEmitter = new EventEmitter();
runStatusManager = mock<BundleRunStatusManager>();
configModel = mock<ConfigModel>();
connectionManager = mock<ConnectionManager>();
when(runStatusManager.onDidChange).thenReturn(eventEmitter.event);
when(configModel.onDidChangeKey("remoteStateConfig")).thenReturn(
new EventEmitter<void>().event
Expand All @@ -26,6 +29,7 @@ describe(__filename, () => {
new EventEmitter<void>().event
);
manager = new BundlePipelinesManager(
instance(connectionManager),
instance(runStatusManager),
instance(configModel)
);
Expand All @@ -44,9 +48,7 @@ describe(__filename, () => {

/* eslint-disable @typescript-eslint/naming-convention */
const firstRun = {
data: {
update: {creation_time: 10},
},
data: {creation_time: 10},
events: [
{origin: {dataset_name: "table1"}},
{origin: {not_a_dataset_name: "table1.5"}},
Expand All @@ -67,10 +69,8 @@ describe(__filename, () => {
/* eslint-disable @typescript-eslint/naming-convention */
const secondPartialRun = {
data: {
update: {
creation_time: 100,
refresh_selection: ["table3", "table4"],
},
creation_time: 100,
refresh_selection: ["table3", "table4"],
},
events: [
{origin: {dataset_name: "table3"}},
Expand All @@ -94,10 +94,8 @@ describe(__filename, () => {
/* eslint-disable @typescript-eslint/naming-convention */
const finalFullRefreshRun = {
data: {
update: {
creation_time: 200,
refresh_selection: [],
},
creation_time: 200,
refresh_selection: [],
},
events: [
{origin: {dataset_name: "table_new"}},
Expand Down
Loading

0 comments on commit 910dccb

Please sign in to comment.