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

Add test dependencies in manifest for ragger tests #131

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
with:
download_app_binaries_artifact: plugin_binaries
additional_app_binaries_artifact: ethereum_build_develop
additional_app_binaries_artifact_dir: ./tests/ethereum_build/build
additional_app_binaries_artifact_dir: ./tests/.test_dependencies/ethereum/build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ ledger/
tests/snapshots-tmp/

# Directory storing the ethereum build output for tests run
tests/ethereum_build/build/
tests/.test_dependencies/ethereum/*
!tests/.test_dependencies/ethereum/.ethereum_application_build_goes_there
8 changes: 8 additions & 0 deletions ledger_app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ devices = ["nanos", "nanox", "nanos+", "stax"]

[tests]
pytest_directory = "./tests/"

[tests.dependencies]
testing_with_prod = [
{url = "https://github.com/LedgerHQ/app-ethereum", ref = "master", use_case = "use_test_keys"},
]
testing_with_latest = [
{url = "https://github.com/LedgerHQ/app-ethereum", ref = "develop", use_case = "use_test_keys"},
]
17 changes: 9 additions & 8 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ In order to run the tests you need to provide the binaries for both the plugin a

Compiling the plugin will produce the binary for the targeted device. They will be used as-is by the test framework.

The binaries of the Ethereum application must be gathered and placed in the directory `tests/ethereum_build/`.
The binaries of the Ethereum application must be gathered and placed in the directory `tests/.test_dependencies/ethereum/`.
Example of the correct file tree with Ethereum compiled for all targets.
* `tests/ethereum_build/build/nanos/bin/app.elf`
* `tests/ethereum_build/build/nanos2/bin/app.elf`
* `tests/ethereum_build/build/nanox/bin/app.elf`
* `tests/ethereum_build/build/stax/bin/app.elf`

The first method is to go in the Ethereum project, compile the application, and dispatch the `build/` output directory.
A second method is to re-use the Ethereum build used in the CI, and available as artifact.
* `tests/.test_dependencies/ethereum/build/nanos/bin/app.elf`
* `tests/.test_dependencies/ethereum/build/nanos2/bin/app.elf`
* `tests/.test_dependencies/ethereum/build/nanox/bin/app.elf`
* `tests/.test_dependencies/ethereum/build/stax/bin/app.elf`

The first method is to use the Ledger VSCode extension to automatically manage dependencies
The second method is to go in the Ethereum project, compile the application, and dispatch the `build/` output directory.
A third method is to re-use the Ethereum build used in the CI, and available as artifact.
For example in the [plugin-boilerplate CI](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/build_and_functional_tests.yml).


Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# You can configure optional parameters by overriding the value of ragger.configuration.OPTIONAL_CONFIGURATION
# Please refer to ragger/conftest/configuration.py for their descriptions and accepted values

configuration.OPTIONAL.APP_DIR = "tests/ethereum_build/"
configuration.OPTIONAL.APP_DIR = "tests/.test_dependencies/"
fbeutin-ledger marked this conversation as resolved.
Show resolved Hide resolved

configuration.OPTIONAL.LOAD_MAIN_APP_AS_LIBRARY = True

Expand Down