aptos-core
aptos-core copied to clipboard
Fix #12958: tests being run from library code when aptos-move/move-examples are run with `MOVE_COMPILER_V2=true cargo test`.
Description
Fixes #12958.
Change compiler-v2 sources and dependencies from Vec<String>
filenames to Vec<PackagePaths>
full package descriptors.
This attaches a package name to input files, allowing a
filter to limit unit tests to the current package. Since
these are bigger structures, we pass &
instead of object.
There is some messiness due to PackagePaths
really being
a generic type with default instantiation using
move_symbol_pool::Symbol
which isn't common in the
move-model code.
Also, it turns out that disassembler uses script module
names whose name mangling has changed, so there is a
change to move-cli/src/base/disassemble.rs
, along with
a more verbose error (listing the available functions)
in the case of a failure to find the requested module,
which was useful debugging and was left in.
Since related code was touched in EVM-related code in
third_party/move/tools/move-unit-test/src/test_runner.rs
I fixed it to compile but there is still an issue with
the named_address_map
which I haven't debugged.
(See Issue #13119.)
Key Areas to Review
This can be refactored later, so keep that in mind. It's still a bit messy, but if you can understand what's going on (after reading the description above) it may be easier to wait until we separate compilers to do some of the remaining cleanup.
Type of Change
- [ ] New feature
- [x] Bug fix
- [ ] Breaking change
- [ ] Performance improvement
- [ ] Refactoring
- [ ] Dependency update
- [ ] Documentation update
- [x] Tests
Which Components or Systems Does This Change Impact?
- [ ] Validator Node
- [ ] Full Node (API, Indexer, etc.)
- [x] Move/Aptos Virtual Machine
- [ ] Aptos Framework
- [ ] Aptos CLI/SDK
- [ ] Developer Infrastructure
- [ ] Other (specify)
How Has This Been Tested?
Cargo test run with various options (MOVE_COMPILER_V2=true
and not).
Checklist
- [x] I have read and followed the CONTRIBUTING doc
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I identified and added all stakeholders and component owners affected by this change as reviewers
- [x] I tested both happy and unhappy path of the functionality
- [ ] I have made corresponding changes to the documentation
⏱️ 4h 36m total CI duration on this PR
Job | Cumulative Duration | Recent Runs |
---|---|---|
rust-move-unit-coverage | 1h 32m | 🟩 🟩 ⬜ 🟩 🟩 |
rust-targeted-unit-tests | 1h 11m | 🟥 🟥 ⬜ 🟩 🟩 |
rust-move-tests | 50m | 🟩 🟩 🟩 🟩 🟩 |
rust-lints | 22m | 🟥 🟥 🟥 🟥 🟩 |
run-tests-main-branch | 21m | 🟩 🟩 🟩 🟩 🟩 |
general-lints | 9m | 🟩 🟩 🟩 🟩 🟩 |
check-dynamic-deps | 6m | 🟩 🟩 🟩 🟩 🟩 |
semgrep/ci | 2m | 🟩 🟩 🟩 🟩 🟩 |
file_change_determinator | 53s | 🟩 🟩 🟩 🟩 🟩 |
file_change_determinator | 52s | 🟩 🟩 🟩 🟩 🟩 |
permission-check | 15s | 🟩 🟩 🟩 🟩 🟩 |
permission-check | 14s | 🟩 🟩 🟩 🟩 🟩 |
permission-check | 14s | 🟩 🟩 🟩 🟩 🟩 |
permission-check | 10s | 🟩 🟩 🟩 🟩 🟩 |
🚨 1 job on the last run was significantly faster/slower than expected
Job | Duration | vs 7d avg | Delta |
---|---|---|---|
rust-targeted-unit-tests | 23m | 16m |
Codecov Report
Attention: Patch coverage is 64.39394%
with 94 lines
in your changes are missing coverage. Please review.
Project coverage is 57.5%. Comparing base (
270917f
) to head (5600ccc
).
:exclamation: Current head 5600ccc differs from pull request most recent head ec83051
Please upload reports for the commit ec83051 to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@
## main #13125 +/- ##
===========================================
+ Coverage 33.1% 57.5% +24.3%
===========================================
Files 1753 832 -921
Lines 337763 198003 -139760
===========================================
+ Hits 111995 113923 +1928
+ Misses 225768 84080 -141688
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.