Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

追加: 起動前にengine_manifest.jsonをチェックする #1526

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/test-engine-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ jobs:
- name: <Setup> Warm up ENGINE server by waiting
run: |
set +e # curlのエラーを無視する

url="http://127.0.0.1:50021/version"
max_attempts=10
sleep_interval=5

for i in $(seq 1 "$max_attempts"); do
status=$(curl -o /dev/null -s -w '%{http_code}\n' "$url")
if [ "$status" -eq 200 ]; then
Expand All @@ -86,4 +86,4 @@ jobs:
exit 1

- name: <Test> Test ENGINE application docker container
run: python tools/check_release_build.py --skip_run_process --dist_dir dist/
run: python tools/check_release_build.py --skip_check_manifest --skip_run_process --dist_dir dist/
18 changes: 16 additions & 2 deletions tools/check_release_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@
base_url = "http://127.0.0.1:50021/"


def test_release_build(dist_dir: Path, skip_run_process: bool) -> None:
def test_release_build(
dist_dir: Path, skip_run_process: bool, skip_check_manifest: bool
) -> None:
run_file = dist_dir / "run"
if not run_file.exists():
run_file = dist_dir / "run.exe"

# マニフェストファイルの確認
if not skip_check_manifest:
manifest_file = dist_dir / "engine_manifest.json"
assert manifest_file.is_file()
manifest = json.loads(manifest_file.read_text(encoding="utf-8"))
assert "manifest_version" in manifest

# 起動
process = None
if not skip_run_process:
Expand Down Expand Up @@ -77,5 +86,10 @@ def test_release_build(dist_dir: Path, skip_run_process: bool) -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--dist_dir", type=Path, default=Path("dist/"))
parser.add_argument("--skip_run_process", action="store_true")
parser.add_argument("--skip_check_manifest", action="store_true")
args = parser.parse_args()
test_release_build(dist_dir=args.dist_dir, skip_run_process=args.skip_run_process)
test_release_build(
dist_dir=args.dist_dir,
skip_run_process=args.skip_run_process,
skip_check_manifest=args.skip_check_manifest,
)
Loading