marigold-dev / chusai

MIT License
5 stars 0 forks source link

Some weird errors with make build/test #20

Closed Hakimba closed 2 years ago

Hakimba commented 2 years ago

I had kind of the same issue with make build and make test when i was reviewing PR#5 and @odeac / @rueshyna fixed the problem and it worked, but right know with main i still have issues : weird type annotation errors + the include not found

hakimba@pc chusai % make build
make -C layer1 build
make -C wallet build
mkdir -p ../../_build/layer1/
docker run --rm -v /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1:/Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 -w /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 ligolang/ligo:0.42.0 compile contract --protocol ithaca wallet/src/wallet_sc.mligo > ../../_build/layer1//wallet_sc.tez
File "wallet/src/../../commons/ticket_api_workaround.mligo", line 54, characters 52-87:

Warning: The type of this value is ambiguous: Inferred type is chusai_ticket but could be of type chusai_ticket.
Hint: You might want to add a type annotation. 

File "wallet/src/../../commons/ticket_api_workaround.mligo", line 54, characters 16-50:

Warning: The type of this value is ambiguous: Inferred type is chusai_ticket but could be of type chusai_ticket.
Hint: You might want to add a type annotation. 

File "wallet/src/../../commons/ticket_api_workaround.mligo", line 40, characters 12-39:

Warning: The type of this value is ambiguous: Inferred type is chusai_ticket but could be of type chusai_ticket.
Hint: You might want to add a type annotation. 

make -C mint build
ligo compile contract src/mint_sc.mligo > ../../_build/mint_sc.tz
File "src/mint_sc.mligo", line 1, characters 9-45:
File "src/mint_sc.mligo", line 1, characters 9-45:
File "../../commons/mint_interface.mligo" to include not found.
make[2]: *** [build] Error 1
make[1]: *** [build] Error 2
make: *** [build] Error 2

and

hakim@pc chusai % make test
make -C layer1 test
make -C wallet test
docker run --rm -v /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1:/Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 -w /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 ligolang/ligo:0.41.0  run test --protocol ithaca stdlib_ext/test/test_main.mligo
Everything at the top-level was executed.
- test_OptionExt_bind exited with value ().
- test_ListExt_reverse exited with value ().
- test_ListExt_concat exited with value ().
- test_ListExt_join exited with value ().
- test_ListExt_bind exited with value ().
- test_ListExt_find exited with value ().
- test_ListExt_filter exited with value ().
- test_ListExt_cat_options exited with value ().
- test_ListExt_sequence_options exited with value ().
- test_ListExt_intercalate exited with value ().
- test_StringExt_concat_all exited with value ().
docker run --rm -v /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1:/Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 -w /Users/hakimbaaloudj/computer-science/marigold/chusai/layer1 ligolang/ligo:0.41.0  run test --protocol ithaca wallet/test/test_main.mligo
Everything at the top-level was executed.
- test_Wallet_sc_mint_xtz_with_0tez exited with value ().
- test_Wallet_sc_mint_xtz_with_10tez exited with value ().
- test_Wallet_sc_minted_ticket_and_join_with_existed_ticket_in_storage exited with value ().
- test_Wallet_sc_join_arbitary_ticket_and_ticket_in_storage exited with value ().
- test_Wallet_sc_sending exited with value ().
- test_Wallet_sc_sending_when_storage_is_none exited with value ().
- test_Wallet_sc_redeem_xtz_with_ticket exited with value ().
- test_Wallet_sc_redeem_xtz_with_storage_None exited with value ().
make -C mint test
ligo run test test/test_mint_sc.mligo
File "../src/mint_sc.mligo", line 1, characters 9-45:
File "../src/mint_sc.mligo", line 1, characters 9-45:
File "../../commons/mint_interface.mligo" to include not found.
make[2]: *** [test] Error 1
make[1]: *** [test] Error 2
make: *** [test] Error 2

I don't get the type annotation errors from but the include issue seems to be related to the fact that I have to be in a folder above "mint_interface.mligo" (or any file included) for ligo run test to work

examples by hand :

hakim@pc layer1 %  ligo run test mint/test/test_mint_sc.mligo 
Everything at the top-level was executed.
- test_inline_conversion_mutez exited with value Success (0n).
- test_inline_conversion_tez exited with value Success (0n).
- test_inline_conversion_42tez exited with value Success (0n).
- test_inline_conversion_chusai_tez exited with value Success (0n).
- test_inline_conversion_chusai_100mutez exited with value Success (0n).
- test_inline_conversion_chusai_1mutez exited with value Success (0n).
- test_mint_origination exited with value Success (0n).
- test_mint_first_ticket exited with value Fail (Rejected (("compare_tickets : wrong address" , KT1K5r8EbRszjx9ufnC2kwhoQfmRVuM2QF8m))).
- test_mint_first_ticket_mutez exited with value Success (0n).
- test_mint_first_ticket_0tez exited with value Success (0n).
- test_mint_and_redeem exited with value Fail (Other ("assert_is_ok : sanity check : Minting should have succeeded")).
- test_redeem_0value_ticket exited with value Success (0n).
- test_redeem_at_wrong_mint exited with value Fail (Other ("assert_is_ok : sanity check : Minting should have succeeded")).
hakim@pc mint % ligo run test test/test_mint_sc.mligo 
File "../src/mint_sc.mligo", line 1, characters 9-45:
File "../src/mint_sc.mligo", line 1, characters 9-45:
File "../../commons/mint_interface.mligo" to include not found.
hakimbaaloudj@MBP-de-Hakim mint % 

The problem is, the makefile which run ligo run test test/test_mint_sc.mligo is in mint directory, so it doesn't work. As i'm the only who report that i guess that i'm (again) the only one who face this issue ?

rueshyna commented 2 years ago
rueshyna commented 2 years ago

I found out something wrong with make test and I made a fix. https://github.com/marigold-dev/chusai/pull/21