← Back to the site changelog
Site Changelog
Original commit record
Broaden regression script coverage safely (#206)
* Guard script exit in test_pla.py
* Guard script exit in test_usage.py
* Guard script exit in test_fulltext.py
* Guard script exit in test_glossary.py
* Guard script exit in test_briefing.py
* Guard script exit in test_images.py
* Broaden pull request regression script coverage
- SHA
228e24c701461ad3018b1b57a886fff622b72e27
- Commit date
- Author
- nnneeeooo-nnneeeooo
- Committer
- web-flow
Changed files (7)
-
.github/workflows/hourly.yml
modified · +10 / −4
-
tests/test_briefing.py
modified · +2 / −1
-
tests/test_fulltext.py
modified · +2 / −1
-
tests/test_glossary.py
modified · +2 / −1
-
tests/test_images.py
modified · +2 / −1
-
tests/test_pla.py
modified · +2 / −1
-
tests/test_usage.py
modified · +2 / −1
Full diff
@@ -13,9 +13,7 @@ on:\n - "pipeline/flightnews.py"\n - "pipeline/airport_codes.py"\n - "config/airport_iata_aliases.json"\n- - "tests/test_companion.py"\n- - "tests/test_flightwatch.py"\n- - "tests/test_airport_codes.py"\n+ - "tests/**"\n push:\n branches: [main]\n paths-ignore:\n@@ -26,7 +24,7 @@ concurrency:\n # A code push is a production hotfix/deploy signal: do not let a stale\n # scheduled run on older code block it. Scheduled runs still serialize and\n # never cancel each other.\n- cancel-in-progress: ${{ github.event_name == 'push' }}\n+ cancel-in-progress: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}\n \n jobs:\n regression:\n@@ -46,6 +44,14 @@ jobs:\n python tests/test_companion.py\n python tests/test_flightwatch.py\n python tests/test_airport_codes.py\n+ python tests/test_grounded.py\n+ python tests/test_pla.py\n+ python tests/test_usage.py\n+ python tests/test_fulltext.py\n+ python tests/test_glossary.py\n+ python tests/test_briefing.py\n+ python tests/test_images.py\n+ python tests/test_manufacturer_sources.py\n \n update:\n if: github.event_name != 'pull_request'\n@@ -658,4 +658,5 @@ def _art_text(text):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)\n@@ -284,4 +284,5 @@ def group_with(urls):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)\n@@ -223,4 +223,5 @@ def draft(zh_title, en_title, zh_body=("內文。",), en_body=("Body.",)):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)\n@@ -714,4 +714,5 @@ def _boom(url, **kw):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)\n@@ -108,4 +108,5 @@ def check(name, cond):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)\n@@ -510,4 +510,5 @@ def json(self):\n print(f"\n{CHECKS} checks passed, {FAILED} failed"\n if not FAILED else f"\n{CHECKS - FAILED}/{CHECKS} passed, "\n f"{FAILED} FAILED")\n-sys.exit(1 if FAILED else 0)\n+if __name__ == "__main__":\n+ sys.exit(1 if FAILED else 0)