Skip to content

Commit

Permalink
ouit
Browse files Browse the repository at this point in the history
  • Loading branch information
sgliner-ledger committed Oct 18, 2023
1 parent 40a60b7 commit 8b539ee
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
12 changes: 10 additions & 2 deletions input_files/extra_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@
"build_blacklist": ["nanos", "nanosp", "nanox", "stax"],
"test_blacklist": ["nanos", "nanosp", "nanox", "stax"]
},
{
"name": "app-boilerplate-vierzon",
"test_blacklist": ["nanos", "nanosp", "nanox", "stax"]
},
{
"name": "app-btec",
"build_blacklist": ["stax"],
Expand Down Expand Up @@ -388,7 +392,8 @@
},
{
"name": "app-mina",
"test_dir": "tests"
"test_dir": "tests",
"extra_flags": "RELEASE_BUILD=0"
},
{
"name": "app-mobilecoin",
Expand Down Expand Up @@ -710,7 +715,10 @@
},
{
"name": "app-security-key",
"test_dir": "tests/speculos"
"test_dir": "tests/speculos",
"test_blacklist": ["stax"],
"test_param_nanosp": "--fast",
"test_param_nanox": "--transport HID --fast"
},
{
"name": "app-sia",
Expand Down
7 changes: 7 additions & 0 deletions input_files/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,7 @@
"name": "app-boilerplate-vierzon",
"owner": "LedgerHQ",
"ref": "master",
"test_blacklist": ["nanos", "nanosp", "nanox", "stax"],
"url": "https://github.com/LedgerHQ/app-boilerplate-vierzon",
"variant_param": "COIN",
"variants_nanos": [
Expand Down Expand Up @@ -2337,6 +2338,7 @@
"ref": "develop",
"url": "https://github.com/LedgerHQ/app-mina",
"test_dir": "tests",
"extra_flags": "RELEASE_BUILD=0",
"variant_param": "COIN",
"variants_nanos": [
"mina"
Expand Down Expand Up @@ -4016,7 +4018,12 @@
"owner": "LedgerHQ",
"ref": "develop",
"url": "https://github.com/LedgerHQ/app-security-key",
"test_blacklist": [
"stax"
],
"test_dir": "tests/speculos",
"test_param_nanosp": "--fast",
"test_param_nanox": "--transport HID --fast",
"variant_param": "APP",
"variants_nanox": [
"SecurityKey"
Expand Down
21 changes: 13 additions & 8 deletions scripts/build_and_test/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from build_app import build_variant
from utils import run_cmd

def test(model: str, app_test_path: Path, app_build_path: Path):
def test(model: str, app_test_path: Path, app_build_path: Path, test_params: str):
output = {}
error = run_cmd(f"pytest {app_test_path}/ --tb=short -v --device {model}", cwd=app_build_path, no_throw=True)
error = run_cmd(f"pytest {app_test_path}/ --tb=short -v --device {model} {test_params}", cwd=app_build_path, no_throw=True)

if (error):
output = "Fail"
Expand All @@ -19,7 +19,8 @@ def install_dependencies(app_test_path: Path):
error = run_cmd("pip install -r requirements.txt", cwd=app_test_path, no_throw=True)
return error

def test_device(device: Device, variant_param: str, app_build_path: Path, app_test_path: Path, sdk_path: Path, extra_flags: str, blacklist: str):
def test_device(device: Device, variant_param: str, app_build_path: Path, app_test_path: Path,
sdk_path: Path, extra_flags: str, blacklist: str, test_params: str):
test_output = {}

if not device.selected:
Expand All @@ -35,7 +36,7 @@ def test_device(device: Device, variant_param: str, app_build_path: Path, app_te
if build_variant(device.target_name, sdk_path, "", "", app_build_path, extra_flags):
return "Fail"

test_output = test(device.model_name, app_test_path, app_build_path)
test_output = test(device.model_name, app_test_path, app_build_path, test_params)

print(test_output)
return test_output
Expand All @@ -56,18 +57,22 @@ def test_all_devices(devices: Devices, sdk_path: Path, app_json: dict, workdir:

blacklist = app_json.get(f"test_blacklist", [])

test_params = app_json.get("test_param_nanos", "")
nanos_output = test_device(devices.nanos, variant_param, app_build_path, app_test_path,
sdk_path, extra_flags, blacklist)
sdk_path, extra_flags, blacklist, test_params)

test_params = app_json.get("test_param_nanosp", "")
nanosp_output = test_device(devices.nanosp, variant_param, app_build_path, app_test_path,
sdk_path, extra_flags, blacklist)
sdk_path, extra_flags, blacklist, test_params)


test_params = app_json.get("test_param_nanox", "")
nanox_output = test_device(devices.nanox, variant_param, app_build_path, app_test_path,
sdk_path, extra_flags, blacklist)
sdk_path, extra_flags, blacklist, test_params)

test_params = app_json.get("test_param_stax", "")
stax_output = test_device(devices.stax, variant_param, app_build_path, app_test_path,
sdk_path, extra_flags, blacklist)
sdk_path, extra_flags, blacklist, test_params)

if nanos_output:
output["test"]["nanos"] = nanos_output
Expand Down

0 comments on commit 8b539ee

Please sign in to comment.