Handle nonmaster branches in user suite tests (#48128)

* Handle nonmaster branches in user suite tests

* Fix remaining changed default branches, vscode & vue-next docker install scripts

* NPM reformats these on install now, comitting so it doesnt need to be ignored

* Accept current user suite baselines

* Fix many trivially fixable user suite tests
This commit is contained in:
Wesley Wigham
2022-03-09 10:31:16 -08:00
committed by GitHub
parent 918f0ef404
commit c70be8b501
44 changed files with 1991 additions and 8811 deletions

View File

@@ -12,6 +12,7 @@ namespace Harness {
interface UserConfig {
types: string[];
cloneUrl: string;
branch?: string;
path?: string;
}
@@ -56,9 +57,10 @@ namespace Harness {
ts.Debug.assert(!!config.cloneUrl, "Bad format from test.json: cloneUrl field must be present.");
const submoduleDir = path.join(cwd, directoryName);
if (!fs.existsSync(submoduleDir)) {
exec("git", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
exec("git", ["--work-tree", submoduleDir, "clone", "-b", config.branch || "master", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
}
else {
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "checkout", config.branch || "master"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "reset", "HEAD", "--hard"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "-f"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull", "-f"], { cwd: submoduleDir });