Skip to content

Commit 94586aa

Browse files
Add local config for tests (fixes #121) (#138)
* Add local config for tests (fixes #121) Without this, adding actions to the nonprod config would require tests to be changed. * Update config/config.nonprod.yaml Co-authored-by: bsieber-mozilla <[email protected]> Co-authored-by: bsieber-mozilla <[email protected]>
1 parent 45eb933 commit 94586aa

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Environment variables for the local development environment
22

3-
ENV=nonprod
3+
ENV=local
44

55
# Jira API Secrets
66
JIRA_USERNAME="fake_jira_username"

config/config.local.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Action Config
3+
- whiteboard_tag: devtest
4+
contact: tbd
5+
description: DevTest whiteboard tag
6+
enabled: true
7+
parameters:
8+
jira_project_key: DevTest

config/config.nonprod.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
# Action Config
3-
- whiteboard_tag: devtest
4-
contact: tbd
5-
description: DevTest whiteboard tag
3+
- whiteboard_tag: nonprodtest
4+
5+
description: Nonprod testing whiteboard tag
66
enabled: true
77
parameters:
8-
jira_project_key: JST
8+
jira_project_key: OSS
99

1010
- whiteboard_tag: flowstate
1111
allow_private: true

tests/unit/app/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_whiteboard_tags_filtered(anon_client):
7171

7272
resp = anon_client.get("/whiteboard_tags/?whiteboard_tag=foo")
7373
infos = resp.json()
74-
assert sorted(infos.keys()) == ["devtest", "flowstate"]
74+
assert sorted(infos.keys()) == ["devtest"]
7575

7676

7777
def test_powered_by_jbi(exclude_middleware, anon_client):

tests/unit/app/test_monitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_read_heartbeat_bugzilla_services_fails(
6565
"""/__heartbeat__ returns 503 when one service is unavailable."""
6666
mocked_bugzilla().logged_in = False
6767
mocked_jira().get_server_info.return_value = {}
68-
mocked_jira().projects.return_value = [{"key": "MR2"}, {"key": "JST"}]
68+
mocked_jira().projects.return_value = [{"key": "DevTest"}]
6969

7070
resp = anon_client.get("/__heartbeat__")
7171

@@ -85,7 +85,7 @@ def test_read_heartbeat_success(anon_client, mocked_jira, mocked_bugzilla):
8585
"""/__heartbeat__ returns 200 when checks succeed."""
8686
mocked_bugzilla().logged_in = True
8787
mocked_jira().get_server_info.return_value = {}
88-
mocked_jira().projects.return_value = [{"key": "MR2"}, {"key": "JST"}]
88+
mocked_jira().projects.return_value = [{"key": "DevTest"}]
8989

9090
resp = anon_client.get("/__heartbeat__")
9191

@@ -124,7 +124,7 @@ def test_head_heartbeat(anon_client, mocked_jira, mocked_bugzilla):
124124
"""/__heartbeat__ support head requests"""
125125
mocked_bugzilla().logged_in = True
126126
mocked_jira().get_server_info.return_value = {}
127-
mocked_jira().projects.return_value = [{"key": "MR2"}, {"key": "JST"}]
127+
mocked_jira().projects.return_value = [{"key": "DevTest"}]
128128

129129
resp = anon_client.head("/__heartbeat__")
130130

0 commit comments

Comments
 (0)