Andrushika commented on code in PR #73185:
URL: https://github.com/apache/airflow/pull/73185#discussion_r4048206247


##########
scripts/tests/ci/test_migration_validation_optimizations.py:
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+import itertools
+from pathlib import Path
+
+import pytest
+import yaml
+
+ROOT = Path(__file__).resolve().parents[3]
+UNIT_WORKFLOW = ".github/workflows/run-unit-tests.yml"
+
+
+def load_yaml(path):
+    return yaml.load((ROOT / path).read_text(), Loader=yaml.BaseLoader)
+
+
+def test_migrations_stay_in_an_existing_required_test_check():
+    jobs = load_yaml(UNIT_WORKFLOW)["jobs"]
+    assert set(jobs) == {"tests"}
+    tests = jobs["tests"]
+    assert "continue-on-error" not in tests
+    assert tests["strategy"]["fail-fast"] == "false"
+    step = next(step for step in tests["steps"] if step.get("uses", 
"").endswith("/migration_tests"))
+    assert step["with"]["python-version"] == "${{ matrix.python-version }}"
+    condition = step["if"]
+    assert "inputs.run-migration-tests == 'true'" in condition
+    assert "inputs.test-group == 'core'" in condition
+    assert "matrix.python-version != '3.14'" in condition
+    assert (
+        "matrix.test-types.description == 
fromJSON(inputs.test-types-as-strings-in-json)[0].description"
+        in condition
+    )
+    assert "continue-on-error" not in step

Review Comment:
   This test also validates nothing. Let's remove the whole test file.



##########
scripts/tests/ci/test_migration_validation_optimizations.py:
##########
@@ -0,0 +1,75 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+import itertools
+from pathlib import Path
+
+import pytest
+import yaml
+
+ROOT = Path(__file__).resolve().parents[3]
+UNIT_WORKFLOW = ".github/workflows/run-unit-tests.yml"
+
+
+def load_yaml(path):
+    return yaml.load((ROOT / path).read_text(), Loader=yaml.BaseLoader)
+
+
+def test_migrations_stay_in_an_existing_required_test_check():
+    jobs = load_yaml(UNIT_WORKFLOW)["jobs"]
+    assert set(jobs) == {"tests"}
+    tests = jobs["tests"]
+    assert "continue-on-error" not in tests
+    assert tests["strategy"]["fail-fast"] == "false"
+    step = next(step for step in tests["steps"] if step.get("uses", 
"").endswith("/migration_tests"))
+    assert step["with"]["python-version"] == "${{ matrix.python-version }}"
+    condition = step["if"]
+    assert "inputs.run-migration-tests == 'true'" in condition
+    assert "inputs.test-group == 'core'" in condition
+    assert "matrix.python-version != '3.14'" in condition
+    assert (
+        "matrix.test-types.description == 
fromJSON(inputs.test-types-as-strings-in-json)[0].description"
+        in condition
+    )
+    assert "continue-on-error" not in step
+
+
[email protected]("python_versions", [("3.10",), ("3.14",), ("3.10", 
"3.12", "3.14")])
[email protected]("backend_versions", [("12",), ("12", "16")])
[email protected](
+    "excluded",
+    [[], [{"python-version": "3.12", "backend-version": "12"}], 
[{"backend-version": "16"}]],
+)
+def test_migration_projection_keeps_each_eligible_environment_once(

Review Comment:
   This test does nothing. Please remove it.



##########
.github/workflows/run-unit-tests.yml:
##########
@@ -207,14 +207,18 @@ jobs:
           use-uv: ${{ inputs.use-uv }}
           # We do not want to clean up /mnt here - it's been already done 
before preparing image
           make-mnt-writeable-and-cleanup: false
+      # Keep failures in an existing test check and avoid another runner/image 
restore.
+      # Matrix exclusions describe Python/backend combinations, not individual 
test shards.
       - name: >
           Migration Tests: ${{ matrix.python-version }}:${{ 
env.PARALLEL_TEST_TYPES }}
         uses: ./.github/actions/migration_tests
         with:
           python-version: ${{ matrix.python-version }}
-        # Any new python version should be disabled below via `&& 
matrix.python-version != '3.xx'` until the first
-        # Airflow version that supports it is released - otherwise there's 
nothing to migrate back to.
-        if: inputs.run-migration-tests == 'true' && inputs.test-group == 
'core' && matrix.python-version != '3.14'

Review Comment:
   New comment is vaguer... Let's restore the old one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to