-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scheduled data status cli output test
- Loading branch information
1 parent
6eeeacd
commit eac5b10
Showing
4 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { join, sep } from 'path' | ||
import { describe, it, suite } from 'mocha' | ||
import { expect } from 'chai' | ||
import { TEMP_DIR } from './constants' | ||
import { cliReader, initializeDemoRepo, initializeEmptyRepo } from './util' | ||
import { dvcDemoPath } from '../util' | ||
|
||
suite('data status --with-dirs --granular --unchanged --show-json', () => { | ||
describe('Demo Repository', () => { | ||
it('should return the expected output', async () => { | ||
await initializeDemoRepo() | ||
|
||
const output = await cliReader.dataStatus(dvcDemoPath) | ||
|
||
const demoRepoTrackedData = [ | ||
join('data', 'MNIST', 'raw') + sep, | ||
join('data', 'MNIST', 'raw', 't10k-images-idx3-ubyte.gz'), | ||
join('data', 'MNIST', 'raw', 't10k-images-idx3-ubyte'), | ||
join('data', 'MNIST', 'raw', 't10k-labels-idx1-ubyte.gz'), | ||
join('data', 'MNIST', 'raw', 't10k-labels-idx1-ubyte'), | ||
join('data', 'MNIST', 'raw', 'train-images-idx3-ubyte.gz'), | ||
join('data', 'MNIST', 'raw', 'train-images-idx3-ubyte'), | ||
join('data', 'MNIST', 'raw', 'train-labels-idx1-ubyte.gz'), | ||
join('data', 'MNIST', 'raw', 'train-labels-idx1-ubyte'), | ||
'misclassified.jpg', | ||
'model.pt', | ||
'predictions.json', | ||
'training_metrics' + sep, | ||
join('training_metrics', 'scalars', 'acc.tsv'), | ||
join('training_metrics', 'scalars', 'loss.tsv') | ||
].sort() | ||
|
||
const collectedPaths = [ | ||
...(output.committed?.modified || []), | ||
...(output.unchanged || []) | ||
].sort() | ||
|
||
expect( | ||
collectedPaths, | ||
'all expected paths are either unchanged or committed modified after pulling' | ||
).to.deep.equal(demoRepoTrackedData) | ||
expect( | ||
output.not_in_cache, | ||
'not in cache should be undefined after after pulling' | ||
).to.be.undefined | ||
expect(output.committed?.added).to.be.undefined | ||
expect(output.committed?.deleted).to.be.undefined | ||
expect(output.committed?.renamed).to.be.undefined | ||
expect(output.uncommitted?.added).to.be.undefined | ||
expect(output.uncommitted?.deleted).to.be.undefined | ||
expect(output.uncommitted?.modified).to.be.undefined | ||
expect(output.uncommitted?.renamed).to.be.undefined | ||
}) | ||
}) | ||
|
||
describe('Empty Repository', () => { | ||
it('should return the expected output', async () => { | ||
await initializeEmptyRepo() | ||
const output = await cliReader.dataStatus(TEMP_DIR) | ||
|
||
expect(output).to.deep.equal({}) | ||
}) | ||
}) | ||
}) |