@@ -49,10 +49,15 @@ async def test_parse(mock_taskcluster):
49
49
50
50
hook .triggered_groups .add ("already-triggered-group" )
51
51
52
- assert await hook .parse ({"taskGroupId" : "already-triggered-group" }) is None
52
+ assert (
53
+ await hook .parse (
54
+ {"schedulerId" : "gecko-level-1" , "taskGroupId" : "already-triggered-group" }
55
+ )
56
+ is None
57
+ )
53
58
54
59
55
- def run_async_parser (hook , group_id ):
60
+ def run_async_parser (hook , group_id , scheduler ):
56
61
"""
57
62
Helper to run the asynchronous parser using responses in the same event loop
58
63
"""
@@ -65,7 +70,7 @@ async def _check():
65
70
json = json .load (f ),
66
71
status = 200 ,
67
72
)
68
- return await hook .parse ({"taskGroupId" : group_id })
73
+ return await hook .parse ({"schedulerId" : scheduler , " taskGroupId" : group_id })
69
74
70
75
loop = asyncio .new_event_loop ()
71
76
return loop .run_until_complete (_check ())
@@ -75,14 +80,29 @@ def test_wrong_branch(mock_taskcluster):
75
80
bus = MessageBus ()
76
81
hook = CodeCoverage ("services-staging-codecoverage/bot" , "project-test" , bus )
77
82
78
- assert run_async_parser (hook , "bNq-VIT-Q12o6nXcaUmYNQ" ) is None
83
+ assert run_async_parser (hook , "bNq-VIT-Q12o6nXcaUmYNQ" , "gecko-level-1" ) is None
79
84
80
85
81
86
def test_success (mock_taskcluster ):
82
87
bus = MessageBus ()
83
88
hook = CodeCoverage ("services-staging-codecoverage/bot" , "project-test" , bus )
84
89
85
- assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" ) == [
90
+ assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" , "gecko-level-1" ) == [
91
+ {
92
+ "REPOSITORY" : "https://hg.mozilla.org/mozilla-central" ,
93
+ "REVISION" : "ec3dd3ee2ae4b3a63529a912816a110e925eb2d0" ,
94
+ }
95
+ ]
96
+
97
+
98
+ def test_scheduler (mock_taskcluster ):
99
+ bus = MessageBus ()
100
+ hook = CodeCoverage ("services-staging-codecoverage/bot" , "project-test" , bus )
101
+
102
+ assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" , "-" ) is None
103
+ assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" , "anotherValue" ) is None
104
+ assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" , "aws-Xxxx" ) is None
105
+ assert run_async_parser (hook , "RS0UwZahQ_qAcdZzEb_Y9g" , "gecko-level-1" ) == [
86
106
{
87
107
"REPOSITORY" : "https://hg.mozilla.org/mozilla-central" ,
88
108
"REVISION" : "ec3dd3ee2ae4b3a63529a912816a110e925eb2d0" ,
@@ -94,7 +114,7 @@ def test_success_windows(mock_taskcluster):
94
114
bus = MessageBus ()
95
115
hook = CodeCoverage ("services-staging-codecoverage/bot" , "project-test" , bus )
96
116
97
- assert run_async_parser (hook , "MibGDsa4Q7uFNzDf7EV6nw" ) == [
117
+ assert run_async_parser (hook , "MibGDsa4Q7uFNzDf7EV6nw" , "gecko-level-2" ) == [
98
118
{
99
119
"REPOSITORY" : "https://hg.mozilla.org/mozilla-central" ,
100
120
"REVISION" : "63519bfd42ee379f597c0357af2e712ec3cd9f50" ,
@@ -106,7 +126,7 @@ def test_success_try(mock_taskcluster):
106
126
bus = MessageBus ()
107
127
hook = CodeCoverage ("services-staging-codecoverage/bot" , "project-test" , bus )
108
128
109
- assert run_async_parser (hook , "FG3goVnCQfif8ZEOaM_4IA" ) == [
129
+ assert run_async_parser (hook , "FG3goVnCQfif8ZEOaM_4IA" , "gecko-level-1" ) == [
110
130
{
111
131
"REPOSITORY" : "https://hg.mozilla.org/try" ,
112
132
"REVISION" : "066cb18ba95a7efe144e729713c429e422d9f95b" ,
0 commit comments