Skip to content

Commit

Permalink
chore: remove device model
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Jan 31, 2024
1 parent 7604229 commit 268d21b
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 74 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/mobile_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: true
matrix:
os: [macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
Expand Down Expand Up @@ -123,7 +123,6 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: arm64-v8a
profile: Pixel 6
arch: x86_64
working-directory: frontend/appflowy_flutter
script: flutter test integration_test/runner.dart
66 changes: 66 additions & 0 deletions frontend/appflowy_flutter/integration_test/desktop_runner.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import 'desktop/appearance_settings_test.dart' as appearance_test_runner;
import 'desktop/board/board_test_runner.dart' as board_test_runner;
import 'desktop/database/database_calendar_test.dart' as database_calendar_test;
import 'desktop/database/database_cell_test.dart' as database_cell_test;
import 'desktop/database/database_field_settings_test.dart'
as database_field_settings_test;
import 'desktop/database/database_field_test.dart' as database_field_test;
import 'desktop/database/database_filter_test.dart' as database_filter_test;
import 'desktop/database/database_row_page_test.dart' as database_row_page_test;
import 'desktop/database/database_row_test.dart' as database_row_test;
import 'desktop/database/database_setting_test.dart' as database_setting_test;
import 'desktop/database/database_share_test.dart' as database_share_test;
import 'desktop/database/database_sort_test.dart' as database_sort_test;
import 'desktop/database/database_view_test.dart' as database_view_test;
import 'desktop/document/document_test_runner.dart' as document_test_runner;
import 'desktop/empty_test.dart' as first_test;
import 'desktop/hotkeys_test.dart' as hotkeys_test;
import 'desktop/import_files_test.dart' as import_files_test;
import 'desktop/settings/settings_runner.dart' as settings_test_runner;
import 'desktop/share_markdown_test.dart' as share_markdown_test;
import 'desktop/sidebar/sidebar_test_runner.dart' as sidebar_test_runner;
import 'desktop/switch_folder_test.dart' as switch_folder_test;
import 'desktop/tabs_test.dart' as tabs_test;

Future<void> runIntegrationOnDesktop() async {
// This test must be run first, otherwise the CI will fail.
first_test.main();

switch_folder_test.main();
share_markdown_test.main();
import_files_test.main();

// Document integration tests
document_test_runner.startTesting();

// Sidebar integration tests
sidebar_test_runner.startTesting();

// Board integration test
board_test_runner.startTesting();

// Database integration tests
database_cell_test.main();
database_field_test.main();
database_field_settings_test.main();
database_share_test.main();
database_row_page_test.main();
database_row_test.main();
database_setting_test.main();
database_filter_test.main();
database_sort_test.main();
database_view_test.main();
database_calendar_test.main();

// Tabs
tabs_test.main();

// Others
hotkeys_test.main();

// Appearance integration test
appearance_test_runner.main();

// User settings
settings_test_runner.main();
}
5 changes: 5 additions & 0 deletions frontend/appflowy_flutter/integration_test/mobile_runner.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'mobile/sign_in/anonymous_sign_in_test.dart' as anonymous_sign_in_test;

Future<void> runIntegrationOnMobile() async {
anonymous_sign_in_test.main();
}
71 changes: 2 additions & 69 deletions frontend/appflowy_flutter/integration_test/runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,8 @@ import 'dart:io';

import 'package:integration_test/integration_test.dart';

import 'desktop/appearance_settings_test.dart' as appearance_test_runner;
import 'desktop/board/board_test_runner.dart' as board_test_runner;
import 'desktop/database/database_calendar_test.dart' as database_calendar_test;
import 'desktop/database/database_cell_test.dart' as database_cell_test;
import 'desktop/database/database_field_settings_test.dart'
as database_field_settings_test;
import 'desktop/database/database_field_test.dart' as database_field_test;
import 'desktop/database/database_filter_test.dart' as database_filter_test;
import 'desktop/database/database_row_page_test.dart' as database_row_page_test;
import 'desktop/database/database_row_test.dart' as database_row_test;
import 'desktop/database/database_setting_test.dart' as database_setting_test;
import 'desktop/database/database_share_test.dart' as database_share_test;
import 'desktop/database/database_sort_test.dart' as database_sort_test;
import 'desktop/database/database_view_test.dart' as database_view_test;
import 'desktop/document/document_test_runner.dart' as document_test_runner;
import 'desktop/empty_test.dart' as first_test;
import 'desktop/hotkeys_test.dart' as hotkeys_test;
import 'desktop/import_files_test.dart' as import_files_test;
import 'desktop/settings/settings_runner.dart' as settings_test_runner;
import 'desktop/share_markdown_test.dart' as share_markdown_test;
import 'desktop/sidebar/sidebar_test_runner.dart' as sidebar_test_runner;
import 'desktop/switch_folder_test.dart' as switch_folder_test;
import 'desktop/tabs_test.dart' as tabs_test;
// import 'auth/supabase_auth_test.dart' as supabase_auth_test_runner;
import 'desktop_runner.dart';
import 'mobile_runner.dart';

/// The main task runner for all integration tests in AppFlowy.
///
Expand All @@ -45,48 +23,3 @@ Future<void> main() async {
throw Exception('Unsupported platform');
}
}

