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

Update tests to be able to run using a leap dev-install package. #355

Closed
wants to merge 39 commits into from

Conversation

oschwaldp-oci
Copy link
Contributor

Depends on: AntelopeIO/leap#818

sys.path.append(os.path.join(os.getcwd(), "tests"))

from TestHarness import Cluster, TestHelper, Utils, WalletMgr
os.environ["CORE_SYMBOL_NAME"]='EOS'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we just overwrite leap/build/tests/core_symbol.py with

CORE_SYMBOL='EOS'

before running the nodeos_trust_evm_test.py ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not after AntelopeIO/leap#818

That change in leap's testing libs is being made to help EVM CI (and possibly other CI, like eosjs) so it can just

apt install leap.deb leap-dev.deb cdt.deb

and then, after completing the EVMnode & EVMcontract builds, have everything it needs to run the integration tests. That way the EVM repo's CI doesn't need to build/patch its own leap testing libraries. It helps in providing some isolation between repos, making the built .deb package a clear delineation point.

- name: Test Leap Integration
run: |
pip install web3
export PYTHONPATH=/usr/local/lib/python3/dist-packages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did something change? afaik all this should be installed in /usr when built in CI
https://github.com/AntelopeIO/leap/blob/main/.github/workflows/build_base.yaml#L80

Copy link
Contributor Author

@oschwaldp-oci oschwaldp-oci Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I'm endeavoring to figure out. I just did build using the pinned_build.sh script and then installed the lead-dev pkg it created from the v4.0.4 tag. Using dpkg -L leap-dev it appeared that TestHarness was installed in /usr/local/lib/python3/dist-packages/TestHarness. But it still isn't finding the module there either. Or rather, it is a symlink to /usr/local/share/leap_testing/tests/TestHarness

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, pinned_build.sh does /usr/local by default (but not in CI where it's also /usr)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted. Updated the location where it installed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to export PYTHONPATH in this case, where the test in leap doesn't need to?
https://github.com/AntelopeIO/leap/blob/main/.github/workflows/build.yaml#L98

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to chase that down. My current theory is that the symlink isn't being created to put the TestHarness into the python3/dist-packages. This build is running cmake version 3.26.4. Not sure which version is being used over in the leap workflow since there is a switch in https://github.com/AntelopeIO/leap/blob/78c1b62a76b37ac3531e526b8434c1ce54a451c2/CMakeLists.txt#L252

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dpkg -L leap-dev | grep TestHarness in this workflow is not showing the symlink:

/usr/share/leap_testing/tests/TestHarness
/usr/share/leap_testing/tests/TestHarness/Cluster.py
/usr/share/leap_testing/tests/TestHarness/Node.py
/usr/share/leap_testing/tests/TestHarness/TestHelper.py
/usr/share/leap_testing/tests/TestHarness/WalletMgr.py
/usr/share/leap_testing/tests/TestHarness/__init__.py
/usr/share/leap_testing/tests/TestHarness/core_symbol.py
/usr/share/leap_testing/tests/TestHarness/depresolver.py
/usr/share/leap_testing/tests/TestHarness/interfaces.py
/usr/share/leap_testing/tests/TestHarness/launch_transaction_generators.py
/usr/share/leap_testing/tests/TestHarness/libc.py
/usr/share/leap_testing/tests/TestHarness/logging-template.json
/usr/share/leap_testing/tests/TestHarness/logging.py
/usr/share/leap_testing/tests/TestHarness/queries.py
/usr/share/leap_testing/tests/TestHarness/testUtils.py
/usr/share/leap_testing/tests/TestHarness/transactions.py

https://github.com/eosnetworkfoundation/eos-evm/actions/runs/5613879938/job/15210866007

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although local build (note: using pinned_build.sh to create leap-dev) with cmake version 3.22.1 does:

/usr/local/share/leap_testing/tests/TestHarness
/usr/local/share/leap_testing/tests/TestHarness/Cluster.py
/usr/local/share/leap_testing/tests/TestHarness/Node.py
/usr/local/share/leap_testing/tests/TestHarness/TestHelper.py
/usr/local/share/leap_testing/tests/TestHarness/WalletMgr.py
/usr/local/share/leap_testing/tests/TestHarness/__init__.py
/usr/local/share/leap_testing/tests/TestHarness/core_symbol.py
/usr/local/share/leap_testing/tests/TestHarness/depresolver.py
/usr/local/share/leap_testing/tests/TestHarness/interfaces.py
/usr/local/share/leap_testing/tests/TestHarness/launch_transaction_generators.py
/usr/local/share/leap_testing/tests/TestHarness/libc.py
/usr/local/share/leap_testing/tests/TestHarness/logging-template.json
/usr/local/share/leap_testing/tests/TestHarness/logging.py
/usr/local/share/leap_testing/tests/TestHarness/queries.py
/usr/local/share/leap_testing/tests/TestHarness/testUtils.py
/usr/local/share/leap_testing/tests/TestHarness/transactions.py
/usr/local/lib/python3/dist-packages/TestHarness

So from that perspective it doesn't look like a cmake version problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where: /usr/local/lib/python3/dist-packages/TestHarness -> ../../../share/leap_testing/tests/TestHarness

Copy link
Contributor Author

@oschwaldp-oci oschwaldp-oci Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that this is due to the postinst script relying on CMAKE_INSTALL_FULL_LIBDIR in v4.0.4 which sets the path for the symlink incorrectly to: ln -s ../../../share/leap_testing/tests/TestHarness /usr/lib/x86_64-linux-gnu/python3/dist-packages/TestHarness.

This has been fixed in main: https://github.com/AntelopeIO/leap/blob/main/scripts/postinst

Thus, currently setting the PYTHONPATH is a workaround to allow discovery of the installed python modules from leap-dev

Need to link TestHarness into typical python dist-packages. This is taken care of automatically in the install in leap main but not in v4.0.4 being used here.

TestHarness has a dependency on cleos which currently is not installed in the leap-dev package, so need leap package for now as well.
PYTHONPATH was not what we wanted here anyway.

Also believe we can remove the concrete version specification for web3 as it was not the cause of the issue.
Update Web3 functions now using snake case instead of camel case.

Update tx_wrapper index.js to use fetch import over require.

Workflow needs to install some dependencies as documented in test.
Break out step for update package index and upgrading packages first.

Add step to check versions and check tx_wrapper logs.
@oschwaldp-oci
Copy link
Contributor Author

Superseded by: eosnetworkfoundation/eos-evm-node#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants