Skip to content

Commit

Permalink
Merge branch 'main' into add-setup-studio-module
Browse files Browse the repository at this point in the history
  • Loading branch information
julieg18 authored Nov 7, 2023
2 parents c81c90e + 2aca646 commit 3a5bc6f
Show file tree
Hide file tree
Showing 14 changed files with 508 additions and 506 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/dvc-cli-output-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
fetch-depth: 0
submodules: true

- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/end-to-end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'
cache: 'pip'

- name: Setup Node.js environment
Expand Down
2 changes: 1 addition & 1 deletion demo
Submodule demo updated 1 files
+2 −2 requirements.txt
8 changes: 4 additions & 4 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@
"appdirs": "1.1.0",
"execa": "5.1.1",
"fs-extra": "11.1.1",
"json-2-csv": "4.1.1",
"json-2-csv": "5.0.1",
"json5": "2.2.3",
"lodash.clonedeep": "4.5.0",
"lodash.get": "4.4.2",
Expand All @@ -1738,7 +1738,7 @@
"@types/chai-as-promised": "7.1.7",
"@types/copy-webpack-plugin": "10.1.0",
"@types/fs-extra": "11.0.3",
"@types/jest": "29.5.6",
"@types/jest": "29.5.7",
"@types/lodash.clonedeep": "4.5.8",
"@types/lodash.get": "4.4.8",
"@types/lodash.isempty": "4.4.8",
Expand All @@ -1754,7 +1754,7 @@
"@types/vega": "3.2.0",
"@types/vscode": "1.64.0",
"@vscode/test-electron": "2.3.6",
"@vscode/vsce": "2.21.1",
"@vscode/vsce": "2.22.0",
"@wdio/cli": "8.16.7",
"@wdio/local-runner": "8.16.7",
"@wdio/mocha-framework": "8.16.7",
Expand All @@ -1763,7 +1763,7 @@
"chai-as-promised": "7.1.1",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "11.0.0",
"fork-ts-checker-webpack-plugin": "9.0.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"jest": "29.7.0",
"jest-environment-node": "29.7.0",
"lint-staged": "14.0.1",
Expand Down
8 changes: 4 additions & 4 deletions extension/src/fileSystem/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ describe('writeJson', () => {
})

