Skip to content

Commit

Permalink
Merge branch 'main' into remove-node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
sroy3 authored May 15, 2023
2 parents 6364fd8 + a06d18f commit 0ee7710
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 90 deletions.
2 changes: 0 additions & 2 deletions extension/src/test/fixtures/expShow/base/workspaceChanges.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { buildDepPath } from '../../../../experiments/columns/paths'

const data = [
'metrics:summary.json:accuracy',
'metrics:summary.json:loss',
Expand Down
5 changes: 1 addition & 4 deletions extension/src/test/fixtures/expShow/dataTypes/rows.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
ExperimentStatus,
EXPERIMENT_WORKSPACE_ID
} from '../../../../cli/dvc/contract'
import { EXPERIMENT_WORKSPACE_ID } from '../../../../cli/dvc/contract'
import { Commit } from '../../../../experiments/webview/contract'

const data: Commit[] = [
Expand Down
17 changes: 3 additions & 14 deletions extension/src/test/fixtures/expShow/dataTypes/tableData.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
import columns from './columns'
import defaultData from '../base/tableData'
import rows from './rows'
import { TableData } from '../../../../experiments/webview/contract'

export const data: TableData = {
changes: [],
columnOrder: [],
...defaultData,
columns,
columnWidths: {},
filteredCount: 0,
filters: [],
hasBranchesToSelect: true,
hasCheckpoints: false,
hasColumns: true,
hasConfig: true,
hasMoreCommits: true,
hasRunningWorkspaceExperiment: false,
hasValidDvcYaml: true,
isShowingMoreCommits: true,
isBranchesView: false,
rows,
selectedForPlotsCount: 0,
sorts: []
selectedForPlotsCount: 0
}

export default data
13 changes: 2 additions & 11 deletions extension/src/test/fixtures/expShow/deeplyNested/tableData.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
import columns from './columns'
import rows from './rows'
import defaultData from '../base/tableData'
import { TableData } from '../../../../experiments/webview/contract'

const data: TableData = {
changes: [],
columnOrder: [],
...defaultData,
columns,
columnWidths: {},
filteredCount: 0,
filters: [
'params:params.yaml:nested1.doubled',
'params:params.yaml:nested1%2Enested2%2Enested3.nested4.nested5b.doubled'
],
hasBranchesToSelect: true,
hasCheckpoints: false,
hasColumns: true,
hasConfig: true,
hasMoreCommits: true,
hasRunningWorkspaceExperiment: false,
hasValidDvcYaml: true,
isBranchesView: false,
isShowingMoreCommits: true,
rows,
selectedForPlotsCount: 0,
sorts: [
Expand Down
20 changes: 3 additions & 17 deletions extension/src/test/fixtures/expShow/survival/tableData.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
import { TableData } from '../../../../experiments/webview/contract'
import rowsFixture from './rows'
import columnsFixture from './columns'
import defaultData from '../base/tableData'

const data: TableData = {
changes: [],
columnOrder: [],
...defaultData,
columns: columnsFixture,
columnWidths: {},
filteredCount: 0,
filters: [],
hasBranchesToSelect: true,
hasCheckpoints: true,
hasColumns: true,
hasConfig: true,
hasMoreCommits: true,
hasRunningWorkspaceExperiment: true,
hasValidDvcYaml: true,
isBranchesView: false,
isShowingMoreCommits: true,
rows: rowsFixture,
selectedForPlotsCount: 0,
sorts: []
rows: rowsFixture
}

export default data
30 changes: 3 additions & 27 deletions extension/src/test/suite/experiments/model/filterBy/tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,9 @@ suite('Experiments Filter By Tree Test Suite', () => {

const filteredTableData: Partial<TableData> = {
changes: workspaceChangesFixture,
columnOrder: columnsOrderFixture,
columnWidths: {},
columns: columnsFixture,
filteredCount: 1,
filters: [accuracyPath],
hasCheckpoints: true,
hasColumns: true,
hasConfig: true,
hasRunningWorkspaceExperiment: true,
hasValidDvcYaml: true,
rows: filteredRows,
sorts: []
rows: filteredRows
}

expect(messageSpy).to.be.calledWithMatch(filteredTableData)
Expand All @@ -135,18 +126,10 @@ suite('Experiments Filter By Tree Test Suite', () => {

const unfilteredTableData: Partial<TableData> = {
changes: workspaceChangesFixture,
columnOrder: columnsOrderFixture,
columnWidths: {},
columns: columnsFixture,
filteredCount: 0,
filters: [],
hasCheckpoints: true,
hasColumns: true,
hasConfig: true,
hasRunningWorkspaceExperiment: true,
hasValidDvcYaml: true,
rows: [workspace, main],
sorts: []
rows: [workspace, main]
}

expect(messageSpy).to.be.calledWithMatch(unfilteredTableData)
Expand Down Expand Up @@ -379,17 +362,10 @@ suite('Experiments Filter By Tree Test Suite', () => {
const filteredTableData: Partial<TableData> = {
changes: workspaceChangesFixture,
columnOrder: columnsOrderFixture,
columnWidths: {},
columns: columnsFixture,
filteredCount: 6,
filters: ['starred'],
hasCheckpoints: true,
hasColumns: true,
hasConfig: true,
hasRunningWorkspaceExperiment: true,
hasValidDvcYaml: true,
rows: filteredRows,
sorts: []
rows: filteredRows
}

expect(messageSpy).to.be.calledWithMatch(filteredTableData)
Expand Down
18 changes: 3 additions & 15 deletions webview/src/test/sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ColumnType,
TableData
} from 'dvc/src/experiments/webview/contract'
import defaultTableData from 'dvc/src/test/fixtures/expShow/base/tableData'

const defaultColumn = ['Experiment', 'Created']

Expand Down Expand Up @@ -40,21 +41,9 @@ const columns = [
]

export const tableData: TableData = {
changes: [],
columnOrder: [],
columnWidths: {},
...defaultTableData,
columns: columns as Column[],
filteredCount: 0,
filters: [],
hasBranchesToSelect: true,
hasCheckpoints: false,
hasColumns: true,
hasConfig: true,
hasMoreCommits: true,
hasRunningWorkspaceExperiment: false,
hasValidDvcYaml: true,
isBranchesView: false,
isShowingMoreCommits: true,
rows: [
{
branch: 'current',
Expand All @@ -67,8 +56,7 @@ export const tableData: TableData = {
label: 'main'
}
],
selectedForPlotsCount: 0,
sorts: []
selectedForPlotsCount: 0
}

export const getHeaders = async () => {
Expand Down

0 comments on commit 0ee7710

Please sign in to comment.