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

chore(tests): Add mocked keytool for pushapk init_worker tests #1107

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/mocks/keytool
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
# fake keytool
echo "Mocked keytool called with: $@"
exit 0
13 changes: 5 additions & 8 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"

Expand Down