Skip to content

Commit 78e979e

Browse files
authored
Merge pull request #513 from AppFlowy-IO/add_test_command
chore: add test comand in cargo make
2 parents 1170e03 + 7a7ec10 commit 78e979e

File tree

3 files changed

+40
-24
lines changed

3 files changed

+40
-24
lines changed

frontend/Makefile.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ extend = [
77
{ path = "scripts/makefile/docker.toml" },
88
{ path = "scripts/makefile/env.toml" },
99
{ path = "scripts/makefile/flutter.toml" },
10+
{ path = "scripts/makefile/tool.toml" },
1011
]
1112

1213
[config]
Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
11

2-
[tasks.test_local]
3-
category = "Build"
4-
dependencies = ["rm_cache"]
5-
description = "Build desktop targets."
2+
[tasks.rust_unit_test]
3+
run_task = { name = ["rust_lib_unit_test", "shared_lib_unit_test"] }
4+
5+
[tasks.rust_lib_unit_test]
6+
description = "Run rust-lib unit tests"
67
script = '''
78
cd rust-lib
8-
cargo test
9+
RUST_LOG=info cargo test --no-default-features --features="sync"
910
'''
1011

12+
[tasks.shared_lib_unit_test]
13+
description = "Run shared-lib unit test"
14+
script = '''
15+
cd ../shared-lib
16+
RUST_LOG=info cargo test --no-default-features
17+
'''
1118

12-
[tasks.test_remote]
13-
dependencies = ["rm_cache"]
14-
script = """
15-
cd rust-lib
16-
cargo test --features "flowy-folder/http_server","flowy-user/http_server"
17-
"""
18-
19-
20-
[tasks.run_server]
21-
script = """
22-
cd backend
23-
cargo run
24-
"""
25-
26-
27-
[tasks.rm_cache]
28-
script = """
29-
rm -rf rust-lib/flowy-test/temp
30-
"""
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[tasks.rust_clean]
2+
script = [
3+
"""
4+
cd rust-lib
5+
cargo clean
6+
7+
cd ../../shared-lib
8+
cargo clean
9+
10+
rm -rf lib-infra/.cache
11+
""",
12+
]
13+
script_runner = "@shell"
14+
15+
[tasks.rust_clean.windows]
16+
script = [
17+
"""
18+
cd rust-lib
19+
cargo clean
20+
21+
cd ../../shared-lib
22+
cargo clean
23+
24+
rmdir /s/q "lib-infra/.cache"
25+
""",
26+
]
27+
script_runner = "@duckscript"

0 commit comments

Comments
 (0)