Skip to content

Commit

Permalink
Bug 1320936 - Drop result_set_id columns from alert summary table
Browse files Browse the repository at this point in the history
  • Loading branch information
wlach committed Dec 19, 2016
1 parent 0070e18 commit 1df5b79
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
2 changes: 0 additions & 2 deletions tests/conftest.py
Expand Up @@ -588,8 +588,6 @@ def test_perf_alert_summary(test_repository, result_set_stored, test_perf_framew
return PerformanceAlertSummary.objects.create(
repository=test_repository,
framework=test_perf_framework,
prev_result_set_id=1,
result_set_id=2,
prev_push_id=1,
push_id=2,
manually_created=False,
Expand Down
2 changes: 0 additions & 2 deletions tests/etl/test_perf_data_adapters.py
Expand Up @@ -390,9 +390,7 @@ def test_alert_generation(test_project, test_repository,
if expected_num_alerts > 0:
assert 1 == PerformanceAlertSummary.objects.all().count()
summary = PerformanceAlertSummary.objects.get(id=1)
assert summary.result_set_id is None
assert summary.push_id == 16
assert summary.prev_result_set_id is None
assert summary.prev_push_id == 15
else:
assert 0 == PerformanceAlertSummary.objects.all().count()
Expand Down
2 changes: 0 additions & 2 deletions tests/perfalert/test_alert_modification.py
Expand Up @@ -84,8 +84,6 @@ def test_alert_modification(test_repository, test_perf_signature,
repository=test_repository,
prev_push_id=3,
push_id=4,
prev_result_set_id=3,
result_set_id=4,
last_updated=datetime.datetime.now(),
manually_created=False)

Expand Down
2 changes: 0 additions & 2 deletions tests/perfalert/test_create_alerts.py
Expand Up @@ -24,8 +24,6 @@ def _verify_alert(alertid, expected_push_id, expected_prev_push_id,
assert alert.classifier == expected_classifier

summary = PerformanceAlertSummary.objects.get(id=alertid)
assert summary.result_set_id is None
assert summary.prev_result_set_id is None
assert summary.push_id == expected_push_id
assert summary.prev_push_id == expected_prev_push_id
assert summary.status == expected_summary_status
Expand Down
2 changes: 0 additions & 2 deletions tests/webapp/api/test_performance_alerts_api.py
Expand Up @@ -44,8 +44,6 @@ def test_alerts_put(webapp, result_set_stored, test_repository,
PerformanceAlertSummary.objects.create(
id=2,
repository=test_repository,
prev_result_set_id=2,
result_set_id=3,
prev_push_id=2,
push_id=3,
last_updated=datetime.datetime.now(),
Expand Down
22 changes: 22 additions & 0 deletions treeherder/perf/migrations/0026_drop_alertsummary_rsid.py
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('perf', '0025_rename_orm_property'),
]

operations = [
migrations.RemoveField(
model_name='performancealertsummary',
name='prev_result_set_id',
),
migrations.RemoveField(
model_name='performancealertsummary',
name='result_set_id',
),
]
3 changes: 0 additions & 3 deletions treeherder/perf/models.py
Expand Up @@ -124,9 +124,6 @@ class PerformanceAlertSummary(models.Model):
repository = models.ForeignKey(Repository)
framework = models.ForeignKey(PerformanceFramework, null=True)

prev_result_set_id = models.PositiveIntegerField(null=True)
result_set_id = models.PositiveIntegerField(null=True)

prev_push = models.ForeignKey(Push, related_name='+')
push = models.ForeignKey(Push, related_name='+')

Expand Down

0 comments on commit 1df5b79

Please sign in to comment.