Skip to content

Commit a24b5a1

Browse files
committedJan 17, 2023
Bug 1806681 - [puppeteer] Make "mach puppeteer-test" clean up before setting up puppeteer. r=webdriver-reviewers,jdescottes,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D166650
1 parent 30127ae commit a24b5a1

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed
 

‎remote/mach_commands.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -674,22 +674,20 @@ def puppeteer_test(
674674
def install_puppeteer(command_context, product, ci):
675675
setup()
676676
env = {"HUSKY": "0"}
677-
from mozversioncontrol import get_repository_object
678677

679-
repo = get_repository_object(command_context.topsrcdir)
680678
puppeteer_dir = os.path.join("remote", "test", "puppeteer")
681-
changed_files = False
682-
for f in repo.get_changed_files():
683-
if f.startswith(puppeteer_dir) and f.endswith(".ts"):
684-
changed_files = True
685-
break
686679

687680
if product != "chrome":
688681
env["PUPPETEER_SKIP_DOWNLOAD"] = "1"
689-
lib_dir = os.path.join(command_context.topsrcdir, puppeteer_dir, "lib")
690-
if changed_files and os.path.isdir(lib_dir):
691-
# clobber lib to force `tsc compile` step
692-
shutil.rmtree(lib_dir)
682+
683+
if not ci:
684+
npm(
685+
"run",
686+
"clean",
687+
cwd=os.path.join(command_context.topsrcdir, puppeteer_dir),
688+
env=env,
689+
exit_on_fail=False,
690+
)
693691

694692
command = "ci" if ci else "install"
695693
npm(command, cwd=os.path.join(command_context.topsrcdir, puppeteer_dir), env=env)

0 commit comments

Comments
 (0)
Failed to load comments.