Add Makefile target to launch solo xpcshell test without interactive mode

VERIFIED FIXED in mozilla1.9

Status

Testing
XPCShell Harness
--
enhancement
VERIFIED FIXED
10 years ago
9 years ago

People

(Reporter: Laurent Jouanneau, Assigned: Laurent Jouanneau)

Tracking

Trunk
mozilla1.9
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

10 years ago
Here is a patch to launch a single xpcshell test, without entering in an interactive mode. For this, there is a new target, "check-one" :

  make SOLO_FILE=test_mytest.js check-one
You forgot the patch.  :-)
maybe that's all there is to it!
(Assignee)

Comment 3

10 years ago
Oups sorry ! I think I forgot to fill the patch description and bugzilla didn't save the patch :-) I will add it tomorrow when I'll go back at work.
(Assignee)

Comment 4

10 years ago
Created attachment 289638 [details] [diff] [review]
The patch

Ok, here is the patch :-)
Attachment #289638 - Flags: review?(rcampbell)
Comment on attachment 289638 [details] [diff] [review]
The patch

requesting buildsystem sr. This looks good to me, but I'd like some extra vetting.
Attachment #289638 - Flags: superreview?(ted.mielczarek)
Attachment #289638 - Flags: review?(rcampbell)
Attachment #289638 - Flags: review+
Attachment #289638 - Flags: superreview?(ted.mielczarek) → superreview+
(Assignee)

Updated

10 years ago
Keywords: checkin-needed
(Assignee)

Updated

10 years ago
Attachment #289638 - Flags: approval1.9?
Not checkin-needed until approval has been granted for the POTB changes.
Keywords: checkin-needed
Comment on attachment 289638 [details] [diff] [review]
The patch

a=beltzner on behalf of drivers
Attachment #289638 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in config/rules.mk;
/cvsroot/mozilla/config/rules.mk,v  <--  rules.mk
new revision: 3.577; previous revision: 3.576
done
Checking in tools/test-harness/xpcshell-simple/test_one.sh;
/cvsroot/mozilla/tools/test-harness/xpcshell-simple/test_one.sh,v  <--  test_one.sh
new revision: 1.4; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M10
This seems to be a little broken.  When I actually try to use it, the test is run twice:

netwerk% make SOLO_FILE=test_bug261425.js check-one
NATIVE_TOPSRCDIR='../../../mozilla' TOPSRCDIR='../../../mozilla' ../../dist/bin/xpcshell -s -f ../../../mozilla/tools/test-harness/xpcshell-simple/head.js -f ../../_tests/xpcshell-simple/test_necko//unit/head_channels.js -f ../../_tests/xpcshell-simple/test_necko//unit/test_bug261425.js -f ../../../mozilla/tools/test-harness/xpcshell-simple/tail.js -f ../../../mozilla/tools/test-harness/xpcshell-simple/execute_test.js 2>&1
test_bug261425.js: PASS
NATIVE_TOPSRCDIR='../../../../mozilla' TOPSRCDIR='../../../../mozilla' ../../../dist/bin/xpcshell -s -f ../../../../mozilla/tools/test-harness/xpcshell-simple/head.js -f ../../../_tests/xpcshell-simple/test_necko//unit/head_channels.js -f ../../../_tests/xpcshell-simple/test_necko//unit/test_bug261425.js -f ../../../../mozilla/tools/test-harness/xpcshell-simple/tail.js -f ../../../../mozilla/tools/test-harness/xpcshell-simple/execute_test.js 2>&1
test_bug261425.js: PASS

It seems that check_one.sh is actually executed twice in this case.  I don't know why, exactly.
not sure, but worth looking into to figure out. My first grazing through the patch didn't find anything obvious, but I'm wondering if we're executing two targets somehow?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Yeah, my look didn't really tell me much either.

For what it's worth, if I change config/rules.mk and add 

	echo "ABCDEF"

right below the

  # Test execution
  check-one::

bit, I see it echoed twice.
Interesting.  When I allow verbose make output, if I'm doing the make from $objdir/network/test I see:

echo "ABCDEF"
ABCDEF
NATIVE_TOPSRCDIR='../../../mozilla' TOPSRCDIR='../../../mozilla' ../../dist/bin/xpcshell -s -f ../../../mozilla/tools/test-harness/xpcshell-simple/head.js -f ../../_tests/xpcshell-simple/test_necko//unit/head_channels.js -f ../../_tests/xpcshell-simple/test_necko//unit/test_bug261425.js -f ../../../mozilla/tools/test-harness/xpcshell-simple/tail.js -f ../../../mozilla/tools/test-harness/xpcshell-simple/execute_test.js 2>&1
test_bug261425.js: PASS
gmake[1]: Entering directory `/home/bzbarsky/mozilla/vanilla/obj-seamonkey/netwerk/test/chrome'
gmake[1]: Leaving directory `/home/bzbarsky/mozilla/vanilla/obj-seamonkey/netwerk/test/chrome'
gmake[1]: Entering directory `/home/bzbarsky/mozilla/vanilla/obj-seamonkey/netwerk/test/httpserver'
echo "ABCDEF"
ABCDEF
NATIVE_TOPSRCDIR='../../../../mozilla' TOPSRCDIR='../../../../mozilla' ../../../dist/bin/xpcshell -s -f ../../../../mozilla/tools/test-harness/xpcshell-simple/head.js -f ../../../_tests/xpcshell-simple/test_necko//unit/head_channels.js -f ../../../_tests/xpcshell-simple/test_necko//unit/test_bug261425.js -f ../../../../mozilla/tools/test-harness/xpcshell-simple/tail.js -f ../../../../mozilla/tools/test-harness/xpcshell-simple/execute_test.js 2>&1
test_bug261425.js: PASS
gmake[1]: Leaving directory `/home/bzbarsky/mozilla/vanilla/obj-seamonkey/netwerk/test/httpserver'

