Have registry tests run against both data models (old and new)
This commit is contained in:
parent
849e613386
commit
8985d8f106
3 changed files with 27 additions and 7 deletions
|
@ -17,6 +17,7 @@ from data.database import (close_db_filter, configure, DerivedStorageForImage, Q
|
|||
TagManifest, TagManifestToManifest, Manifest, ManifestLegacyImage,
|
||||
ManifestBlob)
|
||||
from data import model
|
||||
from data.registry_model import registry_model
|
||||
from endpoints.csrf import generate_csrf_token
|
||||
from util.log import logfile_path
|
||||
|
||||
|
@ -132,8 +133,16 @@ def registry_server_executor(app):
|
|||
return executor
|
||||
|
||||
|
||||
@pytest.fixture(params=['pre_oci_model', 'oci_model'])
|
||||
def data_model(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def liveserver_app(app, registry_server_executor, init_db_path):
|
||||
def liveserver_app(app, registry_server_executor, init_db_path, data_model):
|
||||
# Change the data model being used.
|
||||
registry_model.set_for_testing(data_model == 'oci_model')
|
||||
|
||||
registry_server_executor.apply_blueprint_to_app(app)
|
||||
|
||||
if os.environ.get('DEBUG', 'false').lower() == 'true':
|
||||
|
@ -150,7 +159,7 @@ def liveserver_app(app, registry_server_executor, init_db_path):
|
|||
|
||||
|
||||
@pytest.fixture()
|
||||
def app_reloader(liveserver, registry_server_executor):
|
||||
def app_reloader(request, liveserver, registry_server_executor):
|
||||
registry_server_executor.on(liveserver).reload_app(liveserver.url)
|
||||
yield
|
||||
|
||||
|
|
Reference in a new issue