Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ jobs:
executor: focal
environment:
EMTEST_LACKS_WEBGPU: "1"
EMTEST_VISUALIZE: "1"
steps:
- run-tests-chrome:
title: "browser64"
Expand All @@ -1123,6 +1124,9 @@ jobs:
browser64.test_pthread_asan*
browser64.test_webgl_multi_draw*
browser64.test_pthread_growth*"
- run:
name: Check profile
command: file -E out/graph.html
test-browser-chrome-2gb:
executor: focal
environment:
Expand Down
7 changes: 4 additions & 3 deletions test/parallel_testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from tools.colored_logger import CYAN, GREEN, RED, with_color
from tools.utils import WINDOWS

EMTEST_VISUALIZE = os.getenv('EMTEST_VISUALIZE')
NUM_CORES = None
seen_class = set()
torn_down = False
Expand Down Expand Up @@ -270,7 +271,7 @@ def combine_results(self, result, buffered_results):
r.updateResult(result)

# Generate the parallel test run visualization
if os.getenv('EMTEST_VISUALIZE'):
if EMTEST_VISUALIZE:
emprofile.create_profiling_graph(utils.path_from_root('out/graph'))
# Cleanup temp files that were used for the visualization
emprofile.delete_profiler_logs()
Expand Down Expand Up @@ -309,7 +310,7 @@ def updateResult(self, result):
self.log_test_run_for_visualization()

def log_test_run_for_visualization(self):
if os.getenv('EMTEST_VISUALIZE') and (self.test_result != 'skipped' or self.test_duration > 0.2):
if EMTEST_VISUALIZE and (self.test_result != 'skipped' or self.test_duration > 0.2):
profiler_logs_path = os.path.join(tempfile.gettempdir(), 'emscripten_toolchain_profiler_logs')
os.makedirs(profiler_logs_path, exist_ok=True)
profiler_log_file = os.path.join(profiler_logs_path, 'toolchain_profiler.pid_0.json')
Expand All @@ -326,7 +327,7 @@ def log_test_run_for_visualization(self):
# block, so generate one on the fly.
dummy_test_task_counter = os.path.getsize(profiler_log_file) if os.path.isfile(profiler_log_file) else 0
# Remove the redundant 'test_' prefix from each test, since character space is at a premium in the visualized graph.
test_name = self.test_short_name().removeprefix('test_')
test_name = utils.removeprefix(self.test_short_name(), 'test_')
with open(profiler_log_file, 'a') as prof:
prof.write(f',\n{{"pid":{dummy_test_task_counter},"op":"start","time":{self.start_time},"cmdLine":["{test_name}"],"color":"{colors[self.test_result]}"}}')
prof.write(f',\n{{"pid":{dummy_test_task_counter},"op":"exit","time":{self.start_time + self.test_duration},"returncode":0}}')
Expand Down