Rename event constants used only for tests
Categories
(DevTools :: Netmonitor, task, P3)
Tracking
(firefox76 fixed)
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: Honza, Assigned: kritisingh1.ks)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
This is a follow up for bug 1578215
See also this comment:
https://phabricator.services.mozilla.com/D44437#1367914
We should update the netmonitor constants.js file in order to clearly indicate which events are "test-only" and which events are "test and production":
https://searchfox.org/mozilla-central/source/devtools/client/netmonitor/src/constants.js#85
We should have two constants "EVENTS" and "TEST_EVENTS".
Honza
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Hello Mr Odvarko,
This is my first time tackling a bug for open source software. I would like to try and resolve this bug if that is okay with you.
Thank you,
Mr Jazz
Comment 2•5 years ago
|
||
Hello Sir,
This is my first bug for Mozilla. I would like to try and contribute to this bug
Thank You
Comment 3•5 years ago
|
||
In this how should we decide which events are only for tests and which are for tests and production both?
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #0)
We should have two constants "EVENTS" and "TEST_EVENTS".
Hello, Could you elaborate on which events to put inside the to be created TEST_EVENTS constant? Thanks!
Reporter | ||
Comment 6•5 years ago
|
||
To see what events should be inside TEST_EVENTS
we need to search the code base [1] and check which ones are only used in tests - i.e. in this test directory: devtools/client/netmonitor/test/
You should also look at this comment and patch:
https://phabricator.services.mozilla.com/D44437#1367914
Basically, all the events that are emitted using emitForTests
should be in TEST_EVENTS
But, we should check all of them in the current EVENTS
list.
https://searchfox.org/mozilla-central/rev/b2ccce862ef38d0d150fcac2b597f7f20091a0c7/devtools/client/netmonitor/src/constants.js#95
Honza
So, if the events are either present in tests or are emitted using emitForTests
, then they should be added to TEST_EVENTS
, else they should be left in EVENTS
and then the corresponding callers should also be changed (example: this.emitForTests(EVENTS.NETWORK_EVENT, actor);
should be changed to this.emitForTests(TEST_EVENTS.NETWORK_EVENT, actor);
). Is that what needs to be done?
Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Reporter | ||
Comment 9•5 years ago
|
||
(In reply to manas from comment #7)
So, if the events are either present in tests
Only in tests ...
or are emitted using
emitForTests
, then they should be added toTEST_EVENTS
, else they should be left inEVENTS
and then the corresponding callers should also be changed (example:this.emitForTests(EVENTS.NETWORK_EVENT, actor);
should be changed tothis.emitForTests(TEST_EVENTS.NETWORK_EVENT, actor);
). Is that what needs to be done?
Correct
I'll look a the patch in Phab, thanks!
Honza
Comment 10•5 years ago
|
||
Comment 11•5 years ago
|
||
bugherder |
Description
•