Closed Bug 1484196 Opened 6 years ago Closed 6 years ago

Consolidate Pulse connections

Categories

(Tree Management :: Treeherder: Infrastructure, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ghickman, Assigned: emorley)

References

Details

Broken out from https://bugzilla.mozilla.org/show_bug.cgi?id=1281821#c15

And a continuation of https://bugzilla.mozilla.org/show_bug.cgi?id=1281821#c21

We've hit a catch-22 with how we configure and build a Pulse connection from a centralised place.

We want three things to occur with access to Pulse:
* Production-like envs set PULSE_URL and have access to Pulse as expected.
* Tests set a guest/dummy PULSE_URL and run as expected.
* Local dev does _not_ set a PULSE_URL and anything involving Pulse throws the explicit error telling the user to set PULSE_URL.

Currently we construct a connection in the service package using django-environ to grab the value of PULSE_URL directly, with no default.  This works well in dev and production-like envs, throwing the appropriately clear error in dev.

Our tests construct their own connection in the tests.conftest.pulse_consumer() function using settings.PULSE_URL which is set to settings.BROKER_URL in tests/settings.py.

In looking to make the tests use treeherder.services.pulse.pulse_conn it seems there's no way to handle a dummy PULSE_URL in tests without removing the ability for one to run specific tests with pytest directly.  This is fixable when we can use a guest Pulse account and set a default for pulse_conn.

In the meantime I'm going to leave the tests to building their own connection and point to this bug.
Assignee: nobody → emorley
This was fixed by removing the pulse publisher in bug 1492462.
Status: NEW → RESOLVED
Closed: 6 years ago
Depends on: 1492462
No longer depends on: 1484192
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.