Skip to content

Commit a35785f

Browse files
feat(test_downstream_projects): support testing of branches. Do not revert changes after running tests to improve debugging of failed runs
1 parent 75ce2fe commit a35785f

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

publish_yalc_package.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function publishYalcPackage(installTargetDir, installSource, flags) {
4545
if (isRemoteSource) {
4646
process.chdir(installTargetDir);
4747
util._exec('git fetch origin');
48+
util._exec(`git checkout ${branch}`);
4849
util._exec(`git reset --hard ${branch}`);
4950
util._exec('git clean --force -d');
5051
} else {

test_downstream_projects.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ function runTests() {
141141
util._exec(`npm test`);
142142
}
143143

144-
function revertLocalChanges(source) {
145-
const isRemoteSource = source[0] !== '.';
146-
const ref = isRemoteSource ? 'origin/master' : 'master';
147-
util._exec(`git reset --hard ${ref}`);
148-
util._exec('git clean --force -d');
149-
}
150-
151144
function fetchDownstreamProjects(downstreamConfig, prefix, downstreamTreeNode) {
152145
prefix = prefix || "";
153146

@@ -236,9 +229,6 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
236229
successLog.push(name);
237230
runningTestsFor = undefined;
238231

239-
console.log(` ===> '${name}': Reverting working copy <===`);
240-
revertLocalChanges(downstreamTreeNode.installSource);
241-
242232
foldEnd();
243233

244234
const downstreamChildren = Object.keys(downstreamTreeNode.children || {});

0 commit comments

Comments
 (0)