Skip to content

Commit c7470b5

Browse files
committed
[red] Require one Android integration entrypoint
Signed-off-by: Viwat Vchirawongkwin <viwat.v@chula.ac.th>
1 parent cb5fd28 commit c7470b5

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

‎tests/publication/test_ci_contract.py‎

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,20 +118,39 @@ def test_android_integration_builds_one_application_bundle(self) -> None:
118118
self.assertIn("integration_test/android_smoke_test.dart", android)
119119
self.assertNotIn("integration_test/about_page_test.dart", android)
120120
self.assertNotIn("integration_test/blockly_webview_test.dart", android)
121+
self.assertIn("timeout --signal=TERM --kill-after=30s 30m", android)
122+
self.assertIn("--no-pub", android)
121123

122-
harness = (
123-
REPO_ROOT / "app" / "integration_test" / "android_smoke_test.dart"
124-
).read_text(encoding="utf-8")
124+
integration_root = REPO_ROOT / "app" / "integration_test"
125+
self.assertEqual(
126+
["android_smoke_test.dart"],
127+
sorted(path.name for path in integration_root.glob("*_test.dart")),
128+
)
129+
harness = (integration_root / "android_smoke_test.dart").read_text(
130+
encoding="utf-8"
131+
)
132+
self.assertIn(
133+
"import 'about_page_suite.dart' as about_page;",
134+
harness,
135+
)
136+
self.assertIn(
137+
"import 'blockly_webview_suite.dart' as blockly_webview;",
138+
harness,
139+
)
140+
self.assertEqual(
141+
1,
142+
harness.count(
143+
"IntegrationTestWidgetsFlutterBinding.ensureInitialized();"
144+
),
145+
)
125146
self.assertIn(
126-
"import 'about_page_test.dart' as about_page;",
147+
"about_page.registerAboutPageIntegrationTests();",
127148
harness,
128149
)
129150
self.assertIn(
130-
"import 'blockly_webview_test.dart' as blockly_webview;",
151+
"blockly_webview.registerBlocklyWebViewIntegrationTests();",
131152
harness,
132153
)
133-
self.assertIn("about_page.main();", harness)
134-
self.assertIn("blockly_webview.main();", harness)
135154

136155
def test_workflow_has_no_adjacent_duplicate_shell_key(self) -> None:
137156
workflow = (REPO_ROOT / ".github" / "workflows" / "ci.yml").read_text(

0 commit comments

Comments
 (0)