Skip to content

Commit 6a18680

Browse files
Fix e2e test driver to use new base-toolchain path
1 parent db2ff2a commit 6a18680

File tree

2 files changed

+55
-4
lines changed

2 files changed

+55
-4
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ jobs:
265265
if: ${{ matrix.run_e2e_test }}
266266
run: |
267267
docker exec swiftwasm-ci-buildbot /bin/bash -lc \
268-
"./llvm-project/llvm/utils/lit/lit.py \
269-
--param swift-sdk=wasm32-unknown-wasi \
270-
--param swift-sdks-path=./swift-sdk-generator/Bundles \
271-
--param scheme=${{ matrix.scheme }} ./swiftwasm-build/test -vv"
268+
"./swiftwasm-build/tools/build/run-e2e-test --scheme ${{ matrix.scheme }}"
272269
273270
- name: Cleanup docker volume
274271
if: ${{ matrix.container != null }}

tools/build/run-e2e-test

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
import argparse
5+
import pathlib
6+
import subprocess
7+
import os
8+
from build_support.actions import derive_options_from_args, REPO_ROOT, DownloadBaseSnapshotAction
9+
10+
11+
def main():
12+
parser = argparse.ArgumentParser(
13+
description='Run e2e integration tests for Swift SDK')
14+
parser.add_argument('--swift-sdk', default='wasm32-unknown-wasi',
15+
help='Swift SDK identifier (default: wasm32-unknown-wasi)')
16+
parser.add_argument('args', nargs=argparse.REMAINDER,
17+
help='Extra arguments to pass to lit.py')
18+
options = derive_options_from_args(sys.argv[1:], parser)
19+
20+
extra_lit_args = options.args
21+
if len(extra_lit_args) > 0 and extra_lit_args[0] == "--":
22+
extra_lit_args = extra_lit_args[1:]
23+
24+
repo_path = pathlib.Path(REPO_ROOT)
25+
base_toolchain_path = DownloadBaseSnapshotAction.toolchain_path(options)
26+
lit_py_path = repo_path.parent / "llvm-project" / "llvm" / "utils" / "lit" / "lit.py"
27+
swift_sdks_path = repo_path.parent / "swift-sdk-generator" / "Bundles"
28+
29+
# Build lit command
30+
lit_cmd = [
31+
str(lit_py_path),
32+
"--param", f"swift-sdk={options.swift_sdk}",
33+
"--param", f"scheme={options.scheme}",
34+
"--param", f"base-toolchain-path={base_toolchain_path}",
35+
"--param", f"swift-sdks-path={swift_sdks_path}",
36+
]
37+
test_dir = repo_path / "test"
38+
lit_cmd.append(str(test_dir))
39+
lit_cmd.extend(extra_lit_args)
40+
41+
print("=====> Running e2e integration tests")
42+
print(f"Command: {' '.join(lit_cmd)}")
43+
44+
# Run the tests
45+
try:
46+
subprocess.check_call(lit_cmd)
47+
print("=====> e2e tests completed successfully")
48+
except subprocess.CalledProcessError as e:
49+
print(f"=====> e2e tests failed with exit code {e.returncode}")
50+
sys.exit(e.returncode)
51+
52+
53+
if __name__ == '__main__':
54+
main()

0 commit comments

Comments
 (0)