Skip to content

Commit

Permalink
Change database name from full to default
Browse files Browse the repository at this point in the history
  • Loading branch information
evansd committed Nov 2, 2023
1 parent cb5c012 commit e0b526d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion jobrunner/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _is_valid_backend_name(name):


def database_urls_from_env(env):
db_names = ["full", "default", "include_t1oo"]
db_names = ["default", "include_t1oo"]
return {
db_name: db_url
for db_name, db_url in [
Expand Down
2 changes: 1 addition & 1 deletion jobrunner/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def maintenance_mode():
"--current-mode",
str(current),
],
env={"DATABASE_URL": config.DATABASE_URLS["full"]},
env={"DATABASE_URL": config.DATABASE_URLS["default"]},
check=True,
capture_output=True,
text=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"requested_actions": ["action"],
"cancelled_actions": [],
"workspace": "workspace",
"database_name": "full",
"database_name": "default",
"original": {
"created_by": "testuser",
"project": "project",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_create_or_update_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def test_validate_job_request(params, exc_msg, monkeypatch):
requested_actions=["generate_cohort"],
cancelled_actions=[],
workspace="1",
database_name="full", # note db from from job-server is 'full'
database_name="default", # note db from from job-server is 'default'
original=dict(
created_by="user",
project="project",
Expand All @@ -271,7 +271,7 @@ def make_job_request(action=None, actions=None, **kwargs):
repo_url="https://example.com/repo.git",
commit="abcdef0123456789",
workspace="1",
database_name="full",
database_name="default",
requested_actions=actions,
cancelled_actions=[],
original=dict(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def add_maintenance_command(mock_subprocess_run, current):
"--current-mode",
str(current),
],
env={"DATABASE_URL": config.DATABASE_URLS["full"]},
env={"DATABASE_URL": config.DATABASE_URLS["default"]},
capture_output=True,
text=True,
check=True,
Expand Down Expand Up @@ -95,4 +95,4 @@ def test_maintenance_mode_error(mock_subprocess_run, db, db_config):

@pytest.fixture
def db_config(monkeypatch):
monkeypatch.setitem(config.DATABASE_URLS, "full", "mssql://localhost")
monkeypatch.setitem(config.DATABASE_URLS, "default", "mssql://localhost")
8 changes: 4 additions & 4 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_job_request_from_remote_format():
"repo": "https://github.com/opensafely/foo",
"branch": "master",
},
"database_name": "full",
"database_name": "default",
"requested_actions": ["generate_cohort"],
"cancelled_actions": ["analyse"],
"force_run_dependencies": True,
Expand All @@ -29,7 +29,7 @@ def test_job_request_from_remote_format():
commit="abcdef",
branch="master",
workspace="testing",
database_name="full",
database_name="default",
requested_actions=["generate_cohort"],
cancelled_actions=["analyse"],
force_run_dependencies=True,
Expand All @@ -46,7 +46,7 @@ def test_job_request_from_remote_format_database_name_fallback():
"name": "testing",
"repo": "https://github.com/opensafely/foo",
"branch": "master",
"db": "full",
"db": "default",
},
"requested_actions": ["generate_cohort"],
"cancelled_actions": ["analyse"],
Expand All @@ -62,7 +62,7 @@ def test_job_request_from_remote_format_database_name_fallback():
commit="abcdef",
branch="master",
workspace="testing",
database_name="full",
database_name="default",
requested_actions=["generate_cohort"],
cancelled_actions=["analyse"],
force_run_dependencies=True,
Expand Down

0 comments on commit e0b526d

Please sign in to comment.