Bug 1949205 - Create artifacts directory if it doesn't exist. r=perftest-reviewers,afinder
This patch ensures that the artifacts directory gets created if it doesn't exist when running mach perftest locally. It also adds a check for the existence of the output directory during mochitest gecko profiling. At the same time, the aritfacts folder is added to the hg/git ignore files. Differential Revision: https://phabricator.services.mozilla.com/D238791
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -359,3 +359,6 @@ media/libvpx/config/**/config.log
|
|||||||
|
|
||||||
# Ignore generated files resulting from building the minidump analyzer tests.
|
# Ignore generated files resulting from building the minidump analyzer tests.
|
||||||
toolkit/crashreporter/minidump-analyzer/analyzer-test/target/
|
toolkit/crashreporter/minidump-analyzer/analyzer-test/target/
|
||||||
|
|
||||||
|
# Ignore mozperftest artifacts folder
|
||||||
|
/artifacts/
|
||||||
|
|||||||
@@ -359,3 +359,6 @@ toolkit/themes/shared/design-system/node_modules/
|
|||||||
|
|
||||||
# Ignore generated files resulting from building the minidump analyzer tests.
|
# Ignore generated files resulting from building the minidump analyzer tests.
|
||||||
^toolkit/crashreporter/minidump-analyzer/analyzer-test/target/
|
^toolkit/crashreporter/minidump-analyzer/analyzer-test/target/
|
||||||
|
|
||||||
|
# Ignore mozperftest artifacts folder
|
||||||
|
^artifacts/
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
@@ -88,6 +89,10 @@ def run_perftest(command_context, **kwargs):
|
|||||||
print("\nSorry no support yet for multiple local perftest")
|
print("\nSorry no support yet for multiple local perftest")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Make sure the default artifacts directory exists
|
||||||
|
default_artifact_location = pathlib.Path(command_context.topsrcdir, "artifacts")
|
||||||
|
default_artifact_location.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
sel = "\n".join(kwargs["tests"])
|
sel = "\n".join(kwargs["tests"])
|
||||||
print("\nGood job! Best selection.\n%s" % sel)
|
print("\nGood job! Best selection.\n%s" % sel)
|
||||||
# if the script is xpcshell, we can force the flavor here
|
# if the script is xpcshell, we can force the flavor here
|
||||||
|
|||||||
@@ -156,9 +156,11 @@ class Mochitest(Layer):
|
|||||||
# Setup where the profile gets saved to so it doesn't get deleted
|
# Setup where the profile gets saved to so it doesn't get deleted
|
||||||
profile_path = os.getenv("MOZ_PROFILER_SHUTDOWN")
|
profile_path = os.getenv("MOZ_PROFILER_SHUTDOWN")
|
||||||
if not profile_path:
|
if not profile_path:
|
||||||
profile_path = (
|
output_dir = Path(self.get_arg("output"))
|
||||||
Path(self.get_arg("output")) / "profile_mochitest.json"
|
if not output_dir.is_absolute():
|
||||||
)
|
output_dir = Path(self.topsrcdir, output_dir)
|
||||||
|
output_dir.resolve().mkdir(parents=True, exist_ok=True)
|
||||||
|
profile_path = output_dir / "profile_mochitest.json"
|
||||||
os.environ["MOZ_PROFILER_SHUTDOWN"] = str(profile_path)
|
os.environ["MOZ_PROFILER_SHUTDOWN"] = str(profile_path)
|
||||||
self.info(f"Profile will be saved to: {profile_path}")
|
self.info(f"Profile will be saved to: {profile_path}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user