mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 18:15:09 +00:00 
			
		
		
		
	 c009347735
			
		
	
	
		c009347735
		
	
	
	
	
		
			
			# Conflicts: # frontend/appflowy_flutter/lib/plugins/database_view/application/database_view_service.dart # frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/link_to_page_widget.dart # frontend/appflowy_flutter/lib/plugins/trash/application/trash_bloc.dart # frontend/appflowy_flutter/lib/plugins/trash/application/trash_service.dart # frontend/appflowy_flutter/lib/workspace/application/app/app_bloc.dart # frontend/appflowy_flutter/lib/workspace/application/app/app_service.dart # frontend/appflowy_flutter/lib/workspace/application/menu/menu_bloc.dart # frontend/appflowy_flutter/lib/workspace/application/workspace/workspace_service.dart # frontend/appflowy_flutter/lib/workspace/presentation/home/menu/app/header/header.dart # frontend/appflowy_flutter/test/bloc_test/grid_test/filter/filter_util.dart # frontend/appflowy_flutter/test/bloc_test/grid_test/grid_bloc_test.dart # frontend/appflowy_flutter/test/bloc_test/grid_test/util.dart # frontend/appflowy_flutter/test/bloc_test/home_test/view_bloc_test.dart # frontend/rust-lib/flowy-database/src/services/database/database_editor.rs # frontend/rust-lib/flowy-database/src/services/persistence/migration/database_view_migration.rs
		
			
				
	
	
		
			225 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			TOML
		
	
	
	
	
	
			
		
		
	
	
			225 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			TOML
		
	
	
	
	
	
| 
 | |
| #RUST_LOG="debug" flutter test -j, --concurrency=1 'path to the file' --name 'test case name'
 | |
| [tasks.flutter_test]
 | |
| description = "Run flutter test with single case in single file. Input: cargo make flutter_test 'path to the file' --name 'test case name'"
 | |
| script = '''
 | |
| cd appflowy_flutter
 | |
| RUST_LOG="debug" flutter test -j, --concurrency=1 "${@}"
 | |
| '''
 | |
| script_runner = "@shell"
 | |
| 
 | |
| [tasks.dart_unit_test]
 | |
| script = '''
 | |
| cargo make --profile test-macos-$(uname -m) run_dart_unit_test
 | |
| '''
 | |
| script_runner = "@shell"
 | |
| 
 | |
| [tasks.dart_unit_test.windows]
 | |
| script = '''
 | |
| cargo make --profile test-windows run_dart_unit_test
 | |
| '''
 | |
| script_runner = "@shell"
 | |
| 
 | |
| [tasks.dart_unit_test.linux]
 | |
| script = '''
 | |
| cargo make --profile test-linux run_dart_unit_test
 | |
| '''
 | |
| script_runner = "@shell"
 | |
| 
 | |
| [tasks.run_dart_unit_test]
 | |
| env = { RUST_LOG = "info" }
 | |
| dependencies = ["build_test_backend"]
 | |
| description = "Run flutter unit tests"
 | |
| script = '''
 | |
| cd appflowy_flutter
 | |
| flutter test --dart-define=RUST_LOG=${RUST_LOG} -j, --concurrency=1
 | |
| '''
 | |
| 
 | |
| [tasks.rust_unit_test]
 | |
| run_task = { name = ["rust_lib_unit_test", "shared_lib_unit_test"] }
 | |
| 
 | |
| [tasks.rust_lib_unit_test]
 | |
| env = { RUST_LOG = "info" }
 | |
| description = "Run rust-lib unit tests"
 | |
| script = '''
 | |
| cd rust-lib
 | |
| cargo test --no-default-features --features="sync, rev-sqlite"
 | |
| '''
 | |
| 
 | |
| [tasks.shared_lib_unit_test]
 | |
| env = { RUST_LOG = "info" }
 | |
| description = "Run shared-lib unit test"
 | |
| script = '''
 | |
| cd ../shared-lib
 | |
| cargo test --no-default-features
 | |
| '''
 | |
| 
 | |
| [tasks.check_grcov]
 | |
| description = "Check if `grcov` is installled"
 | |
| script_runner = "@shell"
 | |
| script = '''
 | |
| export PATH=$PATH:"$HOME/.cargo/bin/"
 | |
| if command -v grcov > /dev/null; then
 | |
|   echo "Found 'grcov' executable."
 | |
| else
 | |
|   echo "[!] Could not find 'grcov' executable."
 | |
|   echo "[!] Please install 'grcov' by running 'cargo install grcov'."
 | |
|   echo "[!] You may also need to install 'llvm-tools-preview' using 'rustup component add llvm-tools-preview'."
 | |
|   echo "[!] If installed, check if 'grcov' is in PATH."
 | |
|   echo "[!] Exiting..."
 | |
|   exit -1
 | |
| fi
 | |
| '''
 | |
| 
 | |
| [tasks.clean_profraw_files]
 | |
| description = "Cleans profraw files that are created by `cargo test`"
 | |
| script_runner = "@duckscript"
 | |
| script = ["""
 | |
|   rust_lib_profs = glob_array ./rust-lib/**/*.profraw
 | |
|   for prof in ${rust_lib_profs}
 | |
|     full_path = canonicalize ${prof}
 | |
|     rm ${full_path}
 | |
|   end
 | |
| 
 | |
|   shared_lib_profs = glob_array ../shared-lib/**/*.profraw
 | |
|   for prof in ${shared_lib_profs}
 | |
|     full_path = canonicalize ${prof}
 | |
|     rm ${full_path}
 | |
|   end
 | |
| 
 | |
|   """]
 | |
