Closed Bug 1580155 Opened 5 years ago Closed 5 years ago

Rename event constants used only for tests

Categories

(DevTools :: Netmonitor, task, P3)

task

Tracking

(firefox76 fixed)

RESOLVED FIXED
Firefox 76
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

Depends on: 1578215
Priority: -- → P3

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

Hello Sir,
This is my first bug for Mozilla. I would like to try and contribute to this bug
Thank You

In this how should we decide which events are only for tests and which are for tests and production both?

Is this issue still open and active? I want to take it.

(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!

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: nobody → kritisingh1.ks
Status: NEW → ASSIGNED

(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 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?

Correct

I'll look a the patch in Phab, thanks!

Honza

Pushed by jodvarko@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5320b4784ee7 Rename event constants used only for tests r=Honza.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: