Skip to content

Commit

Permalink
Add web-tooling-benchmark test
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 committed Dec 11, 2023
1 parent 93d4648 commit bb63b66
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/es-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tc: ['octane', 'v8 chakracore spidermonkey', 'jetstream-only-simple-parallel-1', 'jetstream-only-simple-parallel-2 jsc-stress', 'jetstream-only-simple-parallel-3 jetstream-only-cdjs']
tc: ['new-es octane', 'v8 chakracore spidermonkey', 'jetstream-only-simple-parallel-1', 'jetstream-only-simple-parallel-2 jsc-stress', 'jetstream-only-simple-parallel-3 jetstream-only-cdjs']
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
tc: ['new-es octane v8', 'chakracore spidermonkey']
tc: ['new-es octane v8', 'chakracore spidermonkey web-tooling-benchmark']
build_opt: ['', '-DESCARGOT_THREADING=ON -DESCARGOT_TCO=ON', '-DESCARGOT_SMALL_CONFIG=ON -DESCARGOT_USE_CUSTOM_LOGGING=ON']
exclude:
# exclude octane, v8 due to low performance incurred by SMALL_CONFIG
Expand Down Expand Up @@ -515,6 +515,8 @@ jobs:
$RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/codecache/x86/escargot" new-es
$RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/codecache/x86/escargot" octane-loading
$RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/codecache/x86/escargot" octane-loading
$RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/codecache/x86/escargot" web-tooling-benchmark
$RUNNER --arch=x86 --engine="$GITHUB_WORKSPACE/out/codecache/x86/escargot" web-tooling-benchmark
rm -rf $HOME/Escargot-cache/
- name: Run x64 test
run: |
Expand All @@ -524,6 +526,8 @@ jobs:
$RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/codecache/x64/escargot" new-es
$RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/codecache/x64/escargot" octane-loading
$RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/codecache/x64/escargot" octane-loading
$RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/codecache/x64/escargot" web-tooling-benchmark
$RUNNER --arch=x86_64 --engine="$GITHUB_WORKSPACE/out/codecache/x64/escargot" web-tooling-benchmark
rm -rf $HOME/Escargot-cache/
- name: Handle error cases
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@
path = third_party/walrus
url = https://github.com/Samsung/walrus.git
ignore = untracked
[submodule "test/web-tooling-benchmark"]
path = test/web-tooling-benchmark
url = https://github.com/v8/web-tooling-benchmark
1 change: 1 addition & 0 deletions test/web-tooling-benchmark
Submodule web-tooling-benchmark added at 4a1282
38 changes: 36 additions & 2 deletions tools/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def run_escargot_debugger(engine, arch, extra_arg):
ESCARGOT_DEBUGGER_TESTER = join(PROJECT_SOURCE_DIR, 'tools', 'debugger', 'debugger_tester.sh')
print('Running Escargot-Debugger-Server-Source test:')
fails = 0
proc = Popen(['chmod', '+x', ESCARGOT_DEBUGGER_TESTER],stdout=PIPE)
proc = Popen(['chmod', '+x', ESCARGOT_DEBUGGER_TESTER], stdout=PIPE)
for files in os.listdir(ESCARGOT_DEBUGGER_TEST_DIR):
if files.endswith(".cmd"):
test_case, _ = os.path.splitext(files)
Expand All @@ -902,7 +902,7 @@ def run_escargot_debugger2(engine, arch, extra_arg):
ESCARGOT_DEBUGGER_TESTER = join(PROJECT_SOURCE_DIR, 'tools', 'debugger', 'debugger_tester.sh')
print('Running Escargot-Debugger-Client-Source test:')
fails = 0
proc = Popen(['chmod', '+x', ESCARGOT_DEBUGGER_TESTER],stdout=PIPE)
proc = Popen(['chmod', '+x', ESCARGOT_DEBUGGER_TESTER], stdout=PIPE)
for files in os.listdir(ESCARGOT_DEBUGGER_TEST_DIR):
if files.endswith(".cmd"):
test_case, _ = os.path.splitext(files)
Expand All @@ -917,6 +917,40 @@ def run_escargot_debugger2(engine, arch, extra_arg):
if fails > 0:
raise Exception('Escargot-Debugger-Client-Source tests failed')

@runner('web-tooling-benchmark', default=False)
def run_web_tooling_benchmark(engine, arch, extra_arg):
WEB_TOOLING_DIR = join(PROJECT_SOURCE_DIR, 'test', 'web-tooling-benchmark')
WEB_TOOLING_SRC_DIR = join(WEB_TOOLING_DIR, 'src')

lock_file = join(WEB_TOOLING_DIR, 'package-lock.json')
with open(lock_file, "r") as f:
lines = f.readlines()
with open(lock_file, "w") as f:
for line in lines:
f.write(re.sub(r'"lockfileVersion": 1', '"lockfileVersion": 2', line))

suite_file = join(WEB_TOOLING_SRC_DIR, 'suite.js')
with open(suite_file, "r") as f:
lines = f.readlines()
with open(suite_file, "w") as f:
for line in lines:
# minimize sample count to 1
f.write(re.sub(r'minSamples: 20', 'minSamples: 1', line))

flag_file = join(WEB_TOOLING_SRC_DIR, 'cli-flags-helper.js')
with open(flag_file, "r") as f:
lines = f.readlines()
with open(flag_file, "w") as f:
for line in lines:
# exclude long running tests
if "babel" not in line and "babylon" not in line and "chai" not in line:
f.write(line)

proc = Popen(['npm', 'install'], cwd=WEB_TOOLING_DIR, stdout=PIPE)
proc.wait()

run([engine, 'dist/cli.js'], cwd=WEB_TOOLING_DIR)

@runner('dump-all', default=False)
def run_dump_all(engine, arch, extra_arg):
for test in RUNNERS:
Expand Down

0 comments on commit bb63b66

Please sign in to comment.