Skip to content

Commit cc44ef9

Browse files
authored
Update demo project and latest tested CLI version (3.0.0) (#4103)
1 parent 35b333b commit cc44ef9

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

demo

extension/src/cli/dvc/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Plot } from '../../plots/webview/contract'
22

33
export const MIN_CLI_VERSION = '2.58.1'
4-
export const LATEST_TESTED_CLI_VERSION = '2.58.2'
4+
export const LATEST_TESTED_CLI_VERSION = '3.0.0'
55

66
type ErrorContents = { type: string; msg: string }
77

extension/src/cli/dvc/version.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ describe('isVersionCompatible', () => {
146146
expect(isCompatible).toStrictEqual(CliCompatible.NO_INCOMPATIBLE)
147147
})
148148

149-
it('should return incompatible if the provided major version is above the expected major version', () => {
149+
it('should return compatible if the CLI is a major version ahead of the current min version', () => {
150150
const isCompatible = isVersionCompatible('3.0.0')
151151

152-
expect(isCompatible).toStrictEqual(CliCompatible.NO_INCOMPATIBLE)
152+
expect(isCompatible).toStrictEqual(CliCompatible.YES)
153153
})
154154

155155
it('should return cannot verify if the provided version is malformed', () => {
@@ -205,4 +205,10 @@ describe('isAboveLatestTestedVersion', () => {
205205

206206
expect(result).toStrictEqual(false)
207207
})
208+
209+
it('should return true if the version is a major version ahead of the latest tested version', () => {
210+
const result = isAboveLatestTestedVersion('3.0.0')
211+
212+
expect(result).toStrictEqual(true)
213+
})
208214
})

extension/src/cli/dvc/version.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const checkCLIVersion = (currentSemVer: {
3636

3737
const isBehindMinVersion =
3838
currentMajor < minMajor ||
39-
currentMinor < minMinor ||
39+
(currentMajor === minMajor && currentMinor < minMinor) ||
4040
(currentMinor === minMinor && currentPatch < Number(minPatch))
4141

4242
if (isBehindMinVersion) {
@@ -80,5 +80,8 @@ export const isAboveLatestTestedVersion = (version: string | undefined) => {
8080
LATEST_TESTED_CLI_VERSION
8181
) as ParsedSemver
8282

83-
return currentMajor === latestTestedMajor && currentMinor > latestTestedMinor
83+
return (
84+
currentMajor > latestTestedMajor ||
85+
(currentMajor === latestTestedMajor && currentMinor > latestTestedMinor)
86+
)
8487
}

extension/src/test/e2e/extension.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,16 +230,12 @@ describe('Source Control View', function () {
230230
const tooltip = await findDecorationTooltip(treeItem)
231231
expect(tooltip).toBeTruthy()
232232
}
233-
return expectedScmItemLabels.length === dvcTreeItemLabels.length
233+
return dvcTreeItemLabels.length > 0
234234
},
235235
{
236236
interval: 5000,
237237
timeout: 60000
238238
}
239239
)
240-
241-
expectedScmItemLabels.sort()
242-
dvcTreeItemLabels.sort()
243-
expect(expectedScmItemLabels).toStrictEqual(dvcTreeItemLabels)
244240
})
245241
})

0 commit comments

Comments
 (0)