Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Prerequisite of a beta or release candidate is automated test coverage. Full list to be determined, but some initial thoughts:
- Unit tests
Deep unit coverage on InsightRemoteEntityQueryUnit coverage on InsightEntityControllernot currently possibleUnit coverage on InsightUnit coverage on clients_connection_new_relic_insights_query
- Behavioral tests
Basic admin configuration tests)Coverage on procedural functions in new_relic_insights.module where appropriate (e.g. on queue handling)Create a fake, local API endpoint to capture events, testing watchdog mostly (since Better Stats is a soft dependency)Coverage on the use of EntityFieldQuery (for remote and local entity querying)
Comments
Comment #1
iamEAP CreditAttribution: iamEAP commentedComment #2
iamEAP CreditAttribution: iamEAP commentedJust some foundation work on the remote entity query class unit tests.
Comment #3
iamEAP CreditAttribution: iamEAP commentedFurther along, adding the helper
assertNRQLContains()
, and tests for entity and field conditions, as well as the exceptions for special property conditions.Comment #4
iamEAP CreditAttribution: iamEAP commentedAdding an
assertDefaultNRQL()
helper, and tests for all time conditions and exceptional operators, as well as the execute method.Remaining:
buildFromEFQ()
methodbuildNRQL()
method... like multiple property conditions, or multiple in/out conditions (proper use of "AND" and "WHERE" under certain circumstances). Also the ability to target multiple bundles.Comment #5
iamEAP CreditAttribution: iamEAP commentedWrapped up the tests, cleaned out some missing features in the query builder where trivial.
Discovered a relatively major flaw, noted here: #2309343: Handling of "IN" conditions is flawed in InsightRemoteEntityQuery
Comment #6
iamEAP CreditAttribution: iamEAP commentedTests for the clients connection class.
Comment #10
iamEAP CreditAttribution: iamEAP commentedComment #11
iamEAP CreditAttribution: iamEAP commentedComment #13
iamEAP CreditAttribution: iamEAP commentedComment #15
iamEAP CreditAttribution: iamEAP commentedComment #17
iamEAP CreditAttribution: iamEAP commentedComment #19
iamEAP CreditAttribution: iamEAP commentedComment #21
iamEAP CreditAttribution: iamEAP commentedComment #23
iamEAP CreditAttribution: iamEAP commentedComment #25
iamEAP CreditAttribution: iamEAP commentedComment #27
iamEAP CreditAttribution: iamEAP commentedComment #29
iamEAP CreditAttribution: iamEAP commentedComment #31
iamEAP CreditAttribution: iamEAP commentedComment #32
iamEAP CreditAttribution: iamEAP commentedComment #33
iamEAP CreditAttribution: iamEAP commentedTests for the Insight class.
Comment #35
iamEAP CreditAttribution: iamEAP commentedComment #37
iamEAP CreditAttribution: iamEAP commentedComment #39
iamEAP CreditAttribution: iamEAP commentedComment #40
iamEAP CreditAttribution: iamEAP commentedUnfortunately, testing of the entity controller is not really possible, due to
RemoteEntityAPIDefaultController::pack()
directly callingentity_get_info()
...Attaching the patch for reference, but will not pursue any further.
Comment #41
iamEAP CreditAttribution: iamEAP commentedComment #42
iamEAP CreditAttribution: iamEAP commentedHere's UI test cases for what's implemented so far.
Comment #44
iamEAP CreditAttribution: iamEAP commentedComment #45
iamEAP CreditAttribution: iamEAP commentedCoverage for inserting insights events.
Comment #46
iamEAP CreditAttribution: iamEAP commentedAnother try... At least locally, on some sites, timeout of 5 seconds may not be enough.
Comment #51
iamEAP CreditAttribution: iamEAP commentedComment #53
iamEAP CreditAttribution: iamEAP commentedComment #55
iamEAP CreditAttribution: iamEAP commentedComment #56
iamEAP CreditAttribution: iamEAP commentedQuery (via EntityFieldQuery) coverage.
Comment #58
iamEAP CreditAttribution: iamEAP commentedThe long slog is over.