So something in the httpserver dir is running the unit test again?
Perhaps the 

  XPCSHELL_TESTS = test

in httpserver/Makefile.in?
I know luser (Ted?  *mind explodes) was fooling around with this recently so that errors could linkify the test file; this could be fallout.
Hmm?  I had a patch that got backed out, but I don't think I touched anything else.  I'll take a look though.
Also, I can't replicate this on Win32.  The test executes once only.  I just tried it on Linux, however, and I see the double-execute.

Oh, it makes sense why this would happen.  The MODULE is set to the same thing in netwerk/test/Makefile.in and netwerk/test/httpserver/Makefile.in, and the check-one target does a LOOP_OVER_DIRS, so the test winds up getting run for each Makefile there.  We should probably just remove the LOOP_OVER_DIRS bit for check-one and check-interactive.  You'd just have to call make from netwerk/test/httpserver directly then.
makes sense, and confirms my gut suspicion that it was make doing something extra. Feel like fixing, Laurent? I don't think this hurts us leaving it as-is in the meantime, but would like to get it perfected.
Whiteboard: [needs fix]
It was hurting me because the test I was running takes 5-10 minutes to run, so doubling the time really sucks...
(Assignee)

Comment 20

10 years ago
I removed LOOP_OVER_DIRS and it works, so I think we can remove it. Should we also remove LOOP_OVER_TOOL_DIRS ?

Please do, for consistency.
(Assignee)

Comment 22

10 years ago
Created attachment 292421 [details] [diff] [review]
Patch which fixes the Bz's bug

Here is a little patch which fix the bug found by Boris.
Attachment #292421 - Flags: superreview?(ted.mielczarek)
Attachment #292421 - Flags: review?(rcampbell)
Comment on attachment 292421 [details] [diff] [review]
Patch which fixes the Bz's bug

You actually want to remove the check-interactive:: and check-one:: lines as well.  Also, my review is sufficient here.
Attachment #292421 - Flags: superreview?(ted.mielczarek)
Attachment #292421 - Flags: review?(rcampbell)
Attachment #292421 - Flags: review+
(Assignee)

Updated

10 years ago
Attachment #292421 - Flags: approval1.9?

Comment 24

10 years ago
Comment on attachment 292421 [details] [diff] [review]
Patch which fixes the Bz's bug

Thanks!
Attachment #292421 - Flags: approval1.9? → approval1.9+
(Assignee)

Updated

10 years ago
Keywords: checkin-needed
Checking in config/rules.mk;
/cvsroot/mozilla/config/rules.mk,v  <--  rules.mk
new revision: 3.580; previous revision: 3.579
done
Status: REOPENED → RESOLVED
Last Resolved: 10 years ago10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs fix]
This appears to have broken check-interactive.  It doesn't wait for you to run it anymore, it just runs it.

Updated

10 years ago
Blocks: 416388
Blocks: 448858
Component: Testing → TUnit
Product: Core → Testing
QA Contact: testing → tunit
Target Milestone: mozilla1.9beta2 → mozilla1.9
(In reply to comment #26)
> This appears to have broken check-interactive.  It doesn't wait for you to run
> it anymore, it just runs it.

Shawn, has this been solved already? 

I tried to run a test in interactive mode and for me it hangs. There is no command line shown as how it is written here:

https://developer.mozilla.org/en/Writing_xpcshell-based_unit_tests#Via_check-interactive
(In reply to comment #27)
> Shawn, has this been solved already? 
This fixed it a while ago, but it's broken again.  I haven't filed a bug about it yet, but since it's been broken for several weeks and you are the only other person who has complained about it, I can't see it getting fixed any time soon :(
Shawn, does it mean you see the hang too or that it is executed immediately?
(In reply to comment #29)
> Shawn, does it mean you see the hang too or that it is executed immediately?
Both actually - it never finishes, and runs the test immediately.
For what it's worth, I've been assuming that the check-interactive stuff was known to be broken.  Maybe I shouldn't have.  Debugging unit test failures is a PITA while it's broken, of course.  :(

If someone else doesn't file it before I have a sane net connection again (on the 5th), I'll do that.
Filed as bug 472004.

Otherwise marking this bug as verified. Works as expected with check-one.
Status: RESOLVED → VERIFIED
Depends on: 472004
You need to log in before you can comment on or make changes to this bug.