|
1 | | -import { collectExperiments } from './collect' |
| 1 | +import { collectExperiments, collectRemoteExpDetails } from './collect' |
2 | 2 | import { generateTestExpShowOutput } from '../../test/util/experiments' |
3 | 3 | import { ExpShowOutput } from '../../cli/dvc/contract' |
4 | 4 |
|
@@ -101,3 +101,36 @@ describe('collectExperiments', () => { |
101 | 101 | ]) |
102 | 102 | }) |
103 | 103 | }) |
| 104 | + |
| 105 | +describe('collectRemoteExpDetails', () => { |
| 106 | + it('should parse the git ls-remote output', () => { |
| 107 | + const output = `263e4408e42a0e215b0f70b36b2ab7b65a160d7e refs/exps/a9/b32d14966b9be1396f2211d9eb743359708a07/vital-taal |
| 108 | + d4f2a35773ead55b7ce4b596f600e98360e49372 refs/exps/a9/b32d14966b9be1396f2211d9eb743359708a07/whole-bout |
| 109 | + 5af79e8d5e53f4e41221b6a166121d96d50b630a refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/deism-bots |
| 110 | + 21745a4aa76daf59b49ec81480fe7a89c7ea8fb2 refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/inter-gulf |
| 111 | + 390aef747f45fc49ec8928b24771f8950d057393 refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/known-flus |
| 112 | + 142a803b83ff784ba1106cc4ad0ba03310da6186 refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/tight-lira |
| 113 | + 21ce298cd1743405a0d73f5cb4cf52289ffa3276 refs/exps/bf/6ca8a35911bc6e62fb9bcaa506d4f4e185450c/crumb-orcs` |
| 114 | + const { remoteExpRefs, remoteExpShas } = collectRemoteExpDetails(output) |
| 115 | + expect(remoteExpRefs).toStrictEqual([ |
| 116 | + 'refs/exps/a9/b32d14966b9be1396f2211d9eb743359708a07/vital-taal', |
| 117 | + 'refs/exps/a9/b32d14966b9be1396f2211d9eb743359708a07/whole-bout', |
| 118 | + 'refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/deism-bots', |
| 119 | + 'refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/inter-gulf', |
| 120 | + 'refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/known-flus', |
| 121 | + 'refs/exps/a9/d8057e088d46842f15c3b6d1bb2e4befd5f677/tight-lira', |
| 122 | + 'refs/exps/bf/6ca8a35911bc6e62fb9bcaa506d4f4e185450c/crumb-orcs' |
| 123 | + ]) |
| 124 | + expect(remoteExpShas).toStrictEqual( |
| 125 | + new Set([ |
| 126 | + '263e4408e42a0e215b0f70b36b2ab7b65a160d7e', |
| 127 | + 'd4f2a35773ead55b7ce4b596f600e98360e49372', |
| 128 | + '5af79e8d5e53f4e41221b6a166121d96d50b630a', |
| 129 | + '21745a4aa76daf59b49ec81480fe7a89c7ea8fb2', |
| 130 | + '390aef747f45fc49ec8928b24771f8950d057393', |
| 131 | + '142a803b83ff784ba1106cc4ad0ba03310da6186', |
| 132 | + '21ce298cd1743405a0d73f5cb4cf52289ffa3276' |
| 133 | + ]) |
| 134 | + ) |
| 135 | + }) |
| 136 | +}) |
0 commit comments