refactor(news): remove retired research workflow
Development CI / check-and-build (push) Successful in 2m53s
GitHub Git mirror / mirror (push) Successful in 7s
Development CI / deploy-development (push) Successful in 2m31s

This commit is contained in:
eezd committed 2026-11-05 18:38:25 +08:00
1 parent f3894c3728
commit d79a10c2e6
69 files changed
+460 -6713

No files matched your search

-43
View File
@@ -132,49 +132,6 @@ class BuildTests(unittest.TestCase):
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
class NewsResetTests(unittest.TestCase):
def test_preview_never_stops_worker_or_confirms_deletion(self):
with tempfile.TemporaryDirectory() as temporary:
directory = Path(temporary)
build = {'version':'20261101-aaaaaaaa', 'images': {'backend': {'digest': 'synthetic'}}}
with patch.object(deploy, 'INSTANCE', directory), patch.object(deploy, 'validate_images'), patch.object(deploy, 'run', return_value='{}') as run:
deploy.reset_news_ai(build)
self.assertEqual(run.call_count, 2)
self.assertTrue(run.call_args.kwargs['input'].startswith('CONFIRMED = False'))
self.assertFalse(any('stop' in call.args for call in run.call_args_list))
def test_reset_refuses_pending_deployment(self):
with tempfile.TemporaryDirectory() as temporary:
directory = Path(temporary)
ci.save(directory / 'deployment.pending.json', {})
with patch.object(deploy, 'INSTANCE', directory), patch.object(deploy, 'validate_images'), patch.object(deploy, 'run') as run:
with self.assertRaisesRegex(RuntimeError, 'pending deployment'):
deploy.reset_news_ai({}, True)
run.assert_not_called()
def test_full_reset_requires_real_accepted_sample_before_docker(self):
with patch.object(deploy,'validate_images') as images, patch.object(deploy,'run') as run:
with self.assertRaisesRegex(RuntimeError,'验收尚未通过'):
deploy.reset_news_derived({},True)
images.assert_not_called()
run.assert_not_called()
def test_full_reset_preview_keeps_worker_and_data(self):
with tempfile.TemporaryDirectory() as temporary:
with patch.object(deploy,'INSTANCE',Path(temporary)), patch.object(deploy,'validate_images'), patch.object(deploy,'run',return_value='{}') as run:
deploy.reset_news_derived({'version':'synthetic'})
self.assertEqual(run.call_count,2)
self.assertIn('False,None,None',run.call_args.kwargs['input'])
self.assertFalse(any('stop' in call.args for call in run.call_args_list))
def test_full_reset_refuses_pending_deployment(self):
with tempfile.TemporaryDirectory() as temporary:
directory=Path(temporary)
ci.save(directory / 'deployment.pending.json',{})
with patch.object(deploy,'INSTANCE',directory),patch.object(deploy,'validate_images'),patch.object(deploy,'run') as run:
with self.assertRaisesRegex(RuntimeError,'pending deployment'):
deploy.reset_news_derived({})
run.assert_not_called()
class RecoveryTests(unittest.TestCase):