CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 9m10s
- The Yocto release table, the .NET target-framework end-of-support dates and the oldest patched Android / iOS releases move to JSON files in compliance-agent/data/eol/, compiled into the agent (pipeline::eol_tables) and read by the check: one place for each table. - scripts/check-eol-tables.py fetches the endoflife.date products (yocto, dotnet, dotnetfx, android, ios) and lists new releases, changed dates and LTS flags, and moved platform floors. On a difference it opens one issue, or updates the open one found by its title, labelled eol-tables. - .gitea/workflows/eol-tables.yml runs it on Mondays and by hand (with a dry-run input), with NIGHTLY_ALERT_TOKEN; it is separate from CI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
71 lines
3.5 KiB
Python
71 lines
3.5 KiB
Python
"""Offline tests of check-eol-tables.py: python3 -m unittest discover -s scripts."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import datetime as dt
|
|
import importlib.util
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
SPEC = importlib.util.spec_from_file_location(
|
|
"check_eol_tables", Path(__file__).with_name("check-eol-tables.py"))
|
|
assert SPEC is not None and SPEC.loader is not None
|
|
check = importlib.util.module_from_spec(SPEC)
|
|
SPEC.loader.exec_module(check)
|
|
|
|
TODAY = dt.date(2026, 10, 9)
|
|
|
|
|
|
class CompareTests(unittest.TestCase):
|
|
def test_yocto_new_release_and_changed_dates_are_listed(self) -> None:
|
|
table = {"releases": [{"codename": "wrynose", "version": "6.0", "lts": True,
|
|
"released": "2026-05-13", "end_of_life": "2030-04-30"}]}
|
|
upstream: list[dict[str, object]] = [
|
|
{"cycle": "6.1", "codename": "Blacksail", "releaseDate": "2026-10-20",
|
|
"eol": "2027-04-30"},
|
|
{"cycle": "6.0", "codename": "Wrynose", "lts": True,
|
|
"releaseDate": "2026-05-13", "eol": "2030-05-31"},
|
|
]
|
|
found = check.compare_yocto(table, upstream)
|
|
self.assertEqual(len(found), 2)
|
|
self.assertIn("Blacksail (6.1): on endoflife.date", found[0])
|
|
self.assertIn("end of life is 2030-05-31 on endoflife.date, 2030-04-30", found[1])
|
|
same = [{**upstream[1], "eol": "2030-04-30"}]
|
|
self.assertEqual(check.compare_yocto(table, same), [])
|
|
|
|
def test_dotnet_monikers_map_to_endoflife_cycles(self) -> None:
|
|
self.assertEqual(check.dotnet_cycle("net8.0"), ("dotnet", "8"))
|
|
self.assertEqual(check.dotnet_cycle("netcoreapp3.1"), ("dotnet", "3.1"))
|
|
self.assertEqual(check.dotnet_cycle("net462"), ("dotnetfx", "4.6.2"))
|
|
self.assertEqual(check.dotnet_cycle("net35"), ("dotnetfx", "3.5-sp1"))
|
|
self.assertIsNone(check.dotnet_cycle("net20"))
|
|
table = {"frameworks": [{"moniker": "net8.0", "end_of_support": "2026-11-10",
|
|
"product": ".NET 8"}]}
|
|
upstream = {"dotnet": [{"cycle": "8", "eol": "2026-11-10"},
|
|
{"cycle": "11", "eol": "2029-11-13"},
|
|
{"cycle": "12", "eol": False}]}
|
|
self.assertEqual(check.compare_dotnet(table, upstream),
|
|
["dotnet 11: end of support 2029-11-13 on endoflife.date, "
|
|
"not in the table"])
|
|
|
|
def test_platform_floors_are_the_oldest_supported_release(self) -> None:
|
|
table = {"android": {"oldest_patched_api": 29}, "ios": {"oldest_patched": "15.0"}}
|
|
android = [{"cycle": "14", "apiVersion": "34", "eol": False},
|
|
{"cycle": "13", "apiVersion": "33", "eol": "2026-03-02"}]
|
|
ios = [{"cycle": "16", "eol": False}, {"cycle": "15", "eol": False},
|
|
{"cycle": "14", "eol": "2021-10-26"}]
|
|
found = check.compare_platforms(table, android, ios, TODAY)
|
|
self.assertEqual(found, ["Android: the oldest release with security updates is "
|
|
"API 34 on endoflife.date, API 29 in the table"])
|
|
|
|
def test_the_issue_is_updated_only_when_the_differences_change(self) -> None:
|
|
body = check.issue_body({"yocto.json": ["a"], "dotnet.json": []}, TODAY)
|
|
self.assertIn("### `yocto.json`", body)
|
|
self.assertNotIn("dotnet.json", body)
|
|
later = check.issue_body({"yocto.json": ["a"]}, dt.date(2026, 10, 16))
|
|
self.assertEqual(check.without_check_date(body), check.without_check_date(later))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|