Skip to content
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
6 changes: 6 additions & 0 deletions src/vars/tuning/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@
min_cpu_cores: 4
min_ram_mb: 10240

foreman_puma_workers: 2

pulp_worker_count: 2
pulp_content_service_worker_count: 2
pulp_api_service_worker_count: 2

candlepin_java_opts_xms: 512m
candlepin_java_opts_xmx: 2g
28 changes: 23 additions & 5 deletions tests/unit/tuning_test.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
import os

import pytest
import yaml

TEST_DIR = os.path.dirname(os.path.abspath(__file__))
TUNING_DIR = os.path.abspath(os.path.join(TEST_DIR, '..', '..', 'src', 'vars', 'tuning'))


def test_development_tuning_limits_candlepin_heap():
with open(os.path.join(TUNING_DIR, 'development.yml'), 'r') as tuning_file:
tuning = yaml.safe_load(tuning_file)
def load_tuning_profile(name):
with open(os.path.join(TUNING_DIR, f'{name}.yml'), 'r') as tuning_file:
return yaml.safe_load(tuning_file)

assert tuning['candlepin_java_opts_xms'] == '512m'
assert tuning['candlepin_java_opts_xmx'] == '2g'

@pytest.fixture
def development_tuning():
return load_tuning_profile('development')


def test_development_tuning_limits_puma_workers(development_tuning):
assert development_tuning['foreman_puma_workers'] == 2


def test_development_tuning_limits_pulp_workers(development_tuning):
assert development_tuning['pulp_worker_count'] == 2
assert development_tuning['pulp_content_service_worker_count'] == 2
assert development_tuning['pulp_api_service_worker_count'] == 2


def test_development_tuning_limits_candlepin_heap(development_tuning):
assert development_tuning['candlepin_java_opts_xms'] == '512m'
assert development_tuning['candlepin_java_opts_xmx'] == '2g'
Loading