Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Path issue when running tests #71

@owen9825

Description

@owen9825

Upon trying to run the tests in eg single_asset, there is an issue with the paths during the importing of different .mligo files:

ERROR: test_transfer_to_receiver (test_fa2.TestTransfer)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/test_fa2.py", line 181, in setUp
    super().setUp()
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/test_fa2.py", line 39, in setUp
    self.orig_contracts()
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/test_fa2.py", line 58, in orig_contracts
    self.fa2 = self.orig_fa2(ligo_fa2)
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/test_fa2.py", line 108, in orig_fa2
    ptz_storage = ligo_fa2.compile_storage(ligo_storage)
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/ligo.py", line 76, in compile_storage
    michelson = self._ligo_to_michelson_sanitized(command)
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/ligo.py", line 102, in _ligo_to_michelson_sanitized
    michelson = self._ligo_to_michelson(command)
  File "/home/owen/tezos/fa2-demo/smart-contracts/single_asset/tezos_fa2_single_tests/ligo.py", line 97, in _ligo_to_michelson
    raise Exception(msg)
Exception: in file "fa2_single_token.mligo", line 9, characters 9-37
Preprocessing error in file "fa2_single_token.mligo", line 9, characters 9-37:
File "../fa2/fa2_interface.mligo" to include not found.

Here I've installed the smart-contracts directory as a submodule within /home/owen/tezos/fa2-demo/.

I had first tried running the tests in smart-contracts/nft_assets, but had some Python errors there too, in tezos_fa2_nft_tests/test_fa2.py where the reference to pytezos.rpc.errors must've been out of date − happy to submit a PR for that once I can get these tests running :) (same LIGO path issue).

The errors occur as soon as relative paths are used, eg in fa2_single_token.mligo:

…
#include "../fa2/fa2_interface.mligo"

I was invoking the test from ~/tezos/fa2-demo/smart-contracts/single_asset

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions