Skip to content

Commit 2b36a92

Browse files
nanae772Hiroshiba
andauthored
追加: 起動前にengine_manifest.jsonをチェックする (#1526)
Co-authored-by: Hiroshiba <hihokaruta@gmail.com>
1 parent c76a302 commit 2b36a92

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/test-engine-container.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ jobs:
6868
- name: <Setup> Warm up ENGINE server by waiting
6969
run: |
7070
set +e # curlのエラーを無視する
71-
71+
7272
url="http://127.0.0.1:50021/version"
7373
max_attempts=10
7474
sleep_interval=5
75-
75+
7676
for i in $(seq 1 "$max_attempts"); do
7777
status=$(curl -o /dev/null -s -w '%{http_code}\n' "$url")
7878
if [ "$status" -eq 200 ]; then
@@ -86,4 +86,4 @@ jobs:
8686
exit 1
8787
8888
- name: <Test> Test ENGINE application docker container
89-
run: python tools/check_release_build.py --skip_run_process --dist_dir dist/
89+
run: python tools/check_release_build.py --skip_run_process --skip_check_manifest --dist_dir dist/

tools/check_release_build.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@
1616
base_url = "http://127.0.0.1:50021/"
1717

1818

19-
def test_release_build(dist_dir: Path, skip_run_process: bool) -> None:
19+
def test_release_build(
20+
dist_dir: Path, skip_run_process: bool, skip_check_manifest: bool
21+
) -> None:
2022
run_file = dist_dir / "run"
2123
if not run_file.exists():
2224
run_file = dist_dir / "run.exe"
2325

26+
# マニフェストファイルの確認
27+
if not skip_check_manifest:
28+
manifest_file = dist_dir / "engine_manifest.json"
29+
assert manifest_file.is_file()
30+
manifest = json.loads(manifest_file.read_text(encoding="utf-8"))
31+
assert "manifest_version" in manifest
32+
2433
# 起動
2534
process = None
2635
if not skip_run_process:
@@ -77,5 +86,10 @@ def test_release_build(dist_dir: Path, skip_run_process: bool) -> None:
7786
parser = argparse.ArgumentParser()
7887
parser.add_argument("--dist_dir", type=Path, default=Path("dist/"))
7988
parser.add_argument("--skip_run_process", action="store_true")
89+
parser.add_argument("--skip_check_manifest", action="store_true")
8090
args = parser.parse_args()
81-
test_release_build(dist_dir=args.dist_dir, skip_run_process=args.skip_run_process)
91+
test_release_build(
92+
dist_dir=args.dist_dir,
93+
skip_run_process=args.skip_run_process,
94+
skip_check_manifest=args.skip_check_manifest,
95+
)

0 commit comments

Comments
 (0)