Bug 114810 - Hardware and OS attributes not auto determined in New Bug Report wizard
Summary: Hardware and OS attributes not auto determined in New Bug Report wizard
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Ian Bull CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-11-02 13:35 EST by Ian Bull CLA
Modified: 2005-12-01 13:07 EST (History)
2 users (show)

See Also:


Attachments
Patch to determine hardware (4.73 KB, patch)
2005-11-16 19:12 EST, Ian Bull CLA
no flags Details | Diff
Test Case (3.80 KB, patch)
2005-11-25 19:59 EST, Ian Bull CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Bull CLA 2005-11-02 13:35:56 EST
Platform is not determined (under linux at least) when using the bugzilla
component.  It says that the platform and OS are other.  (It works when I
connect to bugzilla using the web browser).
Comment 1 Mik Kersten CLA 2005-11-07 18:22:48 EST
It works for me.  Did you hit "Update" to get the options updated, e.g. in the
search dialog or the query edit dialog?
Comment 2 Ian Bull CLA 2005-11-07 18:49:43 EST
I was having the problem when I entered a new bug (not search or update), so I
don't think there is an update button.  It seems to be an issue on both Linux
and Windows (at least on our Installs :)

Comment 3 Mik Kersten CLA 2005-11-07 19:00:24 EST
The "Update" button is on the first page of the New Bug Wizard page.  To address
it being hard to notice I just changed the label to: "Update Options from
Bugzilla Server".

Please try this and let me know if you see the Platform options as expected.
Comment 4 Mik Kersten CLA 2005-11-15 16:20:49 EST
Please reopen if this isn't working for you.
Comment 5 Ian Bull CLA 2005-11-15 16:56:14 EST
Still not working.  I also tested it on Chris's Windows machine, and it doesn't
work their either.  This is by no means a show stopper.  If you point me to the
right file in Mylar (Where you look this information up) I can try and debug it
for you.
Comment 6 Mik Kersten CLA 2005-11-15 20:18:45 EST
Is this in the Bug Editor?  I assume that you are using eclipse.org, and that
you have your Bugzilla setting set to 2.18?  If I look at the following bug in
the bug editor: 

    Bugzilla Bug 109311: migrate folding to 3.2M3 APIs

I see Hardware as "PC" and OS as "Windows XP".  Are you saying that this fails
to show them, or that it fails to determine them automatically?
Comment 7 Ian Bull CLA 2005-11-15 20:34:02 EST
It works fine if I view existing bug reports.

But if I select "Add New Bugzilla Report", and then select "Update Options from
Bugzilla Server", and finally select "Mylar".  Then hit "Next", the OS and
Platform are not auto-determined.  It just says "Other".  I can select Linux and
PC.  This is done automatically when I add a bug through the web interface.

-ian
Comment 8 Mik Kersten CLA 2005-11-15 20:47:59 EST
Thanks, I hadn't understood the problem originally.  I'm marking this as
helpwanted, and in case you're interested in taking a look the NewBugWizard is
what determines that.  However, I doubt that this could be implemented the same
way as in the browser, which sends environment variables of your platform. 
Instead it Eclipse or environment variables would probably have to be queried to
determine that. 
Comment 9 Ian Bull CLA 2005-11-15 21:06:35 EST
I will take a look at this. 

note:
Platform.getOS();
Platform.getOSARCH();
Comment 10 Ian Bull CLA 2005-11-16 02:05:39 EST
Ok, I am getting somewhere with this, but I don't know the Bugzilla spec very well.  Do you know if the list of platforms and OSs bugzilla has is documented anywhere?  I have extracted the ones it "actually" returns, but I don't know if this is official, or if this changes often?  If I can't find a match, I will just set it to other, so things should generaly work.  But I would like to know what has to change whenever a new OS gets added to the bugzilla spec.
Comment 11 Ian Bull CLA 2005-11-16 02:56:53 EST
I am assigning this to me so it shows up in my task lists.  
I should have a patch ready for tomorrow.  It won't work in
all cases (There are lots of special cases, such as Linux vs. 
Linux-GTK), but it is a start.  As more cases come up, it gives
us a place to add them.  If it can't figure out the OS / Platform,
it just sets it to "Other".

Is there a set of tests I should run before I send in the patch?
Comment 12 Mik Kersten CLA 2005-11-16 11:20:30 EST
Great that you picked this up!

I really dobut that there is a specified list, but I expect that the current
list you got from eclipse.org Bugzilla is the default that Bugzila ships with,
so it's a good start, and defaulting to "Other" is sensible.

Before submtting the patch you should always run "AllTests", and double-check
the instructions on http://eclipse.org/mylar/dev.php for other conventions. 
Also, each pastch should come with a small unit test.  What you could do is add
a unit test that grabs the current hardware/os version, then runs the part of
the wizard that resolves it, and verifies that that part of the dialog is set
correctly.  It may seem a bit redundant, but it would catch that code breaking.
Comment 13 Ian Bull CLA 2005-11-16 19:12:24 EST
Created attachment 30104 [details]
Patch to determine hardware

