refactor(build): 统一本地与 CI 构建入口及平台发布工具 (#9)
Gitea CI / Check code and tests (push) Successful in 7m38s
Gitea CI / Build Android APK (push) Successful in 6m20s
Gitea CI / Audit and package Windows x64 (push) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (push) Canceled after 0s
Gitea CI / Gitea CI passed (push) Canceled after 0s
Gitea CI / Build Windows x64 app (push) Canceled after 14m42s
Gitea CI / Check code and tests (push) Successful in 7m38s
Gitea CI / Build Android APK (push) Successful in 6m20s
Gitea CI / Audit and package Windows x64 (push) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (push) Canceled after 0s
Gitea CI / Gitea CI passed (push) Canceled after 0s
Gitea CI / Build Windows x64 app (push) Canceled after 14m42s
This commit was merged in pull request #9.
This commit is contained in:
1 parent
a13a54d5ec
commit
4a759d81a6
61 files changed
+1913
-388
No files matched your search
@@ -8,17 +8,20 @@ import tempfile
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT / 'tool'))
|
||||
from project_tools import host_bash, tool_command
|
||||
|
||||
|
||||
class CliTests(unittest.TestCase):
|
||||
def test_python_help_and_unknown_option(self):
|
||||
scripts = [
|
||||
'check.py', 'macos/check_macos_release.py', 'macos/macos_updates.py',
|
||||
'check.py', 'build.py', 'project_tools.py', 'macos/check_macos_release.py', 'macos/macos_updates.py',
|
||||
'macos/build_macos_release.py', 'macos/sign_macos_app.py', 'macos/create_macos_dmg.py',
|
||||
'macos/test_macos_release.py', 'macos/test_macos_updates.py',
|
||||
'macos/test_check_macos_release.py', 'windows/check_windows_release.py',
|
||||
'windows/package_windows_release.py', 'windows/prepare_windows_sandbox.py',
|
||||
'windows/windows_updates.py', 'windows/test_windows_updates.py',
|
||||
'gitea/package-app.py',
|
||||
'gitea/package-app.py', 'gitea/verify_flutter_version.py',
|
||||
'diagnostics/frame_budget.py',
|
||||
]
|
||||
for name in scripts:
|
||||
@@ -29,10 +32,8 @@ class CliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, code, result.stderr)
|
||||
self.assertIn('usage:', (result.stdout + result.stderr).lower())
|
||||
|
||||
@unittest.skipUnless(shutil.which('dart'), 'Dart SDK unavailable')
|
||||
def test_context_diagnostic_arguments_and_json_output(self):
|
||||
command = [shutil.which('dart'), 'run',
|
||||
str(ROOT / 'tool/diagnostics/benchmark_agent_context.dart')]
|
||||
command = tool_command('dart', ['run', ROOT / 'tool/diagnostics/benchmark_agent_context.dart'])
|
||||
for arguments, code in [(['--help'], 0), ([], 2)]:
|
||||
result = subprocess.run(command + arguments, cwd=ROOT, capture_output=True,
|
||||
text=True, timeout=60)
|
||||
@@ -46,15 +47,15 @@ class CliTests(unittest.TestCase):
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertEqual(json.loads(result.stdout)['messages'], 0)
|
||||
|
||||
@unittest.skipUnless(shutil.which('bash'), 'bash unavailable')
|
||||
@unittest.skipUnless(host_bash(), 'native bash unavailable')
|
||||
def test_shell_help_and_argument_count(self):
|
||||
for script in (ROOT / 'tool/macos').glob('*.sh'):
|
||||
with self.subTest(script=script.name):
|
||||
result = subprocess.run(['bash', str(script), '--help'],
|
||||
result = subprocess.run([host_bash(), script.as_posix(), '--help'],
|
||||
capture_output=True, text=True, timeout=10)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
self.assertIn('Usage:', result.stdout)
|
||||
result = subprocess.run(['bash', str(script), 'one', 'two', 'three'],
|
||||
result = subprocess.run([host_bash(), script.as_posix(), 'one', 'two', 'three'],
|
||||
capture_output=True, text=True, timeout=10)
|
||||
self.assertEqual(result.returncode, 2, result.stderr)
|
||||
|
||||
|
||||
Reference in new issue
Block a user