Skip to content

Commit

Permalink
Revert "Change tests"
Browse files Browse the repository at this point in the history
This reverts commit 820c3bb.
  • Loading branch information
Stephanie Roy committed May 24, 2023
1 parent 198eebc commit bb0ece6
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions extension/src/test/suite/experiments/data/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ import {
InternalCommands
} from '../../../../commands/internal'
import { buildExperimentsData } from '../util'
import {
DEFAULT_NUM_OF_COMMITS_TO_SHOW,
ExperimentFlag
} from '../../../../cli/dvc/constants'
import { DEFAULT_NUM_OF_COMMITS_TO_SHOW } from '../../../../cli/dvc/constants'
import { EXPERIMENTS_GIT_LOGS_REFS } from '../../../../experiments/data/constants'
import { gitPath } from '../../../../cli/git/constants'
import * as FileSystem from '../../../../fileSystem'
Expand Down Expand Up @@ -187,6 +184,24 @@ suite('Experiments Data Test Suite', () => {
expect(managedUpdateSpy).to.be.called
}).timeout(10000)

it('should call exp show for each branch to show', async () => {
stub(ExperimentsData.prototype, 'managedUpdate').resolves()
const branchesToShow = [
'main',
'my-other-branch',
'secret-branch',
'old-branch'
]
const { data, mockExpShow, mockGetBranchesToShow } =
buildExperimentsData(disposable)

mockGetBranchesToShow.returns(branchesToShow)

await data.update()

expect(mockExpShow).to.have.callCount(branchesToShow.length)
})

it('should prune any old branches to show before calling exp show on them', async () => {
stub(ExperimentsData.prototype, 'managedUpdate').resolves()
const branchesToShow = [
Expand All @@ -211,19 +226,11 @@ suite('Experiments Data Test Suite', () => {
'branch-283498'
)

mockGetBranchesToShow.returns([])
mockGetBranchesToShow.returns(['main'])

await data.update()

expect(mockExpShow).to.have.been.calledWithMatch(
dvcDemoPath,
ExperimentFlag.REV,
'branch-283498~0',
ExperimentFlag.REV,
'branch-283498~1',
ExperimentFlag.REV,
'branch-283498~2'
)
expect(mockExpShow).to.have.callCount(2)
})
})
})

0 comments on commit bb0ece6

Please sign in to comment.