Closed Bug 854868 Opened 11 years ago Closed 11 years ago

Make srcdir and objdir paths match for mochitest-a11y files

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla23

People

(Reporter: surkov, Assigned: mbrubeck)

References

Details

(Whiteboard: [mach])

Attachments

(1 file, 5 obsolete files)

recently the way I used to run a11y mochitest stopped to work:
python runtests.py --a11y --test-path=accessible/text/test_multiline.html
gives me an error.

.mach doesn't allow me to run a single test:

mach --mochitest-a11y accessible/tests/mochitests/text/test_multiline.html
doesn't show any test (path relative top dir)

mach --mochitest-a11y accessible/text/test_multiline.html
gives me en error (path relative testing dir)

please fix this issue asap since it's a blocker for me
I ran into this yesterday as well :(
So, as a short-term workaround, you can replace the 'python' in your original command with '$objdir/_virtualenv/bin/python'. Alternately you can 'source $objdir/_virtualenv/bin/activate' to activate the in-tree virtualenv in this shell and then simply run 'python'.

Longer-term we should fix mach's mochitest-a11y to do what you need.
Attached patch patch (obsolete) — Splinter Review
This patch just removes mach's srcdir file check, since the source path is not guaranteed to match the test root path.  We really need to move this check into the test harness, which knows where the test root is.

With this patch, you can use test-root-relative paths like "mach mochitest-a11y accessible/text/test_multiline.html"

Alternately, we could fix the relativesrcdir lines in the mochitest-a11y makefiles so that the srcdir and test-root paths were identical, e.g.:

http://hg.mozilla.org/mozilla-central/file/8d09f003e087/accessible/tests/mochitest/Makefile.in#l10

Then you could use the srcdir path and benefit from things like tab completion in the shell.
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Attachment #729557 - Flags: review?(gps)
Attachment #729562 - Flags: feedback?(surkov.alexander)
Yeah. Can we do that?
There are many other places where relativesrcdir is not @relativesrcdir@, can be change that too?
It looks like dbaron tried the relativesrcdir change in bug 847279 and ran into errors; any URIs that reference other /accessible/tests/mochitest files will need to be updated too.
Depends on: 847279
I reckon bug 818819 may also help here.
(In reply to Matt Brubeck (:mbrubeck) from comment #8)
> It looks like dbaron tried the relativesrcdir change in bug 847279 and ran
> into errors; any URIs that reference other /accessible/tests/mochitest files
> will need to be updated too.

I don't think these errors are that hard to fix; I just haven't gotten to it yet.  If somebody else wants to pick it up, that would be great.
> Then you could use the srcdir path and benefit from things like tab
> completion in the shell.

tab completion only works if cwd == topsrcdir which is suboptimal for lots of other things.

> I don't think these errors are that hard to fix; I just haven't gotten to it
> yet.  If somebody else wants to pick it up, that would be great.

I suspect you're right, but if we changing the path I'd prefer to get rid of the mochitest/ part at least to keep the path you need to type short.
Comment on attachment 729562 [details] [diff] [review]
alternate patch: make relativesrcdir = @relativesrcdir@

it works, thank you
Attachment #729562 - Flags: feedback?(surkov.alexander) → feedback+
(In reply to alexander :surkov from comment #12)
> Comment on attachment 729562 [details] [diff] [review]
> alternate patch: make relativesrcdir = @relativesrcdir@
> 
> it works, thank you

it has a problem, when running events/test_scroll.xul then it doesn't see longer the scroll.html file of the same folder (it says  /a11y/accessible/events/scroll.html was not found).
Attachment #729557 - Flags: review?(gps)
Attached patch relativesrcdir patch v2 (obsolete) — Splinter Review
Fixed some absolute paths.

I'm currently testing this locally, then I'll push it to Try.
Attachment #729557 - Attachment is obsolete: true
Attachment #729562 - Attachment is obsolete: true
mach now natively integrates with the Python mochitest runner as of bug 818819. That may have implications for this bug. (But not if we go down the relativesrcdir path.)
Component: mach → Mochitest
Product: Core → Testing
Whiteboard: [mach]
Attachment #730198 - Attachment is obsolete: true
Patch v3 is green on Try.  This is identical except for some whitespace fixes.
Attachment #730216 - Attachment is obsolete: true
Attachment #730297 - Flags: review?(surkov.alexander)
At Trevor Saunders' request, this makes the test paths a bit shorter by removing the "mochitests" subdirectory.  Pushed to Try:

https://tbpl.mozilla.org/?tree=Try&rev=2796e9dfdd5c
Attachment #730301 - Flags: review?(surkov.alexander)
Comment on attachment 730297 [details] [diff] [review]
relativesrcdir patch v4

stealing since I don't think surkov needs to spend time on this
Attachment #730297 - Flags: review?(surkov.alexander) → review+
Comment on attachment 730301 [details] [diff] [review]
move files from accessible/tests/mochitest to accessible/tests

looks correct, but lets be sure surkov thinks this is a good idea too since I suggested it :)
Attachment #730301 - Flags: review+
Comment on attachment 730301 [details] [diff] [review]
move files from accessible/tests/mochitest to accessible/tests

it's good, I'm curious if add another kind of tests then where they will be located.

(btw, it'd be good to remove crashtests since we don't have any plans to ressurect them) (we have a bug iirc on this though)
Depends on: 855563
By the way, bug 855563 (currently on inbound) fixes commands that use test root paths like "mach mochitest-a11y accessible/text/test_multiline.html"

So the patches in this bug are no longer required to make mach work, but they are still useful for other reasons.  Making srcdir and objdir paths match should reduce confusion, and make it easier to use tab completion to run test commands.
I'm up for short paths sure.

Also I want to have one more test suite for accessibility at some point (https://wiki.mozilla.org/Accessibility/MATS). It'd be good to discuss ideas how we can organize folders when that day comes.
(In reply to alexander :surkov from comment #21)
> Comment on attachment 730301 [details] [diff] [review]
> move files from accessible/tests/mochitest to accessible/tests
> 
> it's good, I'm curious if add another kind of tests then where they will be
> located.

that bridge seems far enough out I'm tempted  to leave worrying about how  to cross it too another day

> (btw, it'd be good to remove crashtests since we don't have any plans to
> ressurect them) (we have a bug iirc on this though)

yeah, my only question is if we should rewrite the 1 existing one as a mochitest or if its obsolete.
Alex, do you plan to review that one patch or should I just cancel the request?
(In reply to Trevor Saunders (:tbsaunde) from comment #25)
> Alex, do you plan to review that one patch or should I just cancel the
> request?

I still not sure the patch is a good idea

(In reply to Trevor Saunders (:tbsaunde) from comment #24)
> (In reply to alexander :surkov from comment #21)
> > Comment on attachment 730301 [details] [diff] [review]
> > move files from accessible/tests/mochitest to accessible/tests
> > 
> > it's good, I'm curious if add another kind of tests then where they will be
> > located.
> 
> that bridge seems far enough out I'm tempted  to leave worrying about how 
> to cross it too another day

MATS project is one of our urgent things, I hope it's no so far so we can ignore it. In other words say we have a MATS tests today how we can put them into folders?

> > (btw, it'd be good to remove crashtests since we don't have any plans to
> > ressurect them) (we have a bug iirc on this though)
> 
> yeah, my only question is if we should rewrite the 1 existing one as a
> mochitest or if its obsolete.

we have XUL tree hit testing in mochitests already so remove it.
(In reply to alexander :surkov from comment #26)
> (In reply to Trevor Saunders (:tbsaunde) from comment #25)
> > Alex, do you plan to review that one patch or should I just cancel the
> > request?
> 
> I still not sure the patch is a good idea
> 
> (In reply to Trevor Saunders (:tbsaunde) from comment #24)
> > (In reply to alexander :surkov from comment #21)
> > > Comment on attachment 730301 [details] [diff] [review]
> > > move files from accessible/tests/mochitest to accessible/tests
> > > 
> > > it's good, I'm curious if add another kind of tests then where they will be
> > > located.
> > 
> > that bridge seems far enough out I'm tempted  to leave worrying about how 
> > to cross it too another day
> 
> MATS project is one of our urgent things, I hope it's no so far so we can
> ignore it. In other words say we have a MATS tests today how we can put them
> into folders?

well, nobody is working on it so I don't expect to see it immediately and changing things around for whatever we need is easy enough so I think we can more or less ignore it.  In the worst case we'd decide we'll decide in a couple months the best solution is to have accessible/tests/mochitest/ and accessible/tests/platform in which case doing this now made or lives better for a couple months at the cost of an hour of work.

I can  imagine any number of ways we could do things we could have accessible/src/mac/tests accessible/src/windows/tests/ etc or we could have just accessible/tests/ containing both mochitests and platform tests or we could have accessible/mochitests/ and accessible/platformtests/ and probably a number of other options among which I don't want to think about which I prefer until I know what the tests will look like.

> > > (btw, it'd be good to remove crashtests since we don't have any plans to
> > > ressurect them) (we have a bug iirc on this though)
> > 
> > yeah, my only question is if we should rewrite the 1 existing one as a
> > mochitest or if its obsolete.
> 
> we have XUL tree hit testing in mochitests already so remove it.

ok, I'll file a sepperate bug for that
If we will end up with what we have then I wouldn't change anything now. 

Do we have anything here left except the latest patch?
(In reply to alexander :surkov from comment #28)
> If we will end up with what we have then I wouldn't change anything now. 

I'm hopeing we'll end up with something shorter, but who can say for sure
Should I at least land my @relativesrcdir@ patch for now?  That will mean typing slightly longer paths at the command line, but it will let you use tab completion to type the paths for you.  :)  Also it makes some of the tests more robust against breaking in case you do decide to move them in the future.
(In reply to Matt Brubeck (:mbrubeck) from comment #30)
> Should I at least land my @relativesrcdir@ patch for now?  That will mean
> typing slightly longer paths at the command line, but it will let you use
> tab completion to type the paths for you.  :)  Also it makes some of the
> tests more robust against breaking in case you do decide to move them in the
> future.

I don't see a reason why not, sorry to keep you waiting :(
Landing just the @relativesrcdir@ patch.  We can file a new bug if anyone wants to resurrect the second patch or move these tests to some other location.

https://hg.mozilla.org/integration/mozilla-inbound/rev/a7ec1554d481
Blocks: 847279
No longer depends on: 847279
OS: Mac OS X → All
Hardware: x86 → All
Summary: no way to provide a test path for mochitest-a11y → Make srcdir and objdir paths match for mochitest-a11y files
Attachment #730301 - Attachment is obsolete: true
Attachment #730301 - Flags: review?(surkov.alexander)
(In reply to Matt Brubeck (:mbrubeck) from comment #32)
> Landing just the @relativesrcdir@ patch.  We can file a new bug if anyone
> wants to resurrect the second patch or move these tests to some other
> location.

well, I've wanted to take a patch like it for a long time, but never had the time to write it and now Alex doesn't seem to agree :(
https://hg.mozilla.org/mozilla-central/rev/a7ec1554d481
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: