Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Useful move-cli tests should be added to aptos code base #13119

Open
brmataptos opened this issue Apr 29, 2024 · 7 comments
Open

[Bug] Useful move-cli tests should be added to aptos code base #13119

brmataptos opened this issue Apr 29, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@brmataptos
Copy link
Contributor

brmataptos commented Apr 29, 2024

🐛 Bug

The move-cli crate is in an inconsistent state and should be removed, which however, requires cutting some upstream dependencies.

For example:

I don't seem able to trigger the tests that are recorded in exp files such as third_party/move/tools/move-cli/tests/build_tests/unbound_dependency/args.evm.exp
In particular,

UB=1 cargo test - move-cli

runs other tests, but not the EVM tests.

It seems likely that tests with evm-backend feature are not being run, so probably also the ones corresponding to outputs
third_party/move/tools/move-unit-test/tests/test_sources/address_args.evm.exp

@brmataptos brmataptos added the bug Something isn't working label Apr 29, 2024
@brmataptos
Copy link
Contributor Author

To regenerate these files, we can run cargo test --features "evm-backend" --test build_testsuite_evm -p move-cli -p move-unit-test but this currently doesn't even compile.

brmataptos added a commit that referenced this issue Apr 29, 2024
aptos-move/move-examples are run with
`MOVE_COMPILER_V2=true cargo test`.

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.)
@brmataptos brmataptos mentioned this issue Apr 29, 2024
21 tasks
@brmataptos
Copy link
Contributor Author

After #13125 lands these will at least compile. More work is required to fix the test outputs. Notably, the attribute maps don't seem to be readily available in test_runner.rs. Notably, the compilation process output in third_party/move/tools/move-cli/tests/move_unit_tests/assign_dev_addr_for_dep/args.evm.exp will fail, as we need to pass the dev-addresses defined in Move.toml to the compilation.

brmataptos added a commit that referenced this issue Apr 30, 2024
aptos-move/move-examples are run with
`MOVE_COMPILER_V2=true cargo test`.

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.)
@wrwg
Copy link
Contributor

wrwg commented Apr 30, 2024

Those tests are dead since a while and the .exp where left there. These are smoke tests for evm integration into the move cli, and not relevant for for testing of the evm compiler. Basically all tests in move-cli are obsolete, the entire crate is deprecated and should be removed, which requires dealing with a few upstream dependencies.

@wrwg wrwg closed this as completed Apr 30, 2024
@wrwg wrwg reopened this Apr 30, 2024
@wrwg wrwg changed the title [Bug] evm tests don't seem to be running (those depending on feature evm-backend, probably) [Bug] move-cli crate should be removed Apr 30, 2024
@wrwg
Copy link
Contributor

wrwg commented Apr 30, 2024

I reopened and renamed the bug to remove that crate. Lets not invest any time in trying to fix anything here.

@brmataptos
Copy link
Contributor Author

brmataptos commented Apr 30, 2024 via email

@wrwg
Copy link
Contributor

wrwg commented Apr 30, 2024

These tests were deactivated like one year ago or so.

@brmataptos
Copy link
Contributor Author

The move-cli tests were the only way I was able to reproduce and debug the V2 disassembler problem. We need a replacement.

@brmataptos brmataptos changed the title [Bug] move-cli crate should be removed [Bug] Useful move-cli tests should be added to aptos code base May 3, 2024
brmataptos added a commit that referenced this issue May 27, 2024
aptos-move/move-examples are run with
`MOVE_COMPILER_V2=true cargo test`.

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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants