Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
  • Loading branch information
jsilvela committed Jun 6, 2024
1 parent 882de21 commit 9c33338
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,35 @@ def test_compute_summary(self):

def test_compute_thermometer(self):
self.maxDiff = None
thermometer = summarize_test_results.compute_thermometer_on_metric(self.summary, "by_platform")
thermometer = summarize_test_results.compute_thermometer_on_metric(
self.summary, "by_platform"
)

self.assertEqual(
thermometer,
"Platforms thermometer:\n\n"
"- 🟡 - local: 66.7% success.\t(1 out of 3 tests failed)\n\n"
"- 🔴 - local: 66.7% success.\t(1 out of 3 tests failed)\n\n",
)

thermometerPlaintext = summarize_test_results.compute_thermometer_on_metric(
self.summary, "by_platform", False
)

self.assertEqual(
thermometerPlaintext,
"Platforms thermometer:\n\n"
"- :red_circle: - local: 66.7% success.\t(1 out of 3 tests failed)\n\n",
)

def test_compute_systematic_failures(self):
self.maxDiff = None

for metric in ["by_test", "by_k8s", "by_postgres", "by_platform"]:
has_alerts, out = summarize_test_results.compute_systematic_failures_on_metric(self.summary, metric)
has_alerts, out = (
summarize_test_results.compute_systematic_failures_on_metric(
self.summary, metric
)
)
self.assertEqual(has_alerts, False)
self.assertEqual(out, "")

Expand Down

0 comments on commit 9c33338

Please sign in to comment.