Skip to content

Commit 418bd8a

Browse files
authored
Fix pushing multiple experiments (#4028)
1 parent ff253ef commit 418bd8a

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,23 @@ describe('CliExecutor', () => {
318318
executable: 'dvc'
319319
})
320320
})
321+
322+
it('should call createProcess with the correct parameters to push multiple experiments to the remote', async () => {
323+
const cwd = __dirname
324+
const stdout = ''
325+
mockedCreateProcess.mockReturnValueOnce(getMockedProcess(stdout))
326+
const mockExperimentIds = ['toric-sail', 'couth-bean', 'arced-ibex']
327+
328+
const output = await dvcExecutor.expPush(cwd, ...mockExperimentIds)
329+
expect(output).toStrictEqual(stdout)
330+
331+
expect(mockedCreateProcess).toHaveBeenCalledWith({
332+
args: ['exp', 'push', 'origin', ...mockExperimentIds],
333+
cwd,
334+
env: mockedEnv,
335+
executable: 'dvc'
336+
})
337+
})
321338
})
322339

323340
describe('expRemove', () => {

extension/src/cli/dvc/executor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ export class DvcExecutor extends DvcCli {
8080
)
8181
}
8282

83-
public expPush(cwd: string, id: string) {
83+
public expPush(cwd: string, ...ids: string[]) {
8484
return this.executeExperimentProcess(
8585
cwd,
8686
ExperimentSubCommand.PUSH,
8787
DEFAULT_REMOTE,
88-
id
88+
...ids
8989
)
9090
}
9191

0 commit comments

Comments
 (0)