WOW! I am having way too many problems with JUnit right now.  I applied the
patch and I got some failures.	I removed the patch, and still got failures.  I
reinstalled and the failures went away, re-applied the patch, failures came
back, tried again, and it worked, tried again and it failed!  Added a comment,
and it worked, added another comment and it failed.  ok, you get the picture.

I was running Eclipse under vmware on my linux box (while linux was still
working away), So I there may be some timing issues. Anyways, I ran all the
test cases on my linux box and everything passed, so I really don't think this
patch is causing the problems.

If someone else can try this patch on their system, that would be great.  I
haven't written a JUnit test for it yet, because there realy isn't that much in
the patch.  (Plus, JUnit is not my friend right now).  I will try and do that
after I get some "real" work done.

The patch can should be applied to AbstractWizardDataPage.  I don't know if
this is the best place for this, so feel free to refactor.
Comment 14 Ian Bull CLA 2005-11-16 19:15:13 EST
Note about my previous post:
When I said everything passed, it was everything except the 4 original linux
failures (see Bug# 116751).

Also, the problems I was having on VMware were errors, not failures.
Comment 15 Mik Kersten CLA 2005-11-16 20:51:19 EST
What were the failures?  We've had race conditions with running the test suite
in the past that were resolved, but it's possible that one of them could get
triggered by a very slow execution (e.g. vmware).
Comment 16 Ian Bull CLA 2005-11-16 21:26:37 EST
They did not seem to be consistent.  That was part of the frustration. I will
run it again tomorrow (when I get back to my machine).

Are you allowed to touch the mouse / do other things while the tests are running?  
Comment 17 Mik Kersten CLA 2005-11-16 21:30:16 EST
Yes, you should be able to do anything, other than select or type directly into
the running Eclipse.  I'm in the process of hardening the suite some more to
race conditions.  Let's pick this up again tomorrow (but note that I'll be
offline after 10am).  But it would be great to get this sorted out and get the
tests all running on Linux, so I appreciate the effort.
Comment 18 Ian Bull CLA 2005-11-17 00:59:54 EST
I applied the patch and ran all the tests on a Windows machine (not VMWare) and
it ran without a problem.  The patch is probably a good start for the Hardware /
OS attribute bug. The test case needs some thought, because it will run
different on each platform.

The race conditions seem to be another issue.

Do you want to open a bug for that (or re-open one if you said it happened before
)?
Comment 19 Mik Kersten CLA 2005-11-17 11:18:30 EST
So are you still seeing test failures on VMWare?  The latest changes to the test
suite should have addressed the race condition that was coming up before, but
perhaps not all of them.

I'd really like to apply this patch for 0.4.3, but before doing so need the test
case described in comment#12 to be added to the patch.  Also could you please
make the new patch according to the convention documented at:
http://eclipse.org/mylar/dev.php (i.e. for the project, name as the project). 
That makes it way easier to apply.
Comment 20 Ian Bull CLA 2005-11-17 13:39:47 EST
Re: Test Failures:   Things are working much better now. I ran the test on
VMWare, with Eclipse running on my linux side as well. I started illustrator
part way through the test and everything worked like a charm.

Re: Current Bug Report:
Sorry I missed the patch specs. I will get that fixed up.  I will try to get a
test case together, but it may take me a while (I have to figure out how to
programmatically run through the wizard).  However, I don't actually use the
wizard in my patch.  I just change the value on Bug Model.  Shawn already had
code to populate the wizard based on the model.  Although I agree that a test
case that actually checks the wizard is probably a good idea.
Comment 21 Mik Kersten CLA 2005-11-17 20:28:47 EST
Are you still getting the same test failures on Linux?

In order to help demonstrate
how to write these kinds of tests I've applied your patch and created
NewBugWizardTest.
 If you just get the right version of those two assertions running we'll be in
business,
and whenever this fails to run on some platform we have a chance of detecting a failure,
and
more importantly if a failure is ever reported by someone we'll be able to update the
test.  Note
that on my Windows machine it currently correctly determines "PC", but fails
to determine that it's
Windows ("win32").

Also note that I added exception handling
to the method, because otherwise it's failure would have made the 
wizard fail.

Comment 22 Mik Kersten CLA 2005-11-23 11:58:45 EST
Ian, let me know if you plan on adding this test so that we can close out this report.  Fyi both setting work properly with Bugzilla 2.20 on Windows :)
Comment 23 Ian Bull CLA 2005-11-25 19:59:56 EST
Created attachment 30655 [details]
Test Case

The long awaited test case :)

Actually, my original patch was a little too clever, and it checked that the platform / os value that was being set, was actually a legal value.  It did this by comparing the list of possible values, with the determined one.  This caused a few problems for the tester, because the tester doesn't know what "legal values" are.  I used some code from another test case to determine this.

The patch is attached.
Comment 24 Mik Kersten CLA 2005-12-01 13:07:43 EST
Patch applied.  I added you to the @author list.  Thanks for contributing this Ian, it's useful to have it working.