describe('writeCsv', () => {
it('should write csv into given file', async () => {
await writeCsv('file-name.csv', [
it('should write csv into given file', () => {
writeCsv('file-name.csv', [
{ nested: { string: 'string1' }, value: 3 },
{ nested: { string: 'string2' }, value: 4 },
{ nested: { string: 'string3' }, value: 6 }
Expand All @@ -260,8 +260,8 @@ describe('writeCsv', () => {
})

describe('writeTsv', () => {
it('should write tsv into given file', async () => {
await writeTsv('file-name.tsv', [
it('should write tsv into given file', () => {
writeTsv('file-name.tsv', [
{ nested: { string: 'string1' }, value: 3 },
{ nested: { string: 'string2' }, value: 4 },
{ nested: { string: 'string3' }, value: 6 }
Expand Down
14 changes: 4 additions & 10 deletions extension/src/fileSystem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,19 +384,13 @@ export const writeJson = <
return writeFile(path, json)
}

export const writeCsv = async (
path: string,
arr: Array<Record<string, unknown>>
) => {
const csv = await json2csv(arr)
export const writeCsv = (path: string, arr: Array<Record<string, unknown>>) => {
const csv = json2csv(arr)
return writeFile(path, csv)
}

export const writeTsv = async (
path: string,
arr: Array<Record<string, unknown>>
) => {
const csv = await json2csv(arr, { delimiter: { field: '\t' } })
export const writeTsv = (path: string, arr: Array<Record<string, unknown>>) => {
const csv = json2csv(arr, { delimiter: { field: '\t' } })
return writeFile(path, csv)
}

Expand Down
11 changes: 4 additions & 7 deletions extension/src/plots/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,7 @@ export class PlotsModel extends ModelWithPersistence {
}

public savePlotDataAsJson(filePath: string, plotId: string) {
void this.savePlotData(filePath, plotId, data => {
writeJson(filePath, data, true)
return Promise.resolve()
})
this.savePlotData(filePath, plotId, data => writeJson(filePath, data, true))
}

public savePlotDataAsCsv(filePath: string, plotId: string) {
Expand Down Expand Up @@ -508,10 +505,10 @@ export class PlotsModel extends ModelWithPersistence {
return collectCustomPlotRawData(orderValue, experiments)
}

private async savePlotData(
private savePlotData(
filePath: string,
plotId: string,
writeToFile: (rawData: Array<Record<string, unknown>>) => Promise<void>
writeToFile: (rawData: Array<Record<string, unknown>>) => void
) {
const foundCustomPlot = this.customPlotsOrder.find(
({ metric, param }) => getCustomPlotId(metric, param) === plotId
Expand All @@ -522,7 +519,7 @@ export class PlotsModel extends ModelWithPersistence {
: this.getSelectedTemplatePlotData(plotId)

try {
await writeToFile(rawData)
writeToFile(rawData)
void openFileInEditor(filePath)
} catch {
void Toast.showError('Cannot write to file')
Expand Down
9 changes: 4 additions & 5 deletions extension/src/test/e2e/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ describe('Source Control View', function () {
// eslint-disable-next-line sonarjs/cognitive-complexity
it('should show the expected changes after running an experiment', async function () {
const expectedScmItemLabels = [
'demo DVC',
'hist.csv',
'model.pt',
'plots, training',
Expand All @@ -216,19 +215,19 @@ describe('Source Control View', function () {
const expectedScmSet = new Set(expectedScmItemLabels)
let dvcTreeItemLabels: string[] = []

let openView = true

await browser.waitUntil(
async () => {
dvcTreeItemLabels = []
const treeItems = await findScmTreeItems()
const treeItems = await findScmTreeItems(openView)
openView = false
for (const treeItem of treeItems) {
const treeItemLabel = await getLabel(treeItem)
if (!expectedScmSet.has(treeItemLabel)) {
continue
}
dvcTreeItemLabels.push(treeItemLabel)
if (treeItemLabel === 'demo DVC') {
continue
}

const tooltip = await findDecorationTooltip(treeItem)
expect(tooltip).toBeTruthy()
Expand Down
28 changes: 17 additions & 11 deletions extension/src/test/e2e/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,24 @@ export const expectAllPlotsToBeFilled = async (webview: PlotsWebview) => {
}
}

export const findScmTreeItems = async () => {
const workbench = await browser.getWorkbench()
const activityBar = workbench.getActivityBar()
const sourceControlIcon = await activityBar.getViewControl('Source Control')

await sourceControlIcon?.openView()

const visibleItems = await findCurrentTreeItems()

await visibleItems[visibleItems.length - 1].click()
export const findScmTreeItems = async (openView: boolean) => {
if (openView) {
await browser
.action('key')
.down(Key.Control)
.down(Key.Shift)
.down('g')
.up(Key.Control)
.up(Key.Shift)
.up('g')
.pause(100)
.down(Key.Tab)
.up(Key.Tab)
.pause(100)
.perform()
}

for (let i = 0; i < 20; i++) {
for (let i = 0; i < 30; i++) {
await browser.keys('ArrowDown')
}

Expand Down
3 changes: 2 additions & 1 deletion extension/src/test/e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const config: Options.Testrunner = {
'wdio:vscodeOptions': {
extensionPath,
userSettings: {
'dvc.pythonPath': getVenvBinPath(dvcDemoPath, '.env', 'python')
'dvc.pythonPath': getVenvBinPath(dvcDemoPath, '.env', 'python'),
'window.commandCenter': false
},
verboseLogging: false,
workspacePath: dvcDemoPath
Expand Down
4 changes: 2 additions & 2 deletions languageServer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"devDependencies": {
"@swc/core": "1.3.95",
"@swc/jest": "0.2.29",
"@types/jest": "29.5.6",
"@types/jest": "29.5.7",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "11.0.0",
"fork-ts-checker-webpack-plugin": "9.0.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"ts-loader": "9.5.0",
"lint-staged": "14.0.1",
"jest": "29.7.0",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
"svgr": "yarn workspace dvc-vscode-webview svgr"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "6.9.0",
"@typescript-eslint/parser": "6.9.0",
"@vscode/codicons": "0.0.33",
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1",
"@vscode/codicons": "0.0.35",
"eslint": "8.52.0",
"eslint-config-prettier": "9.0.0",
"eslint-config-prettier-standard": "4.0.1",
"eslint-config-standard": "17.1.0",
"eslint-plugin-check-file": "2.6.2",
"eslint-plugin-etc": "2.0.3",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jest": "27.4.3",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-n": "16.2.0",
"eslint-plugin-prettier": "5.0.1",
Expand All @@ -54,7 +54,7 @@
"eslint-plugin-sonarjs": "0.21.0",
"eslint-plugin-sort-keys-fix": "1.1.2",
"eslint-plugin-testing-library": "6.1.0",
"eslint-plugin-unicorn": "48.0.1",
"eslint-plugin-unicorn": "49.0.0",
"husky": "8.0.3",
"jest": "29.7.0",
"lint-staged": "14.0.1",
Expand All @@ -73,7 +73,7 @@
"fastify": "3.29.5",
"json5": "2.2.3",
"loader-utils": "2.0.4",
"terser": "5.22.0",
"terser": "5.23.0",
"trim-newlines": "3.0.1",
"trim": "1.0.1"
},
Expand Down
18 changes: 9 additions & 9 deletions webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"vega-util": "1.17.2"
},
"devDependencies": {
"@storybook/addon-essentials": "7.5.1",
"@storybook/addon-interactions": "7.5.1",
"@storybook/addons": "7.5.1",
"@storybook/builder-webpack5": "7.5.1",
"@storybook/addon-essentials": "7.5.2",
"@storybook/addon-interactions": "7.5.2",
"@storybook/addons": "7.5.2",
"@storybook/builder-webpack5": "7.5.2",
"@storybook/manager-webpack5": "6.5.16",
"@storybook/preset-scss": "1.0.3",
"@storybook/react": "7.5.1",
"@storybook/react-webpack5": "7.5.1",
"@storybook/react": "7.5.2",
"@storybook/react-webpack5": "7.5.2",
"@storybook/testing-library": "0.2.2",
"@svgr/core": "^8.0.0",
"@svgr/plugin-jsx": "^8.0.1",
Expand All @@ -55,7 +55,7 @@
"@swc/jest": "0.2.29",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@types/jest": "29.5.6",
"@types/jest": "29.5.7",
"@types/jsdom": "21.1.4",
"@types/node": "16.x",
"@types/react": "18.2.33",
Expand All @@ -66,7 +66,7 @@
"clean-webpack-plugin": "4.0.0",
"css-loader": "6.8.1",
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "9.0.0",
"fork-ts-checker-webpack-plugin": "9.0.2",
"identity-obj-proxy": "3.0.0",
"jest": "29.7.0",
"jest-canvas-mock": "2.5.2",
Expand All @@ -75,7 +75,7 @@
"raw-loader": "4.0.2",
"sass": "1.69.5",
"sass-loader": "13.3.2",
"storybook": "7.5.1",
"storybook": "7.5.2",
"storybook-addon-themes": "6.1.0",
"style-loader": "3.3.3",
"stylelint": "15.11.0",
Expand Down
Loading

0 comments on commit 3a5bc6f

Please sign in to comment.