Skip to content

Commit 07550f3

Browse files
committed
update smoke test
1 parent 2d47bca commit 07550f3

File tree

5 files changed

+37
-124
lines changed

5 files changed

+37
-124
lines changed

.ci/scripts/gather_test_models.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import itertools
99
import json
1010
import os
11+
import sys
1112
from typing import Any
1213

1314
from examples.models import MODEL_NAME_TO_MODEL
@@ -54,6 +55,12 @@ def parse_args() -> Any:
5455
from argparse import ArgumentParser
5556

5657
parser = ArgumentParser("Gather all models to test on CI for the target OS")
58+
parser.add_argument(
59+
"--json",
60+
action="store_true",
61+
default=False,
62+
help="output json",
63+
)
5764
parser.add_argument(
5865
"--target-os",
5966
type=str,
@@ -176,7 +183,10 @@ def export_models_for_ci() -> dict[str, dict]:
176183

177184
models["include"].append(record)
178185

179-
set_output("models", json.dumps(models))
186+
if args.json:
187+
print(json.dumps(models))
188+
else:
189+
set_output("models", json.dumps(models))
180190

181191

182192
if __name__ == "__main__":

.github/workflows/build-wheels-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- repository: pytorch/executorch
4242
pre-script: build/packaging/pre_build_script.sh
4343
post-script: build/packaging/post_build_script.sh
44-
smoke-test-script: build/packaging/smoke_test.py
44+
smoke-test-script: build/util/packaging/wheel_test.sh
4545
package-name: executorch
4646
name: ${{ matrix.repository }}
4747
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main

.github/workflows/build-wheels-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- repository: pytorch/executorch
4242
pre-script: build/packaging/pre_build_script.sh
4343
post-script: build/packaging/post_build_script.sh
44-
smoke-test-script: build/packaging/smoke_test.py
44+
smoke-test-script: build/util/packaging/wheel_test.sh
4545
package-name: executorch
4646
name: ${{ matrix.repository }}
4747
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main

build/packaging/smoke_test.py

Lines changed: 0 additions & 121 deletions
This file was deleted.

build/util/packaging/wheel_test.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -euxo pipefail
9+
10+
_repo_root_dir=$(git rev-parse --show-toplevel)
11+
export PYTHONPATH=${_repo_root_dir}
12+
13+
# Event refers to the type of models that will be downloaded. "pull_request"
14+
# uses higher priority and fast models.
15+
_models=$(python .ci/scripts/gather_test_models.py --event pull_request --json)
16+
17+
echo "${_models}" | jq -c '.include[]' | while read model; do
18+
_model_name=$(echo "$model" | jq -r '.model')
19+
_build_tool=$(echo "$model" | jq -r '.["build-tool"]')
20+
_backend=$(echo "$model" | jq -r '.backend')
21+
_demo_backend_delegation=$(echo "$model" | jq -r '.demo_backend_delegation')
22+
23+
PYTHON_EXECUTABLE=python .ci/scripts/test_model.sh "${_model_name}" "${_build_tool}" "${_backend}" "${_demo_backend_delegation}"
24+
done

0 commit comments

Comments
 (0)