From 0a33713f9f81f24961d45c26c47048f7882c4b99 Mon Sep 17 00:00:00 2001 From: Heitor Neiva Date: Wed, 18 Dec 2024 17:15:52 -0800 Subject: [PATCH] chore(tests): Add mocked keytool for pushapk init_worker tests --- tests/mocks/keytool | 4 ++++ tests/test_init.py | 13 +++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100755 tests/mocks/keytool diff --git a/tests/mocks/keytool b/tests/mocks/keytool new file mode 100755 index 000000000..3c3143926 --- /dev/null +++ b/tests/mocks/keytool @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# fake keytool +echo "Mocked keytool called with: $@" +exit 0 diff --git a/tests/test_init.py b/tests/test_init.py index edd357f62..2fe291e8d 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -267,14 +267,7 @@ def generate_params(): "dev", ) xfail = { - # pushapk needs keytool and certs - "pushapk-firefox-dev", - "pushapk-firefox-fake-prod", - "pushapk-firefox-prod", - "pushapk-mobile-dev", - "pushapk-mobile-fake-prod", - "pushapk-mobile-prod", - "pushapk-mozillavpn-prod", + # Add here any tests that are xfail } for app in apps: for product in products: @@ -303,6 +296,10 @@ def test_init_script(tmp_path, app_dir, app, product, environment): "TASKCLUSTER_ACCESS_TOKEN": "12345", } + if app == "pushapk": + mocks = (Path(__file__).parent / "mocks").resolve() + env["PATH"] = f"{mocks}:{os.environ.get('PATH', '')}" + if env["ENV"] == "prod": env["ED25519_PRIVKEY"] = "secret"