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

Improve testing of static assets in Debian packaging #5644

Merged
merged 1 commit into from
Nov 19, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions molecule/builder-xenial/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
Import variables from vars.yml and inject into testutils namespace
"""

import os
import io
import yaml
import testutils
from pathlib import Path
import subprocess

import pytest

filepath = os.path.join(os.path.dirname(__file__), "vars.yml")
with io.open(filepath, 'r') as f:
securedrop_test_vars = yaml.safe_load(f)

# Tack on target OS for use in tests
securedrop_target_platform = os.environ.get("SECUREDROP_TARGET_PLATFORM")
securedrop_test_vars["securedrop_target_platform"] = securedrop_target_platform

testutils.securedrop_test_vars = testutils.inject_vars(securedrop_test_vars)
@pytest.fixture(scope="session")
def securedrop_root() -> Path:
"""
Returns the root of the SecureDrop working tree for the test session.
"""
return Path(
subprocess.run(
["git", "rev-parse", "--show-toplevel"], stdout=subprocess.PIPE, check=True
)
.stdout.decode("utf-8")
.strip()
)
Loading