Opened 9 years ago

Closed 7 years ago

#10511 closed enhancement (worksforme)

[patch]Allow doh runner.js to register module paths when used from rhino/runner.sh

Reported by: Tom Elliott Owned by: haysmark
Priority: low Milestone: tbd
Component: TestFramework Version: 1.4.0
Keywords: Cc: Tom Trenka
Blocked By: Blocking:

Description

Hey guys.

Not sure if I'm totally missing the point here, but I've been trying to run some tests from the commandline via rhino.

My directory structure is like: (See attached pic, trac was mangling all my ascii-art :(

Now, I want to run the tests in myProject/tests/module.js as part of our maven2 test cycle, i.e. from the commandline. Because myProject is not a sister to the src relesae of dojo I need to register the module. All good so far.

However, I can't figure out how to do this when running runner.sh from the command line.

I've modified runner.js to allow runner.sh to be run thus:

./runner.sh registerModulePaths=myProject,../../myProject:foo,../../foo testModule=myProject.tests.module

(So, you can register more than one module path splitting with a colon. However, it looks like you can only specify a single testModule so presumably that's redundant anyway?)

Patch is attached. If this isn't needed can someone tell me what I'm doing wrong :).

Thanks,

Tom

Attachments (2)

dojoDirStructure.png (30.1 KB) - added by Tom Elliott 9 years ago.
runner.js.diff (951 bytes) - added by Tom Elliott 9 years ago.
v2, there was a typo in the first one

Download all attachments as: .zip

Change History (11)

Changed 9 years ago by Tom Elliott

Attachment: dojoDirStructure.png added

comment:1 Changed 9 years ago by Adam Peller

Component: GeneralTestFramework
Owner: changed from anonymous to alex
Summary: Allow doh runner.js to register module paths when used from rhino/runner.sh[patch]Allow doh runner.js to register module paths when used from rhino/runner.sh

might be related to #5630

Changed 9 years ago by Tom Elliott

Attachment: runner.js.diff added

v2, there was a typo in the first one

comment:2 Changed 8 years ago by Chris Mitchell

Owner: changed from alex to dylan

please review/triage

comment:3 Changed 7 years ago by Tom Trenka

Cc: Tom Trenka added
Owner: changed from dylan to Adam Peller
Priority: highlow
Status: newassigned

This looks to be a dupe of #5630 ; reassigning to peller (owner of the other ticket) and adding me as a cc.

comment:4 Changed 7 years ago by Adam Peller

I'm ok marking this as a dup, but I'm uncomfortable making changes to DOH and probably not able to apply these changes anytime soon

comment:5 Changed 7 years ago by Adam Peller

Resolution: duplicate
Status: assignedclosed

Duplicate of #5630.

comment:6 Changed 7 years ago by andybalaam

The attached patch solves this problem for me, whereas the patch attached to #5630 seems to be solving a different issue.

comment:7 Changed 7 years ago by Adam Peller

Resolution: duplicate
Status: closedreopened

comment:8 Changed 7 years ago by Adam Peller

Owner: changed from Adam Peller to haysmark
Status: reopenedassigned

Mark, can you please take a look at these patches?

comment:9 Changed 7 years ago by haysmark

Resolution: worksforme
Status: assignedclosed

In AMD, instead of registering module paths, you load a loader script that sets dojoConfig with the required packages and then loads dojo.js. The following command will run the test in someModule:

java -jar ../shrinksafe/js.jar ../../myProject/loader.js baseUrl=../../dojo load=doh test=someModule/tests/module

loader.js:

dojoConfig={
	packages:[{
		name:"someModule",
		location:"../myProject/someModule"
	}]
};
load("../../dojo/dojo.js");

We see precisely this sort of configuration in runner.html with _parseURLargs.js.

Note: See TracTickets for help on using tickets.