[go: up one dir, main page]

WIP: Recreate Michelson ADD opcode test in Alcotest (copied from Pytest)

Context

This was a little project given to me by @galfour for evaluation purposes.

Manually testing the MR

Run make test-unit to run all Alcotest tests - all tests should pass. Then break tests_python/contracts/opcodes/add.tz (perhaps by changing one of the PUSH int 2;s to PUSH int 3;), and re-run make test-unit - the "add" test should fail.

Extra notes

I wasn't sure whether to delete the test from Pytest. Also, I ran into a weird issue where the test code was failing to read files outside of the src/proto_alpha/lib_protocol/test/contracts folder. I want to create an opcodes folder within that directory, but when I tried I repeatedly got an error reading "No such file or directory" when calling open_in. (It's likely I'm just making a silly mistake that will be obvious in the morning)

It should be straightforward to move many of the tests from tests_python/tests/test_contract_opcodes.py to Alcotest without many changes. I would have just moved them all, but I couldn't figure out how to read Michelson's output and wanted to sign off for today. I'd be happy to finish that up tomorrow!

Merge request reports

Loading