Now that the system monitor logging system has been wireframed, it should be possible to create tests for the functionality present in that framework.

This ticket is considered complete when the logging system has tests covering its critical systems. It is not required that ALL lines be covered and whoever works on this should use their best judgement as to how far to take the tests so they are still meaningful.

Comments

merauluka created an issue. See original summary.

merauluka’s picture

Assigned: Unassigned » merauluka

Assigning to myself.

merauluka’s picture

Status: Active » Needs review
StatusFileSize
new6.18 KB

Adding patch with preliminary tests. These can provide a basis for future test expansion.

robpowell’s picture

+  /**
+   * Determines if there are any active incidents on the system.
+   *
+   * @return array
+   *   The array of result values.
+   */
+  public function hasActiveIncident() {
+    return !empty($this->getActiveIncidents());
+  }

This actually returns a boolean.

+  /**
+   * Retrieve all parent incident logs for a specific set of event IDs.
+   *
+   * @param array $event_ids
+   *   The IDs to lookup in the logs.
+   *
+   * @return array
+   *   An array of database rows as an object.
+   */
+  public function getParentIncidentLogs(array $event_ids) {

This method returns a $query->execute()->fetchAllAssoc('log_id'), which could also be null.

+  /**
+   * Retrieve all incident logs for a specific set of event IDs.
+   *
+   * @param array $event_ids
+   *   The IDs to lookup in the logs.
+   *
+   * @return array
+   *   An array of database rows as an object.
+   */
+  public function getIncidentLogs(array $event_ids) {

Same as above

Actually should there be two hasActiveIncident()?

robpowell’s picture

Status: Needs review » Needs work
merauluka’s picture

@robpowell I think your above comment was actually for #3086358: Implement Status Check logic for SystemMonitorTaskManager

merauluka’s picture

Assigned: merauluka » robpowell
Status: Needs work » Needs review

Putting this back to Needs Review.

robpowell’s picture

disregard

robpowell’s picture

Status: Needs review » Needs work
robpowell’s picture

Status: Needs work » Reviewed & tested by the community

Disregard last comment this looks good.

robpowell’s picture

Assigned: robpowell » Unassigned

  • merauluka committed 0096d11 on 8.x-1.x
    Issue #3086306 by merauluka, robpowell: Create unit and functional tests...
merauluka’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Thanks @robpowell for the review!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.