Skip to content

Commit

Permalink
Add test dependencies in manifest for ragger tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeutin-ledger committed Feb 22, 2024
1 parent 53c7b7b commit f59da13
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
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/*
!tests/.test_dependencies/.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"},
]
10 changes: 5 additions & 5 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ 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/`.
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`
* `tests/.test_dependencies/build/nanos/bin/app.elf`
* `tests/.test_dependencies/build/nanos2/bin/app.elf`
* `tests/.test_dependencies/build/nanox/bin/app.elf`
* `tests/.test_dependencies/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.
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/"

configuration.OPTIONAL.LOAD_MAIN_APP_AS_LIBRARY = True

Expand Down

0 comments on commit f59da13

Please sign in to comment.