From 8cd2acd845670916ef90600f2b6336dc0190d335 Mon Sep 17 00:00:00 2001 From: Murali Nandigama Date: Mon, 26 Apr 2010 17:56:43 -0700 Subject: [PATCH] limit result set to 10000 --- topfails/topfails/__init__.pyc | Bin 0 -> 169 bytes topfails/topfails/settings.pyc | Bin 0 -> 2144 bytes topfails/topfails/templates/viewer/test.html | 4 +- topfails/topfails/templates/viewer/test.html~ | 13 +++ topfails/topfails/urls.pyc | Bin 0 -> 1116 bytes topfails/topfails/viewer/__init__.pyc | Bin 0 -> 176 bytes topfails/topfails/viewer/models.pyc | Bin 0 -> 7094 bytes topfails/topfails/viewer/views.py | 2 +- topfails/topfails/viewer/views.pyc | Bin 0 -> 6539 bytes topfails/topfails/viewer/views.py~ | 107 ++++++++++++++++++ 10 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 topfails/topfails/__init__.pyc create mode 100644 topfails/topfails/settings.pyc create mode 100755 topfails/topfails/templates/viewer/test.html~ create mode 100644 topfails/topfails/urls.pyc create mode 100644 topfails/topfails/viewer/__init__.pyc create mode 100644 topfails/topfails/viewer/models.pyc create mode 100644 topfails/topfails/viewer/views.pyc create mode 100644 topfails/topfails/viewer/views.py~ diff --git a/topfails/topfails/__init__.pyc b/topfails/topfails/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35dd9c44ad02f476e77ab400f0a1432ab0a8e8cc GIT binary patch literal 169 zcmcckiI>a9;F@yjQ_E=`p>>(QAUCbty}% z;5`5VUlbgoKYp?$N86*_Wb>(+JwN;9akdkQ=SZXP;^#nys!5WiR$V{*DK56J zw7Xd+SQe82P=Zv#+mYW5{zNGU^)kI&; z)^2BNJ1NP()<0%ZCI0_!B2&G#|9zW0!YHKLv`oknK05i3>BGly_m2+cO$E7rt6_KC zXbh=S&e=Z--L^iOoc)#^hOZr|&K;JX@f_P($)~Z1-m{TZ`_W@kpN_WUdqJpqz8%zLDx%FfC}KX*;R}it2lg({NwgZ49D;6?H?Y4i)7nLi6=z zaG+C}k{u73YJaez9lOzRoycyrLK6|V8pHukYo}SlYRU9FQ=1$X8z*^|Y)GEs(SDp= zOz|s0;Lh>1C#=Cp*J3Zp=&;Xz)bF{ny;!Iil|t26HdYIG7c0ezLMGQ-rG)bmUS+(B Sl@b`0GT`?cWj#|e7=HnOepH_T literal 0 HcmV?d00001 diff --git a/topfails/topfails/templates/viewer/test.html b/topfails/topfails/templates/viewer/test.html index 9234194..3c5b260 100755 --- a/topfails/topfails/templates/viewer/test.html +++ b/topfails/topfails/templates/viewer/test.html @@ -1,10 +1,12 @@ {% extends "base.html" %} {% block content %}

Logfile links and Changeset links for {{ test }} failures

+[ Showing up to latest 10000 failures' related log links ]
+
    • {% for f in failures %}{% ifchanged f.build.id %}
  • -{{ f.build.startdate|date:"Y-m-d H:i" }} {{ f.build.tree }} {{ f.build.get_os_display }} [{{ f.build.changesetlink|safe }}]: +{{ f.build.startdate|date:"Y-m-d H:i" }} {{ f.build.tree }} {{ f.build.get_os_display }}   [{{ f.build.changesetlink|safe }}]
      {% endifchanged %} {% endfor %}
    diff --git a/topfails/topfails/templates/viewer/test.html~ b/topfails/topfails/templates/viewer/test.html~ new file mode 100755 index 0000000..38f29a9 --- /dev/null +++ b/topfails/topfails/templates/viewer/test.html~ @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block content %} +

    Logfile links and Changeset links for {{ test }} failures

    +[ Showing up to latest 10000 failures' related log links ]
    +
    +
      +
      • +{% for f in failures %}{% ifchanged f.build.id %}
    • +{{ f.build.startdate|date:"Y-m-d H:i" }} {{ f.build.tree }} {{ f.build.get_os_display }} [{{ f.build.changesetlink|safe }}] +
        {% endifchanged %} + {% endfor %} +
      +{% endblock %} diff --git a/topfails/topfails/urls.pyc b/topfails/topfails/urls.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e569103431172763eee0c2bc78fc4eb82ee5e42 GIT binary patch literal 1116 zcmaKq-)|B@5Xa|^mbOBgmg7jc@6ve^WsEI&cf{nKKt|9f(}G zbit7>s1nS8vJJoz;1S48z%t+#;5NsZ>oC~?^epiTvI|(Tq*9P7V9k(eB7QNz{cEc=K7RpDatzJ@ literal 0 HcmV?d00001 diff --git a/topfails/topfails/viewer/__init__.pyc b/topfails/topfails/viewer/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..500a7458a29e77817e7a16d27a1365e994ff1914 GIT binary patch literal 176 zcmcckiI>a9;F@My463z36%44g0gMeO?_K4U)ptt0R_e>OiZT`D4=Ha@Z4`taR$e8ePbqIG zqeqlCOnL)f8C4#J-c#O4zR_uAPAh**d84ub^tkd)XY?86jb-$N^2Red-xTbfRo)q8 z3d)~U8;GOyvXTm3MyMz;r$^t-K3-S-YUTcZ7IHc^8Ga zsJu%;T%y1mwfCU`|KIpot`$J0Wi*}0GeMG4L9HkZO)K@Ium&xuw1UQSQVi?-I2P9qLAnyZCsN&vicc z^7+Xcc@$2X&CuZ*gHo@I>ufvfnAuL~hMvFacHG%C+TL*eAi1#-N1Yof_BHW(w43+$iF&)U&pT=PjN!?I(4^$=b(C9O}f89|ehn(z97*GS#8n|xn93@1b z(ydWYS{gDXl4*2XEt6R7ubL!%grgfzhUU9*=!csrd0yOYLD9g4u-q4+P{%6AQGER@ zo`h1%QK9fq}r<{tdFgFRlk}xYZ({vu6Qx zLLIymO*O>OmaVx_NrZU+Eiu7HU)skhXgN}|*$w>`{6VvMm3-0&l~WVc=D5-96jVIu zrqLtc1YS?vUF!mTPevEoZY-mE3Jdf!n*LFaA2<{E-cRr(Vu{X#GhGmsh^c)a7JtUn z{|XB;C_q7c0Z@jN8CI|1%1&jtL97vn*2B$6*6%1YDhm-$un_SC(-5?BgpKd(2mbPY zM3_NA9>PmS2*i^iAto8Q2+DH=rFavXiCAu{9r>_o(Ms420(}l6dJ>KQD>l~w#vGK? zv4E1slVa2nXcl<144p*`X--UOj&zLl_ett@wnf#T;#7hJVXn`k>8tu!QA=pb*BPd6 z@x@{`KOSvLj`tT3I3CT;;n`s2&kHJ=M*bki&VfSj=o>{f)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Fl26(L$9D(pgoQdMuilso8 RE(~6HA5R5WpwiIje*jn8B@qAs literal 0 HcmV?d00001 diff --git a/topfails/topfails/viewer/views.py b/topfails/topfails/viewer/views.py index 7d8be5e..f8230c6 100644 --- a/topfails/topfails/viewer/views.py +++ b/topfails/topfails/viewer/views.py @@ -42,7 +42,7 @@ def tests(request,tree='Firefox'): return render_to_response('viewer/tests.html', { 'tree' : tree, 'tests': [t['test__name'] for t in test_names]}) def test(request,tree='Firefox'): - failures = get_list_or_404(TestFailure.objects.filter(build__tree__name__exact=tree).filter(test__name__exact=request.GET['name']).order_by('-build__starttime')) + failures = get_list_or_404(TestFailure.objects.filter(build__tree__name__exact=tree).filter(test__name__exact=request.GET['name']).order_by('-build__starttime')[:10000]) #if request.GET.has_key('json'): #jtext = list(failures) #return HttpResponse(json.dumps(jtext)) diff --git a/topfails/topfails/viewer/views.pyc b/topfails/topfails/viewer/views.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe3a0b57ea4cc28aa0b6509b1728fdb9a7abad4a GIT binary patch literal 6539 zcmc&&ZEqY`8GUBoZSVRmuPz826zG-`hlnUhv`}c;G!@7d;|QcJVYTs$y<^YrY-Yx_ zE!q8&O8f%;Oh57u5E4IxKLF>PJ3G5JDT;(J_U`O`nVEa}sNxM{tn#VzZ# zEMBnQg2jv0TXfG8=Be=%4uO zR#3`WO~Y{zru{tWr(rfp##xxJpm{&c`*D=z{Uq%_{PDvsq0H;Je0UVaL0&`YSsI3} z5N3J4#1<5u45Iib4f93RKila)e)`#`k3ZhYZ=%X~juO0c5BEgl{eF)7v$Bh=Sw9;0 z^Jo;NgYka2-G$vOZ{zYb&nNzLf}G5gC=K_LlU**PfiK%0R4QMagJL5&^Bsd@WmwezZ-RqUhZzqRw4omFjEx3ii>O^aH@ z^bsoy7A?}e)5;Qtu%KDi+p4!*y<@?GJz9VH#J;TBdEN451Ip2=oz*!mK096xGA!B< zld4#-gy%5Pwmo`Pu^o_fr`y50wsDi$3!0$c&w+oxK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yMGAYeW&~R>F78Z zK7U8y45-3x)POrJ4F;!9WJ8f^m>i|9eysX&7#_O%NG~7Z#BS&sPIbd+I7qXMVXu&- z&X3$2W?|Avnxl@L9C=D3IZEd^mn9V-jNPG6VkxD3T?o~E`)P7CaS~F{y~8K2;i4%{ z!Zb<(zsE*}Xa-lE+D+2nYP7-C&EfD2)r_;CJk}uxmulYh7QIW~N~7A9KjbDWIKWY7 zvXu>!G~YeKUXpK6?xwTpX%ydbz;BI`AdEBT*%+IBhCr9O%O?pcf!jxi^T%$4ArG-< zsmk~H9M!DD69MaUTj^_G#=Kccn*Sb4jITat=7WZFIgEh*Umh}YCGTU+M{)QI5-Z!p c<)-%#S^TQkuC!b2db?Kqw@_;>RNFWH1t7Rr$p8QV literal 0 HcmV?d00001 diff --git a/topfails/topfails/viewer/views.py~ b/topfails/topfails/viewer/views.py~ new file mode 100644 index 0000000..c374e54 --- /dev/null +++ b/topfails/topfails/viewer/views.py~ @@ -0,0 +1,107 @@ +from django.shortcuts import render_to_response, get_list_or_404 +from topfails.viewer.models import Build, Tree, Test,TestFailure, OS_CHOICES, get_most_failing_tests, get_fails_in_timerange +import re +from django.http import HttpResponse +import json + +def latest(request,tree='Firefox'): + failures = get_list_or_404(TestFailure.objects.filter(build__tree__name=tree).order_by('-build__starttime')[:20]) + if request.GET.has_key('json'): + jtext = [{"Test_name":f.test.name, "Build_status":f.build.status, "Logfile": f.build.tinderboxlink(),"Changeset":f.build.jsonchangesetlink() , "Failure_description":f.failtext} for f in failures] + return HttpResponse(json.dumps(jtext)) + else: + return render_to_response('viewer/latest.html', {'failures': failures, 'tree' : tree}) + +def index(request,tree='Firefox'): + failures = get_list_or_404(TestFailure.objects.filter(build__tree__name=tree).order_by('-build__starttime')[:20]) + return render_to_response('viewer/latest.html', {'failures': failures, 'tree' : tree}) + + +def trees(request,tree='Firefox'): + alltrees = Tree.objects.all().order_by('name') + return render_to_response('viewer/trees.html', {'trees': alltrees , 'tree' : tree}) + +def tree(request, tree='Firefox'): + newestbuilds = get_list_or_404(Build.objects.filter(tree__name__exact=tree).order_by('-starttime')[:5]) + return render_to_response('viewer/tree.html', {'tree': tree, 'newestbuilds': newestbuilds}) + +def changesets(request,tree='Firefox'): + build_csets = Build.objects.filter(tree__name__exact=tree).values('changeset').distinct() + return render_to_response('viewer/changesets.html', { 'tree' : tree,'changesets': [b['changeset'] for b in build_csets]}) + +def changeset(request, changeset,tree='Firefox'): + builds = get_list_or_404(Build, changeset__exact=changeset) + return render_to_response('viewer/changeset.html', {'changeset': changeset, 'builds': builds, 'tree' : tree}) + +def tests(request,tree='Firefox'): + test_names = TestFailure.objects.filter(build__tree__name__exact=tree).values('test__name').distinct() + if request.GET.has_key('json'): + jtext = list(test_names) + return HttpResponse(json.dumps(jtext)) + else: + return render_to_response('viewer/tests.html', { 'tree' : tree, 'tests': [t['test__name'] for t in test_names]}) + +def test(request,tree='Firefox'): + failures = get_list_or_404(TestFailure.objects.filter(build__tree__name__exact=tree).filter(test__name__exact=request.GET['name']).order_by('-build__starttime')[:1000]) + #if request.GET.has_key('json'): + #jtext = list(failures) + #return HttpResponse(json.dumps(jtext)) + #else: + return render_to_response('viewer/test.html', {'test': request.GET['name'], 'failures': failures, 'tree' : tree}) + +def topfails(request,tree='Firefox'): + failures = get_most_failing_tests(tree) + if request.GET.has_key('json'): + jtext = list(failures) + return HttpResponse(json.dumps(jtext)) + else: + return render_to_response('viewer/topfails.html', {'failures': failures, 'tree' : tree}) + +def Help(request,tree): + return render_to_response('viewer/Help.html',{'tree':tree}) + +def timeline(request,tree='Firefox'): + name = request.GET['name'] + builds = get_list_or_404(Build.objects.filter(tree__name__exact=tree), test__name__exact=name) + buildlist = [] + desc_list = [] + for b in builds: + descs = b.testfailure_set.filter(testfailure__name__exact=name).order_by('id') + desc = '\n'.join(descs.values_list('description', flat=True)) + if desc not in desc_list: + desc_list.append(desc) + desc_i = desc_list.index(desc) + buildlist.append({'build': b, + 'desctype': desc_i, + 'description': desc, + 'os': OS_CHOICES[b.os][1], + 'time': b.startdate().isoformat() + "Z", + }) + return render_to_response('viewer/timeline.html', {'test': name, + 'descriptions': desc_list, + 'builds': buildlist, 'tree' : tree}) + +def failswindow(request,tree='Firefox'): + period=request.GET['window'] + m = re.match("(\d+)([ymwdh])", period) + failures = get_fails_in_timerange(period,tree) + if request.GET.has_key('json'): + jtext = list(failures) + return HttpResponse(json.dumps(jtext)) + else: + if m.group(2) == 'd': + prd='days' + elif m.group(2) == 'h': + prd = 'hours' + elif m.group(2) == 'w': + prd = 'weeks' + elif m.group(2) == 'm': + prd = 'months' + elif m.group(2) == 'y': + prd = 'years' + else: + prd = 'days' + + + return render_to_response('viewer/failswindow.html', {'failures': failures,'n':m.group(1),'d':prd, 'tree' : tree}) +