Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plots show command (with stub) #995

Merged
merged 11 commits into from
Nov 5, 2021
Merged

Add plots show command (with stub) #995

merged 11 commits into from
Nov 5, 2021

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Nov 4, 2021

2/5 master <- #1001 <- this <- #996 <- #998 <- #999

This PR adds a stub for plots show --show-json which I use in the subsequent PRs to wire up the first iteration of displaying static plots in the new plots webview.

In the final PR the stub is changed from the test fixture to {} so that we do not display any of the stubbed data to any users.

There will no doubt be conflicts with master in #999 because of the work coming in from #1000. Happy to fix them after the fact 👍🏻 .

@@ -8,6 +8,7 @@ import { createProcess } from '../processExecution'
import { getFailingMockedProcess, getMockedProcess } from '../test/util/jest'
import { getProcessEnv } from '../env'
import complexExperimentsOutput from '../test/fixtures/complex-output-example'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to be renamed


const plots = await cliReader.plotsShow(cwd)
expect(plots).toEqual(complexStaticPlots)
expect(mockedCreateProcess).not.toBeCalled()
Copy link
Member Author

@mattseddon mattseddon Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] This second expect will fail when we remove the stub, we can then replace it with whats below

@@ -172,6 +182,11 @@ export class CliReader extends Cli {
formatter: typeof trimAndSplit | typeof JSON.parse,
...args: Args
): Promise<T> {
// Stubbed until DVC ready
if (isEqual(args, ['plots', 'show', '--show-json'])) {
Copy link
Member Author

@mattseddon mattseddon Nov 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] This is a guess at what the command will actually be

@mattseddon mattseddon force-pushed the add-static-plots branch 2 times, most recently from 2df8d38 to 6b4b10b Compare November 4, 2021 22:06
@mattseddon mattseddon changed the base branch from master to rename-test-fixtures November 4, 2021 22:06
@@ -173,7 +175,7 @@ const data = {
]
}
]
},
} as VisualizationSpec,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] Have to cast otherwise we get type errors

@@ -986,6 +986,7 @@
"@types/lodash.omit": "^4.5.6",
"@types/mocha": "^8.2.0",
"@types/node": "^14.14.22",
"@types/react-vega": "^7.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[F] We need this for the contract

@mattseddon mattseddon force-pushed the rename-test-fixtures branch from 62010d6 to f3392c0 Compare November 5, 2021 00:43
@mattseddon mattseddon marked this pull request as ready for review November 5, 2021 00:53
Base automatically changed from rename-test-fixtures to master November 5, 2021 15:58
@codeclimate
Copy link

codeclimate bot commented Nov 5, 2021

Code Climate has analyzed commit 625ff96 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.3% (0.0% change).

View more on Code Climate.

@rogermparent rogermparent merged commit 1298720 into master Nov 5, 2021
@rogermparent rogermparent deleted the add-static-plots branch November 5, 2021 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants