Closed
Bug 1009198
Opened 11 years ago
Closed 10 years ago
Add previous week data to Ouija wiki_update page.
Categories
(Testing :: General, defect)
Testing
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dminor, Assigned: abhi12ravi, Mentored)
References
Details
(Whiteboard: [good first bug][lang=python])
Ouija (https://github.com/dminor/ouija) is a test failure analysis tool.
Bug 1003923 added a wiki formatted summary page (see http://54.215.155.53/wiki_update.html). Bug 1004539 added the ability to query arbitrary date ranges. It would be nice to make use of this to show the previous week's data in the summary page:
The wiki format should look like this:
* Android 4.0 failure rate: [[http://54.215.155.53/android_failures.html?platform=android4.0 17.98%]]
** last week 17.37%
** excluding retries 2.46%
for each of the Android 2.2, 2.3 and 4.0 platforms.
Reporter | ||
Comment 2•10 years ago
|
||
Sounds great, thanks for your interest!
Assignee: nobody → daniel
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•10 years ago
|
||
Daniel, have you been able to make any progress with this bug?
Please let me know if you need any additional information. If you don't have time to look at this right now, that is fine too, please let me know and I'll unassign it in case someone else is interested in working on this.
Flags: needinfo?(daniel)
Whoops. Thank's for the ping.
I'll likely finish it today so how should I be commiting my changes? Pull Request?
Flags: needinfo?(daniel)
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to daniel from comment #4)
> Whoops. Thank's for the ping.
> I'll likely finish it today so how should I be commiting my changes? Pull
> Request?
Sounds great, pull request is fine. Thanks for looking at this!
Updated•10 years ago
|
Mentor: dminor
Whiteboard: [good first bug][mentor=dminor][lang=python] → [good first bug][lang=python]
Reporter | ||
Comment 6•10 years ago
|
||
Daniel, if you have a patch ready, please let me know and I'll be happy to take a look. I'm going to unassign this in the meantime in case someone else is interested in working on this.
Assignee: daniel → nobody
Status: ASSIGNED → NEW
Reporter | ||
Comment 7•10 years ago
|
||
Hi Abhiram,
Thanks for taking a look at this! This first step is to get a local copy of Ouija running. There are instructions on the github page. Please let me know if you run into any problems - that will help us make the instructions better.
To test this properly, you'll need two weeks of data, but only for the mozilla-central branch. You can fetch that by running python updatedb.py --delta 336 --branch mozilla-central from the src directory.
The page you need to modify is static/wiki_update.html. Basically, you want to calculate todays date, and fetch the data from two weeks ago until one week ago. You can do this by making a request to the /data/platform endpoint with startdate and enddate specified. Here's an example of how to do this, against the production server:
http://54.215.155.53/data/platform/?platform=android4.0&startdate=2014-07-01&enddate=2014-07-04
Once you have this data, you can add an extra row for each platform to the generated report. Please let me know if you have any other questions.
Thanks!
Dan
Assignee: nobody → abhi12ravi
Status: NEW → ASSIGNED
Reporter | ||
Comment 8•10 years ago
|
||
Hi Abhiram, are you still interested in working on this? If you have any more questions please let me know. Thanks! Dan
Flags: needinfo?(abhi12ravi)
Assignee | ||
Comment 9•10 years ago
|
||
Yes, I am working on the bug. I figured I've to study the code base a little in order to make a proper addition/deletion in the bug.
Do give me a couple of more days and I'll get back to you with a patch. I'm sorry for the delay. Hope it didn't cause you any inconvenience.
Flags: needinfo?(abhi12ravi)
Comment 10•10 years ago
|
||
Hi Abhiram,
I've already done the formatting portion of this bug so all you really need to do is add the data from the week before.
http://pastebin.com/iHmMCjVQ
The file you should be looking at is wiki_update.html in the static folder.
Comment 11•10 years ago
|
||
Hi Abhiram,
I've already done the formatting portion of this bug so all you really need to do is add the data from the week before.
http://pastebin.com/iHmMCjVQ
Assignee | ||
Comment 12•10 years ago
|
||
Hi Daniel,
All I have to do is to write a script to fetch data from the previous week and display it in the wiki_update.html? Should I use JavaScript or Python or HTML? I am a little confused. Please guide me on this.
Correct me if I am wrong.
Comment 13•10 years ago
|
||
The API already exists. All you need to do is modify the JavaScript code in wiki_update.html so it displays data from the previous week in the format outlined above.
Assignee | ||
Comment 14•10 years ago
|
||
I did go through the JavaScript code in the file wiki_update.html. This is my understanding of it's working:
1. The fetch_print function assigns the version number to the variable "android_version"
2. Initiate a XMLHttpRequest and parse the received string into a JSON object raw.
3. failRates and dates are used to store failRate values/insert dates into the page (HTML).
4. Then, an asynchronous request is sent to the server with respective Android version number.
5. Received date is written into the current document (includes failureRate)
6. The same function fetch_print is executed until all the platforms are finished.
Correct me if I am wrong since unless I don't understand this, I can't fetch records from previous week.
Reporter | ||
Comment 15•10 years ago
|
||
Daniel, thanks for the work on formatting!
Abhiram, your understanding of the current code is correct. You need to add a second request with the appropriate date to get the previous week's data.
Thanks!
Assignee | ||
Comment 16•10 years ago
|
||
Hi Dan and Daniel,
I have added a small piece of code that calculates current date. Please check if that's fine.
https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
Moving on, do I add a new function for the new request I'm supposed to add or should I just place a second request within the existing function "function (e)".
Correct me if I'm wrong.
Again, thanks a lot for bearing with me.
Assignee | ||
Comment 17•10 years ago
|
||
(In reply to abhi12ravi from comment #16)
> Hi Dan and Daniel,
>
> I have added a small piece of code that calculates current date. Please
> check if that's fine.
> https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
>
> Moving on, do I add a new function for the new request I'm supposed to add
> or should I just place a second request within the existing function
> "function fetch_print()".
>
> Correct me if I'm wrong.
>
> Again, thanks a lot for bearing with me.
Reporter | ||
Comment 18•10 years ago
|
||
(In reply to abhi12ravi from comment #17)
> (In reply to abhi12ravi from comment #16)
> > Hi Dan and Daniel,
> >
> > I have added a small piece of code that calculates current date. Please
> > check if that's fine.
> > https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
> >
> > Moving on, do I add a new function for the new request I'm supposed to add
> > or should I just place a second request within the existing function
> > "function fetch_print()".
> >
> > Correct me if I'm wrong.
> >
> > Again, thanks a lot for bearing with me.
Abhiram, there is a nicer way to get the date string in the appropriate format:
today = new Date();
s = today.toISOString();
s will look like this "2014-08-11T16:21:02.602Z" but you want only the year, month and day, so you can do this:
s.split('T') which will give you an array [ "2014-08-11", "16:21:02.602Z" ] of which you want the first part. Putting it together, you can use:
s = today.toISOString().split('T')[0]
To get last week's date, you need to subtract the number of milliseconds between now and then, like so:
last_week = new Date(Date.now() - 7*24*60*60*1000);
You should change the fetch_print function so that it takes a start date and an end date. The first request should have a start date of one week ago and an end date of today. The second request should have a start date of two weeks ago and end date of one week ago.
Hope this helps,
Dan
Assignee | ||
Comment 19•10 years ago
|
||
Dan,
I have made the changes in date as mentioned. Check if fetch_print is now taking proper start date and end date. Will work on the second request if this is fine.
Refer: https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
Thanks for all the help!
Reporter | ||
Comment 20•10 years ago
|
||
(In reply to abhi12ravi from comment #19)
> Dan,
>
> I have made the changes in date as mentioned. Check if fetch_print is now
> taking proper start date and end date. Will work on the second request if
> this is fine.
>
> Refer:
> https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
>
> Thanks for all the help!
Looks good :)
Assignee | ||
Comment 21•10 years ago
|
||
Hi Dan,
Sorry for the delay.
I've added a second request in static/wiki_update.html which takes the week_before_last_week's date and last week's date.
Please refer:
https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
Do let me know if this is what you had in mind. Thank you.
Reporter | ||
Comment 22•10 years ago
|
||
Hi Abhiram,
Sorry for the delay in getting back to you. What you have looks about right, but when I tried to test it I ran into a number of javascript syntax errors, which makes me think you haven't been able to test this on your system. Please let me know if you need any help getting setup with a local ouija installation to be able to test this. Thanks!
Dan
Assignee | ||
Comment 23•10 years ago
|
||
Hi Dan,
Thanks for getting back to me. I was under the impression that HTTPS requests can be run only on remote servers and not local ones.
This is the output when I run python updatedb.py --delta 2 (http://pastebin.com/PKxs5YmM). There seems to be certain errors, is that okay?
And yes, I will test the new code I've written and get back to you.
Reporter | ||
Comment 24•10 years ago
|
||
(In reply to abhi12ravi from comment #23)
> Hi Dan,
>
> Thanks for getting back to me. I was under the impression that HTTPS
> requests can be run only on remote servers and not local ones.
> This is the output when I run python updatedb.py --delta 2
> (http://pastebin.com/PKxs5YmM). There seems to be certain errors, is that
> okay?
>
> And yes, I will test the new code I've written and get back to you.
The scripts assume that the root password for the mysql database is root, so you'll need to either configure the database that way (or change the scripts :) - that might be a good follow up bug).
Also, the instructions are out of date, the --delta parameter is now hours rather than days, so you'll need to do something like --delta 336 to get enough data to test with. Please let me know if you run into any further troubles.
Thanks!
Assignee | ||
Comment 25•10 years ago
|
||
Hi Dan,
I got the local installation running with my new code. Seems to work fine. Syntax errors removed.
Please check:
https://github.com/abhi12ravi/ouija/blob/master/static/wiki_update.html
And I'd like to change the instructions to suit the current model in the readme file. Can I do that?
Thanks for all the help.
Assignee | ||
Comment 26•10 years ago
|
||
Removed console.log messages.
Reporter | ||
Comment 27•10 years ago
|
||
Thanks! Sorry I didn't look at this last week, I'll have a look today.
Reporter | ||
Comment 28•10 years ago
|
||
Hi, a couple of things:
The previous week's data should appear as a bullet under the current weeks data rather than as a new item, like this:
** last week 17.37%
It looks like you have changed the start and end date, which you don't need to do. We only care about the start and end date for the current week.
document.getElementById('s_last_week').innerHTML = dates.startDate;
document.getElementById('s_today').innerHTML = dates.endDate;
You can remove (instead of commenting out) the console.log messages.
Thanks!
Assignee | ||
Comment 29•10 years ago
|
||
I have added last week under the current week's data. Didn't get what you meant by not changing the start and end date.
I followed your earlier comments which said,
"The first request should have a start date of one week ago and an end date of today. The second request should have a start date of two weeks ago and end date of one week ago."
Let me know if we can catch up on IRC so that we can fix this issue sooner.
Latest: https://github.com/abhi12ravi/ouija
Reporter | ||
Comment 30•10 years ago
|
||
(In reply to abhi12ravi from comment #29)
> I have added last week under the current week's data. Didn't get what you
> meant by not changing the start and end date.
> I followed your earlier comments which said,
>
> "The first request should have a start date of one week ago and an end date
> of today. The second request should have a start date of two weeks ago and
> end date of one week ago."
>
> Let me know if we can catch up on IRC so that we can fix this issue sooner.
>
> Latest: https://github.com/abhi12ravi/ouija
Sorry, I've been away for a few days and just saw this now. If you make a pull request with your changes on github, I can easily show you what I mean about the dates (it is not a big change.)
I'd be happy to chat on IRC (I'm dminor on #ateam) as well. Thanks!
Reporter | ||
Comment 31•10 years ago
|
||
Working great, thanks!
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•