| 
 | |
| [tasks.run_rustlib_coverage_tests]
 | |
| description = "Run tests with coverage instrumentation"
 | |
| script_runner = "@shell"
 | |
| script = ["""
 | |
|   echo --- Running coverage tests ---
 | |
|   cd rust-lib/
 | |
| 
 | |
|   CARGO_INCREMENTAL=0 \
 | |
|   RUSTFLAGS='-C instrument-coverage' \
 | |
|   LLVM_PROFILE_FILE='prof-%p-%m.profraw' \
 | |
|   cargo test --no-default-features --features="sync,rev-sqlite"
 | |
|   """]
 | |
| 
 | |
| [tasks.run_sharedlib_coverage_tests]
 | |
| description = "Run tests with coverage instrumentation"
 | |
| script_runner = "@shell"
 | |
| script = ["""
 | |
|   echo --- Running coverage tests ---
 | |
|   cd ../shared-lib
 | |
| 
 | |
|   CARGO_INCREMENTAL=0 \
 | |
|   RUSTFLAGS='-C instrument-coverage' \
 | |
|   LLVM_PROFILE_FILE='prof-%p-%m.profraw' \
 | |
|   cargo test --no-default-features
 | |
| 
 | |
|   """]
 | |
| 
 | |
| [tasks.get_rustlib_grcov_report]
 | |
| description = "Get `grcov` HTML report for test coverage for rust-lib"
 | |
| script_runner = "@shell"
 | |
| script = [
 | |
|   """
 | |
|   echo --- Getting 'grcov' results for 'rust-lib' ---
 | |
|   cd rust-lib/
 | |
| 
 | |
|   grcov . \
 | |
|   --binary-path target/debug/deps \
 | |
|   --source-dir . \
 | |
|   --output-type html \
 | |
|   --branch \
 | |
|   --ignore-not-existing \
 | |
|   --log-level WARN \
 | |
|   --output-path target/coverage-html
 | |
| 
 | |
|   echo "--- Done! Generated HTML report under 'target/coverage-html' for rustlib."
 | |
|   """,
 | |
| ]
 | |
| 
 | |
| [tasks.get_sharedlib_grcov_report]
 | |
| description = "Get `grcov` HTML report for test coverage shared-lib"
 | |
| script_runner = "@shell"
 | |
| script = [
 | |
|   """
 | |
|   echo --- Getting 'grcov' results 'shared-lib' ---
 | |
|   cd ../shared-lib
 | |
| 
 | |
|   grcov . \
 | |
|   --binary-path target/debug/deps \
 | |
|   --source-dir . \
 | |
|   --output-type html \
 | |
|   --branch \
 | |
|   --ignore-not-existing \
 | |
|   --log-level WARN \
 | |
|   --output-path target/coverage-html
 | |
| 
 | |
|   echo "--- Done! Generated HTML report under 'target/coverage-html' for sharedlib."
 | |
|   """,
 | |
| ]
 | |
| 
 | |
| [tasks.get_grcov_report]
 | |
| description = "Get `grcov` HTML report for test coverage"
 | |
| run_task = { name = [
 | |
|   "get_rustlib_grcov_report",
 | |
|   "get_sharedlib_grcov_report",
 | |
| ], parallel = true }
 | |
| 
 | |
| [tasks.get_sharedlib_lcov_report]
 | |
| description = "Generates `lcov` report for `shared-lib`"
 | |
| script_runner = "@shell"
 | |
| script = ["""
 | |
|   echo Getting 'lcov' results for 'shared-lib'
 | |
| 
 | |
|   cd ../shared-lib
 | |
| 
 | |
|   grcov . \
 | |
|   --binary-path target/debug/deps \
 | |
|   --source-dir . \
 | |
|   --output-type lcov \
 | |
|   --branch \
 | |
|   --ignore-not-existing \
 | |
|   --log-level WARN \
 | |
|   --output-path target/coverage.lcov
 | |
| 
 | |
|   echo "--- Done! Generated 'target/coverage.lcov' sharedlib."
 | |
|   """]
 | |
| 
 | |
| [tasks.get_rustlib_lcov_report]
 | |
| description = "Generates `lcov` report for `rust-lib`"
 | |
| script_runner = "@shell"
 | |
| script = ["""
 | |
|   echo Getting 'lcov' results for 'rust-lib'
 | |
| 
 | |
|   cd rust-lib/
 | |
| 
 | |
|   grcov . \
 | |
|   --binary-path target/debug/deps \
 | |
|   --source-dir . \
 | |
|   --output-type lcov \
 | |
|   --branch \
 | |
|   --ignore-not-existing \
 | |
|   --log-level WARN \
 | |
|   --output-path target/coverage.lcov
 | |
| 
 | |
|   echo "--- Done! Generated 'target/coverage.lcov' for rustlib."
 | |
|   """]
 | |
| 
 | |
| [tasks.get_lcov_report]
 | |
| description = "Get `lcov` reports for test coverage"
 | |
| run_task = { name = [
 | |
|   "get_sharedlib_lcov_report",
 | |
|   "get_rustlib_lcov_report",
 | |
| ], parallel = true }
 | |
| 
 | |
| [tasks.rust_unit_test_with_coverage]
 | |
| description = "Run rust unit test with code coverage"
 | |
| run_task = { name = [
 | |
|   "check_grcov",
 | |
|   'appflowy-flutter-deps-tools',
 | |
|   "run_rustlib_coverage_tests",
 | |
|   "run_sharedlib_coverage_tests",
 | |
|   "get_lcov_report",
 | |
|   "clean_profraw_files",
 | |
| ] }
 |