Open IsaacCisnerosFT opened 3 weeks ago
Hi @IsaacCisnerosFT, thanks for reporting this. I am wondering whether you have run aptos move test --coverage
before running aptos move coverage source --module my_module --dev
and if so, is there any error generated? Note that currently if there are failing tests in your code, the coverage map will not be generated, which may lead to the issue you mentioned.
Around this case it looks like there's a couple cases where the coverage map won't be created (this has probably existed forever).
The below example, won't create a coverage map, and then will fail with that error.
module 0x42::test {
fun break_me() {
}
}
This seems unideal, but the coverage tool doesn't generate a coverage map in the event of a test that succeeds compilation, but fails on running the tests
module 0x42::test {
fun break_me() {
}
#[test]
fun test_fun() {
abort 1; // Fail test on purpose
}
}
#[test]
functionmodule 0x42::test {
fun break_me() {
}
/*#[test]
fun test_fun() {
abort 1; // Fail test on purpose
}*/
}
🐛 Bug
Aptos coverage tool is unable to run due to missing coverage map file
To reproduce
Code snippet to reproduce
Stack trace/error message
Expected Behavior
Test coverage information is displayed correctly for the current package.
System information
OS: MacOs Sonoma 14.5
Aptos info output: { "Result": { "build_branch": "", "build_cargo_version": "cargo 1.78.0", "build_clean_checkout": "true", "build_commit_hash": "", "build_is_release_build": "true", "build_os": "macos-aarch64", "build_pkg_version": "3.4.1", "build_profile_name": "cli", "build_rust_channel": "", "build_rust_version": "rustc 1.78.0 (9b00956e5 2024-04-29) (Homebrew)", "build_tag": "", "build_time": "2024-05-31 15:28:32 +00:00", "build_using_tokio_unstable": "true" } }
Additional context
Manually creating the missing folder does not work.