@neurodevs/meta-node 0.14.22 → 0.14.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/impl/GitAutocloner.test.d.ts +11 -0
- package/build/__tests__/impl/GitAutocloner.test.js +71 -6
- package/build/__tests__/impl/GitAutocloner.test.js.map +1 -1
- package/build/impl/GitAutocloner.d.ts +4 -3
- package/build/impl/GitAutocloner.js +14 -7
- package/build/impl/GitAutocloner.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/impl/GitAutocloner.test.ts +104 -8
- package/src/impl/GitAutocloner.ts +16 -7
|
@@ -7,6 +7,8 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
7
7
|
private static urlB;
|
|
8
8
|
private static generateUrl;
|
|
9
9
|
private static readonly urls;
|
|
10
|
+
private static get gitPullPackageA();
|
|
11
|
+
private static get gitPullPackageB();
|
|
10
12
|
protected static beforeEach(): Promise<void>;
|
|
11
13
|
protected static canCreateAutocloner(): Promise<void>;
|
|
12
14
|
protected static throwsIfDirPathDoesNotExist(): Promise<void>;
|
|
@@ -17,7 +19,16 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
17
19
|
protected static worksWithPeriodInRepoName(): Promise<void>;
|
|
18
20
|
protected static callsYarnInstallAfterCloningFirstRepo(): Promise<void>;
|
|
19
21
|
protected static callsYarnInstallAfterCloningSecondRepo(): Promise<void>;
|
|
22
|
+
protected static callsGitPullIfFirstRepoExists(): Promise<void>;
|
|
23
|
+
protected static callsGitPullIfSecondRepoExists(): Promise<void>;
|
|
24
|
+
protected static callsYarnInstallIfFirstChangesWerePulled(): Promise<void>;
|
|
25
|
+
protected static callsYarnInstallIfSecondChangesWerePulled(): Promise<void>;
|
|
26
|
+
protected static doesNotCallYarnInstallIfNoChangesPulled(): Promise<void>;
|
|
20
27
|
private static run;
|
|
28
|
+
private static setUrlsShouldExistAndRun;
|
|
29
|
+
private static setUrlsShouldExist;
|
|
30
|
+
private static fakeGitPullChanges;
|
|
31
|
+
private static fakeGitPullUpToDate;
|
|
21
32
|
private static setFakeChdir;
|
|
22
33
|
private static setFakeExec;
|
|
23
34
|
private static setFakePathExists;
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { exec as execSync } from 'child_process';
|
|
8
8
|
import { promisify } from 'util';
|
|
9
|
-
import { callsToChdir, callsToExec, fakeChdir, fakeExec, fakePathExists, resetCallsToChdir, resetCallsToExec, setPathShouldExist, } from '@neurodevs/fake-node-core';
|
|
9
|
+
import { callsToChdir, callsToExec, fakeChdir, fakeExec, fakePathExists, resetCallsToChdir, resetCallsToExec, setFakeExecResult, setPathShouldExist, } from '@neurodevs/fake-node-core';
|
|
10
10
|
import { test, assert } from '@neurodevs/node-tdd';
|
|
11
11
|
import GitAutocloner from '../../impl/GitAutocloner.js';
|
|
12
12
|
import AbstractPackageTest from '../AbstractPackageTest.js';
|
|
@@ -21,6 +21,12 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
21
21
|
return `https://github.com/${packageName}.git`;
|
|
22
22
|
}
|
|
23
23
|
static urls = [this.urlA, this.urlB];
|
|
24
|
+
static get gitPullPackageA() {
|
|
25
|
+
return `git --cwd ./${this.packageNameA} pull`;
|
|
26
|
+
}
|
|
27
|
+
static get gitPullPackageB() {
|
|
28
|
+
return `git --cwd ./${this.packageNameB} pull`;
|
|
29
|
+
}
|
|
24
30
|
static async beforeEach() {
|
|
25
31
|
await super.beforeEach();
|
|
26
32
|
this.setFakeChdir();
|
|
@@ -46,13 +52,10 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
46
52
|
});
|
|
47
53
|
}
|
|
48
54
|
static async doesNotCallGitCloneIfUrlExists() {
|
|
49
|
-
|
|
50
|
-
this.urls.forEach((url) => {
|
|
51
|
-
setPathShouldExist(url.match(this.regexForRepoName)[1], true);
|
|
52
|
-
});
|
|
55
|
+
this.setUrlsShouldExist();
|
|
53
56
|
resetCallsToExec();
|
|
54
57
|
await this.run();
|
|
55
|
-
assert.isLength(callsToExec, 0);
|
|
58
|
+
assert.isLength(callsToExec.filter((call) => call.startsWith('git clone')), 0);
|
|
56
59
|
}
|
|
57
60
|
static async throwsIfGitCloneFails() {
|
|
58
61
|
GitAutocloner.exec = (_command) => {
|
|
@@ -73,6 +76,29 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
73
76
|
await this.run();
|
|
74
77
|
assert.isEqualDeep(callsToExec[3], `yarn --cwd ./${this.packageNameB} install`, 'Should call yarn install after cloning second package!');
|
|
75
78
|
}
|
|
79
|
+
static async callsGitPullIfFirstRepoExists() {
|
|
80
|
+
await this.setUrlsShouldExistAndRun();
|
|
81
|
+
assert.isEqualDeep(callsToExec[0], this.gitPullPackageA, 'Should call git pull if first repo exists!');
|
|
82
|
+
}
|
|
83
|
+
static async callsGitPullIfSecondRepoExists() {
|
|
84
|
+
await this.setUrlsShouldExistAndRun();
|
|
85
|
+
assert.isEqualDeep(callsToExec[2], this.gitPullPackageB, 'Should call git pull if second repo exists!');
|
|
86
|
+
}
|
|
87
|
+
static async callsYarnInstallIfFirstChangesWerePulled() {
|
|
88
|
+
this.fakeGitPullChanges();
|
|
89
|
+
await this.setUrlsShouldExistAndRun();
|
|
90
|
+
assert.isEqualDeep(callsToExec[1], `yarn --cwd ./${this.packageNameA} install`, 'Should call yarn install after pulling first package!');
|
|
91
|
+
}
|
|
92
|
+
static async callsYarnInstallIfSecondChangesWerePulled() {
|
|
93
|
+
this.fakeGitPullChanges();
|
|
94
|
+
await this.setUrlsShouldExistAndRun();
|
|
95
|
+
assert.isEqualDeep(callsToExec[3], `yarn --cwd ./${this.packageNameB} install`, 'Should call yarn install after pulling second package!');
|
|
96
|
+
}
|
|
97
|
+
static async doesNotCallYarnInstallIfNoChangesPulled() {
|
|
98
|
+
this.fakeGitPullUpToDate();
|
|
99
|
+
await this.setUrlsShouldExistAndRun();
|
|
100
|
+
assert.isLength(callsToExec.filter((call) => call.startsWith('yarn --cwd ./')), 0, 'Should not call yarn install if no changes were pulled!');
|
|
101
|
+
}
|
|
76
102
|
static run(options) {
|
|
77
103
|
return this.instance.run({
|
|
78
104
|
urls: this.urls,
|
|
@@ -80,6 +106,30 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
80
106
|
...options,
|
|
81
107
|
});
|
|
82
108
|
}
|
|
109
|
+
static async setUrlsShouldExistAndRun() {
|
|
110
|
+
this.setUrlsShouldExist();
|
|
111
|
+
resetCallsToExec();
|
|
112
|
+
await this.run();
|
|
113
|
+
}
|
|
114
|
+
static setUrlsShouldExist() {
|
|
115
|
+
this.urls.forEach((url) => {
|
|
116
|
+
setPathShouldExist(url.match(this.regexForRepoName)[1], true);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
static fakeGitPullChanges() {
|
|
120
|
+
const fakeResult = {
|
|
121
|
+
stdout: this.generateId(),
|
|
122
|
+
};
|
|
123
|
+
setFakeExecResult(this.gitPullPackageA, fakeResult);
|
|
124
|
+
setFakeExecResult(this.gitPullPackageB, fakeResult);
|
|
125
|
+
}
|
|
126
|
+
static fakeGitPullUpToDate() {
|
|
127
|
+
const fakeResult = {
|
|
128
|
+
stdout: 'Already up to date.',
|
|
129
|
+
};
|
|
130
|
+
setFakeExecResult(this.gitPullPackageA, fakeResult);
|
|
131
|
+
setFakeExecResult(this.gitPullPackageB, fakeResult);
|
|
132
|
+
}
|
|
83
133
|
static setFakeChdir() {
|
|
84
134
|
GitAutocloner.chdir = fakeChdir;
|
|
85
135
|
resetCallsToChdir();
|
|
@@ -135,4 +185,19 @@ __decorate([
|
|
|
135
185
|
__decorate([
|
|
136
186
|
test()
|
|
137
187
|
], AutoclonerTest, "callsYarnInstallAfterCloningSecondRepo", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
test()
|
|
190
|
+
], AutoclonerTest, "callsGitPullIfFirstRepoExists", null);
|
|
191
|
+
__decorate([
|
|
192
|
+
test()
|
|
193
|
+
], AutoclonerTest, "callsGitPullIfSecondRepoExists", null);
|
|
194
|
+
__decorate([
|
|
195
|
+
test()
|
|
196
|
+
], AutoclonerTest, "callsYarnInstallIfFirstChangesWerePulled", null);
|
|
197
|
+
__decorate([
|
|
198
|
+
test()
|
|
199
|
+
], AutoclonerTest, "callsYarnInstallIfSecondChangesWerePulled", null);
|
|
200
|
+
__decorate([
|
|
201
|
+
test()
|
|
202
|
+
], AutoclonerTest, "doesNotCallYarnInstallIfNoChangesPulled", null);
|
|
138
203
|
//# sourceMappingURL=GitAutocloner.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitAutocloner.test.js","sourceRoot":"","sources":["../../../src/__tests__/impl/GitAutocloner.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GitAutocloner.test.js","sourceRoot":"","sources":["../../../src/__tests__/impl/GitAutocloner.test.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAgB,IAAI,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EACH,YAAY,EACZ,WAAW,EACX,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAGlD,OAAO,aAGN,MAAM,6BAA6B,CAAA;AACpC,OAAO,mBAAmB,MAAM,2BAA2B,CAAA;AAE3D,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAEhC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,mBAAmB;IACnD,MAAM,CAAC,QAAQ,CAAY;IAE3B,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA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ACpC,OAAO,8BAA8B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,mBAAmB,MAAM,CAAA;IACnG,CAAC;IAEO,MAAM,CAAU,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;IAChD,MAAM,CAAU,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;IAClD,MAAM,CAAU,mBAAmB,GAAG,uBAAuB,CAAA;IAC7D,MAAM,CAAU,gBAAgB,GAAG,0BAA0B,CAAA;IAE7D,MAAM,CAAC,aAAa;QACxB,OAAO,aAAa,CAAC,MAAM,EAAE,CAAA;IACjC,CAAC;;AA/NsB;IADtB,IAAI,EAAE;+CAGN;AAGsB;IADtB,IAAI,EAAE;uDAWN;AAGsB;IADtB,IAAI,EAAE;4DASN;AAGsB;IADtB,IAAI,EAAE;mDAON;AAGsB;IADtB,IAAI,EAAE;0DAWN;AAGsB;IADtB,IAAI,EAAE;iDAaN;AAGsB;IADtB,IAAI,EAAE;qDAIN;AAGsB;IADtB,IAAI,EAAE;iEASN;AAGsB;IADtB,IAAI,EAAE;kEASN;AAGsB;IADtB,IAAI,EAAE;yDASN;AAGsB;IADtB,IAAI,EAAE;0DASN;AAGsB;IADtB,IAAI,EAAE;oEAUN;AAGsB;IADtB,IAAI,EAAE;qEAUN;AAGsB;IADtB,IAAI,EAAE;mEAUN"}
|
|
@@ -16,9 +16,9 @@ export default class GitAutocloner implements Autocloner {
|
|
|
16
16
|
private throwIfDirPathDoesNotExist;
|
|
17
17
|
private checkIfDirPathExists;
|
|
18
18
|
private throwDirPathDoesNotExist;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
19
|
+
private chdirToDirPath;
|
|
20
|
+
private runForEachUrl;
|
|
21
|
+
private runCurrentUrl;
|
|
22
22
|
private checkIfCurrentRepoExists;
|
|
23
23
|
private get currentRepoName();
|
|
24
24
|
private readonly regexForRepoName;
|
|
@@ -26,6 +26,7 @@ export default class GitAutocloner implements Autocloner {
|
|
|
26
26
|
private throwGitCloneFailed;
|
|
27
27
|
private get gitCloneFailedMessage();
|
|
28
28
|
private runYarnInstall;
|
|
29
|
+
private runGitPull;
|
|
29
30
|
private get chdir();
|
|
30
31
|
private get exec();
|
|
31
32
|
private get pathExists();
|
|
@@ -21,8 +21,8 @@ export default class GitAutocloner {
|
|
|
21
21
|
this.urls = urls;
|
|
22
22
|
this.dirPath = dirPath;
|
|
23
23
|
await this.throwIfDirPathDoesNotExist();
|
|
24
|
-
this.
|
|
25
|
-
await this.
|
|
24
|
+
this.chdirToDirPath();
|
|
25
|
+
await this.runForEachUrl();
|
|
26
26
|
}
|
|
27
27
|
async throwIfDirPathDoesNotExist() {
|
|
28
28
|
const dirPathExists = await this.checkIfDirPathExists();
|
|
@@ -36,16 +36,16 @@ export default class GitAutocloner {
|
|
|
36
36
|
throwDirPathDoesNotExist() {
|
|
37
37
|
throw new Error(`dirPath does not exist: ${this.dirPath}!`);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
chdirToDirPath() {
|
|
40
40
|
this.chdir(this.dirPath);
|
|
41
41
|
}
|
|
42
|
-
async
|
|
42
|
+
async runForEachUrl() {
|
|
43
43
|
for (const url of this.urls) {
|
|
44
44
|
this.currentUrl = url;
|
|
45
|
-
await this.
|
|
45
|
+
await this.runCurrentUrl();
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
async
|
|
48
|
+
async runCurrentUrl() {
|
|
49
49
|
const currentRepoExists = await this.checkIfCurrentRepoExists();
|
|
50
50
|
if (!currentRepoExists) {
|
|
51
51
|
this.log.info(`Cloning repo: ${this.currentUrl}...`);
|
|
@@ -53,7 +53,11 @@ export default class GitAutocloner {
|
|
|
53
53
|
await this.runYarnInstall();
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
this.log.info(`Repo exists,
|
|
56
|
+
this.log.info(`Repo exists, pulling: ${this.currentRepoName}...`);
|
|
57
|
+
const { stdout } = await this.runGitPull();
|
|
58
|
+
if (!stdout.includes('Already up to date')) {
|
|
59
|
+
await this.runYarnInstall();
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
async checkIfCurrentRepoExists() {
|
|
@@ -81,6 +85,9 @@ export default class GitAutocloner {
|
|
|
81
85
|
async runYarnInstall() {
|
|
82
86
|
await this.exec(`yarn --cwd ./${this.currentRepoName} install`);
|
|
83
87
|
}
|
|
88
|
+
async runGitPull() {
|
|
89
|
+
return await this.exec(`git --cwd ./${this.currentRepoName} pull`);
|
|
90
|
+
}
|
|
84
91
|
get chdir() {
|
|
85
92
|
return GitAutocloner.chdir;
|
|
86
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitAutocloner.js","sourceRoot":"","sources":["../../src/impl/GitAutocloner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,aAAa;IACvB,MAAM,CAAC,KAAK,CAAwB;IACpC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,MAAM,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IACjC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAA;IAE7B,IAAI,CAAW;IACf,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,YAAY,CAAM;IAClB,GAAG,GAAG,OAAO,CAAA;IAErB,gBAAyB,CAAC;IAEnB,MAAM,CAAC,MAAM;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,CAAA;IACrC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,OAA0B;QACvC,MAAM,EAAE,IA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AA;IACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exec as execSync } from 'child_process'
|
|
1
|
+
import { ChildProcess, exec as execSync } from 'child_process'
|
|
2
2
|
import { promisify } from 'util'
|
|
3
3
|
import {
|
|
4
4
|
callsToChdir,
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
fakePathExists,
|
|
9
9
|
resetCallsToChdir,
|
|
10
10
|
resetCallsToExec,
|
|
11
|
+
setFakeExecResult,
|
|
11
12
|
setPathShouldExist,
|
|
12
13
|
} from '@neurodevs/fake-node-core'
|
|
13
14
|
import { test, assert } from '@neurodevs/node-tdd'
|
|
@@ -36,6 +37,14 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
36
37
|
|
|
37
38
|
private static readonly urls = [this.urlA, this.urlB]
|
|
38
39
|
|
|
40
|
+
private static get gitPullPackageA() {
|
|
41
|
+
return `git --cwd ./${this.packageNameA} pull`
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private static get gitPullPackageB() {
|
|
45
|
+
return `git --cwd ./${this.packageNameB} pull`
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
protected static async beforeEach() {
|
|
40
49
|
await super.beforeEach()
|
|
41
50
|
|
|
@@ -86,17 +95,15 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
86
95
|
|
|
87
96
|
@test()
|
|
88
97
|
protected static async doesNotCallGitCloneIfUrlExists() {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.urls.forEach((url) => {
|
|
92
|
-
setPathShouldExist(url.match(this.regexForRepoName)![1], true)
|
|
93
|
-
})
|
|
94
|
-
|
|
98
|
+
this.setUrlsShouldExist()
|
|
95
99
|
resetCallsToExec()
|
|
96
100
|
|
|
97
101
|
await this.run()
|
|
98
102
|
|
|
99
|
-
assert.isLength(
|
|
103
|
+
assert.isLength(
|
|
104
|
+
callsToExec.filter((call) => call.startsWith('git clone')),
|
|
105
|
+
0
|
|
106
|
+
)
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
@test()
|
|
@@ -142,6 +149,64 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
142
149
|
)
|
|
143
150
|
}
|
|
144
151
|
|
|
152
|
+
@test()
|
|
153
|
+
protected static async callsGitPullIfFirstRepoExists() {
|
|
154
|
+
await this.setUrlsShouldExistAndRun()
|
|
155
|
+
|
|
156
|
+
assert.isEqualDeep(
|
|
157
|
+
callsToExec[0],
|
|
158
|
+
this.gitPullPackageA,
|
|
159
|
+
'Should call git pull if first repo exists!'
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@test()
|
|
164
|
+
protected static async callsGitPullIfSecondRepoExists() {
|
|
165
|
+
await this.setUrlsShouldExistAndRun()
|
|
166
|
+
|
|
167
|
+
assert.isEqualDeep(
|
|
168
|
+
callsToExec[2],
|
|
169
|
+
this.gitPullPackageB,
|
|
170
|
+
'Should call git pull if second repo exists!'
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@test()
|
|
175
|
+
protected static async callsYarnInstallIfFirstChangesWerePulled() {
|
|
176
|
+
this.fakeGitPullChanges()
|
|
177
|
+
await this.setUrlsShouldExistAndRun()
|
|
178
|
+
|
|
179
|
+
assert.isEqualDeep(
|
|
180
|
+
callsToExec[1],
|
|
181
|
+
`yarn --cwd ./${this.packageNameA} install`,
|
|
182
|
+
'Should call yarn install after pulling first package!'
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@test()
|
|
187
|
+
protected static async callsYarnInstallIfSecondChangesWerePulled() {
|
|
188
|
+
this.fakeGitPullChanges()
|
|
189
|
+
await this.setUrlsShouldExistAndRun()
|
|
190
|
+
|
|
191
|
+
assert.isEqualDeep(
|
|
192
|
+
callsToExec[3],
|
|
193
|
+
`yarn --cwd ./${this.packageNameB} install`,
|
|
194
|
+
'Should call yarn install after pulling second package!'
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@test()
|
|
199
|
+
protected static async doesNotCallYarnInstallIfNoChangesPulled() {
|
|
200
|
+
this.fakeGitPullUpToDate()
|
|
201
|
+
await this.setUrlsShouldExistAndRun()
|
|
202
|
+
|
|
203
|
+
assert.isLength(
|
|
204
|
+
callsToExec.filter((call) => call.startsWith('yarn --cwd ./')),
|
|
205
|
+
0,
|
|
206
|
+
'Should not call yarn install if no changes were pulled!'
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
145
210
|
private static run(options?: Partial<AutoclonerOptions>) {
|
|
146
211
|
return this.instance.run({
|
|
147
212
|
urls: this.urls,
|
|
@@ -150,6 +215,37 @@ export default class AutoclonerTest extends AbstractPackageTest {
|
|
|
150
215
|
})
|
|
151
216
|
}
|
|
152
217
|
|
|
218
|
+
private static async setUrlsShouldExistAndRun() {
|
|
219
|
+
this.setUrlsShouldExist()
|
|
220
|
+
resetCallsToExec()
|
|
221
|
+
|
|
222
|
+
await this.run()
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private static setUrlsShouldExist() {
|
|
226
|
+
this.urls.forEach((url) => {
|
|
227
|
+
setPathShouldExist(url.match(this.regexForRepoName)![1], true)
|
|
228
|
+
})
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
private static fakeGitPullChanges() {
|
|
232
|
+
const fakeResult = {
|
|
233
|
+
stdout: this.generateId(),
|
|
234
|
+
} as unknown as ChildProcess
|
|
235
|
+
|
|
236
|
+
setFakeExecResult(this.gitPullPackageA, fakeResult)
|
|
237
|
+
setFakeExecResult(this.gitPullPackageB, fakeResult)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
private static fakeGitPullUpToDate() {
|
|
241
|
+
const fakeResult = {
|
|
242
|
+
stdout: 'Already up to date.',
|
|
243
|
+
} as unknown as ChildProcess
|
|
244
|
+
|
|
245
|
+
setFakeExecResult(this.gitPullPackageA, fakeResult)
|
|
246
|
+
setFakeExecResult(this.gitPullPackageB, fakeResult)
|
|
247
|
+
}
|
|
248
|
+
|
|
153
249
|
private static setFakeChdir() {
|
|
154
250
|
GitAutocloner.chdir = fakeChdir
|
|
155
251
|
resetCallsToChdir()
|
|
@@ -28,9 +28,9 @@ export default class GitAutocloner implements Autocloner {
|
|
|
28
28
|
this.dirPath = dirPath
|
|
29
29
|
|
|
30
30
|
await this.throwIfDirPathDoesNotExist()
|
|
31
|
+
this.chdirToDirPath()
|
|
31
32
|
|
|
32
|
-
this.
|
|
33
|
-
await this.cloneReposFromUrls()
|
|
33
|
+
await this.runForEachUrl()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
private async throwIfDirPathDoesNotExist() {
|
|
@@ -49,18 +49,18 @@ export default class GitAutocloner implements Autocloner {
|
|
|
49
49
|
throw new Error(`dirPath does not exist: ${this.dirPath}!`)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
private
|
|
52
|
+
private chdirToDirPath() {
|
|
53
53
|
this.chdir(this.dirPath)
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
private async
|
|
56
|
+
private async runForEachUrl() {
|
|
57
57
|
for (const url of this.urls) {
|
|
58
58
|
this.currentUrl = url
|
|
59
|
-
await this.
|
|
59
|
+
await this.runCurrentUrl()
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
private async
|
|
63
|
+
private async runCurrentUrl() {
|
|
64
64
|
const currentRepoExists = await this.checkIfCurrentRepoExists()
|
|
65
65
|
|
|
66
66
|
if (!currentRepoExists) {
|
|
@@ -68,7 +68,12 @@ export default class GitAutocloner implements Autocloner {
|
|
|
68
68
|
await this.tryToCloneRepo()
|
|
69
69
|
await this.runYarnInstall()
|
|
70
70
|
} else {
|
|
71
|
-
this.log.info(`Repo exists,
|
|
71
|
+
this.log.info(`Repo exists, pulling: ${this.currentRepoName}...`)
|
|
72
|
+
const { stdout } = await this.runGitPull()
|
|
73
|
+
|
|
74
|
+
if (!stdout.includes('Already up to date')) {
|
|
75
|
+
await this.runYarnInstall()
|
|
76
|
+
}
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
79
|
|
|
@@ -103,6 +108,10 @@ export default class GitAutocloner implements Autocloner {
|
|
|
103
108
|
await this.exec(`yarn --cwd ./${this.currentRepoName} install`)
|
|
104
109
|
}
|
|
105
110
|
|
|
111
|
+
private async runGitPull() {
|
|
112
|
+
return await this.exec(`git --cwd ./${this.currentRepoName} pull`)
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
private get chdir() {
|
|
107
116
|
return GitAutocloner.chdir
|
|
108
117
|
}
|