store test repos as archives

This commit is contained in:
oleg 2015-07-14 01:09:14 +03:00
parent 9d3b69a474
commit 40933ca1d7
27 changed files with 23 additions and 28 deletions

View File

@ -11,7 +11,5 @@ notify:
console:
steps:
- cmd: sleep 2
- cmd: >
cd ../../../../ &&
npm test
- cmd: npm install && npm prune
- cmd: npm test

@ -1 +0,0 @@
Subproject commit 39245d9b93bcd2a0c6708d483b83c98a7bff1d3e

BIN
test/repos/git.tar.gz Normal file

Binary file not shown.

BIN
test/repos/mercurial.tar.gz Normal file

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
2ff4bec8b4ccc89af0bcabc0710713573078ebdb 3
2ff4bec8b4ccc89af0bcabc0710713573078ebdb default

View File

@ -1,5 +0,0 @@
3 2ff4bec8b4ccc89af0bcabc0710713573078ebdb 8354ec217ac72171221f831e40a640e499e0f246
da2762e71e87935198a25b0fceab0a364ad2e6d7 zero revision
9d7d08445f4ce095c22a98a902a391973cf07f37 second revision
9d7d08445f4ce095c22a98a902a391973cf07f37 release 0.1.0

Binary file not shown.

View File

@ -1 +0,0 @@
temporary amend commit for 6e9e54ed42ff

View File

@ -1,4 +0,0 @@
dotencode
fncache
revlogv1
store

View File

@ -1,4 +0,0 @@
data/.hgtags.i
data/rev0.txt.i
data/rev1.txt.i
data/rev2.txt.i

View File

@ -1 +0,0 @@
1 da2762e71e87935198a25b0fceab0a364ad2e6d7

View File

@ -1,3 +0,0 @@
da2762e71e87935198a25b0fceab0a364ad2e6d7 zero revision
9d7d08445f4ce095c22a98a902a391973cf07f37 second revision
9d7d08445f4ce095c22a98a902a391973cf07f37 release 0.1.0

View File

View File

View File

@ -19,12 +19,31 @@ var getTestData = function(type) {
describe(type, function() {
var data = getTestData(type),
repositoryName = 'test-repository',
repositoryPath = path.join(path.join(__dirname, 'repos'), repositoryName);
repositoryPath = path.join(
path.join(__dirname, 'repos'), repositoryName
),
originalRepositoryPath = path.join(__dirname, 'repos', type);
function rmdir(dir, callback) {
new SpawnCommand().run({cmd: 'rm', args: ['-R', dir]}, callback);
}
it('remove original repository dir if it exists', function(done) {
if (fs.exists(originalRepositoryPath, function(isExists) {
if (isExists) {
rmdir(originalRepositoryPath, done);
} else {
done();
}
}));
});
it('unpack original repository', function(done) {
new SpawnCommand().run({cmd: 'tar', args: [
'-xvf', type + '.tar.gz'
], options: {cwd: path.join(__dirname, 'repos')}}, done);
});
it('remove test repository dir if it exists', function(done) {
if (fs.exists(repositoryPath, function(isExists) {
if (isExists) {
@ -40,7 +59,7 @@ var getTestData = function(type) {
it('create scm instance attached to new repository without errors', function() {
scm = createScm({
type: type,
repository: path.join(__dirname, 'repos', type)
repository: originalRepositoryPath
});
});