|
| 1 | +# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Regression tests for the Studio release workflow.""" |
| 16 | + |
| 17 | +from pathlib import Path |
| 18 | +from typing import Any |
| 19 | + |
| 20 | +import yaml |
| 21 | + |
| 22 | + |
| 23 | +def _publish_job() -> dict[str, Any]: |
| 24 | + workflow_path = ( |
| 25 | + Path(__file__).parents[1] |
| 26 | + / ".github" |
| 27 | + / "workflows" |
| 28 | + / "publish-studio-release.yaml" |
| 29 | + ) |
| 30 | + workflow = yaml.safe_load(workflow_path.read_text(encoding="utf-8")) |
| 31 | + return workflow["jobs"]["publish"] |
| 32 | + |
| 33 | + |
| 34 | +def test_thin_bundle_input_is_scoped_to_supported_provider() -> None: |
| 35 | + publish = _publish_job() |
| 36 | + providers = { |
| 37 | + entry["provider"]: entry for entry in publish["strategy"]["matrix"]["include"] |
| 38 | + } |
| 39 | + |
| 40 | + assert providers["volcengine"]["thin_bundles"] == "${{ inputs.thin_bundles }}" |
| 41 | + assert providers["byteplus"]["thin_bundles"] is False |
| 42 | + assert publish["env"]["RELEASE_THIN_BUNDLES"] == "${{ matrix.thin_bundles }}" |
0 commit comments