Future<void> runIntegrationOnDesktop() async {
// This test must be run first, otherwise the CI will fail.
first_test.main();

switch_folder_test.main();
share_markdown_test.main();
import_files_test.main();

// Document integration tests
document_test_runner.startTesting();

// Sidebar integration tests
sidebar_test_runner.startTesting();

// Board integration test
board_test_runner.startTesting();

// Database integration tests
database_cell_test.main();
database_field_test.main();
database_field_settings_test.main();
database_share_test.main();
database_row_page_test.main();
database_row_test.main();
database_setting_test.main();
database_filter_test.main();
database_sort_test.main();
database_view_test.main();
database_calendar_test.main();

// Tabs
tabs_test.main();

// Others
hotkeys_test.main();

// Appearance integration test
appearance_test_runner.main();

// User settings
settings_test_runner.main();
}

Future<void> runIntegrationOnMobile() async {}
2 changes: 1 addition & 1 deletion frontend/scripts/makefile/flutter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ run_task = { name = [
script_runner = "@shell"

[tasks.appflowy-android-dev-ci]
dependencies = ["appflowy-core-dev-android"]
dependencies = ["appflowy-core-dev-android-ci"]
run_task = { name = [
"code_generation",
"flutter-build-android",
Expand Down
25 changes: 24 additions & 1 deletion frontend/scripts/makefile/mobile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,23 @@ run_task = { name = [
"restore-crate-type",
] }

# only use in CI job
[tasks.appflowy-core-dev-android-ci]
category = "Build"
dependencies = ["env_check", "set-app-version"]
run_task = { name = [
"setup-crate-type",
"sdk-build-android-ci",
"post-mobile-android",
"restore-crate-type",
] }

[tasks.sdk-build-android]
dependencies = ["set-app-version"]
private = true
script = [
"""
cd rust-lib/
rustup show
if [ "${BUILD_FLAG}" = "debug" ]; then
echo "🚀 🚀 🚀 Building for debug"
cargo ndk -t arm64-v8a -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
Expand All @@ -68,6 +78,19 @@ script = [
]
script_runner = "@shell"

# only use in CI job
[tasks.sdk-build-android-ci]
dependencies = ["set-app-version"]
private = true
script = [
"""
cd rust-lib/
cargo ndk -t x86_64 -o ./jniLibs build --features "${FLUTTER_DESKTOP_FEATURES}" --package=dart-ffi
cd ../
""",
]
script_runner = "@shell"

[tasks.post-mobile-ios]
private = true
script = [
Expand Down

0 comments on commit 268d21b

Please sign in to comment.