Trouble running rake cruise on mxml project

1 view
Skip to first unread message

akw

unread,
Jun 24, 2009, 2:44:35 PM6/24/09
to ProjectSprouts
I'm trying to get an mxml app's tests to run through rake cruise. The
app builds fine and the tests run fine with rake test. I found this
message in the archives:

http://groups.google.com/group/projectsprouts/browse_thread/thread/274cecf7ed2099ad/caf92f1f47845c34?lnk=gst&q=mxml+cruise#caf92f1f47845c34

Doesn't look like those changes ever got checked in. I tried to add
them by hand, but when I run rake cruise, flash professional tries to
start up, asks me for a license key. The tests run, but the whole job
hangs and never returns. cruisecontrol.rb's not going to like the
hanging. Anyone run into any of these problems?

To summarize:
1) Are mxml projects set up by default to use cruisecontrol? Are the
steps described in the thread above sufficient to allow mxml projects
to be integrated with cruisecontrol?

2) Does anyone else get the wrong app opened (flash / vs standalone
flash player) when calling rake cruise? I get the standalone player
when I just run rake test

3) Do the tests hang at the end of running? I'm assuming if
cruisecontrol is going to be running the tests that the task should
execute and return eventually.

Any help would be greatly appreciated.

-alex

akw

unread,
Jun 24, 2009, 5:13:25 PM6/24/09
to ProjectSprouts
Okay, there was certainly some user error involved. I had the wrong
default app set for .swf's. Tests run fine through rake cruise as
long as the changes described in the thread are put into the mxml
bundle. I forked the repo to put them in and lo and behold they're
already in.

Can you release a new gem with the changes so that when I install
sprout-mxml-bundle I get the latest version that matches what I'm
seeing in the repo?

Thanks,

-alex

On Jun 24, 11:44 am, akw <a...@toolshed.org> wrote:
> I'm trying to get an mxml app's tests to run through rake cruise.  The
> app builds fine and the tests run fine with rake test.  I found this
> message in the archives:
>
> http://groups.google.com/group/projectsprouts/browse_thread/thread/27...

Luke Bayes

unread,
Jun 24, 2009, 10:19:14 PM6/24/09
to project...@googlegroups.com
Hey Alex,

Thanks for answering your own question!

Just to clarify for everyone else, if you install Flash Authoring - it changes your system so that the Authoring tool becomes the 'default application' for SWF content. I have seen this change take place on Macs even after an install. 

The reason this problem only appeared in the cruise task is because we run that task we actually run the Flex Debugger which sadly doesn't give us the ability to target a specific Flash Player application. When we run rake or rake test, we can specify the runtime.

As far as getting a new MXML gem built, I'll try to get to that this weekend, sorry for the delay.


Thanks for digging through this stuff Alex!

Luke

Luke Bayes

unread,
Jul 28, 2009, 1:05:00 PM7/28/09
to project...@googlegroups.com
I just got a great question off-list about running rake cruise on a
Flex project and it seems we have a couple of bugs that need
addressed.

Check out the following in the near term if you're in the same camp:

Your Main MXML document should extend FlexRunner (not TestRunner), and
then call 'runner.setPrinter', instead of just 'setPrinter'.

The FlexRunner is just a simple wrapper that extends Application and
composes a TestRunner. This will allow you to instantiate Components
properly.

I just tried this locally, and it seems that Flex applications
interact with the Flex debugger differently than regular ActionScript
aplications and our FDB helper isn't really working properly.

For the short term, you'll need to break out (and remove) the existing
cruise task helper into actual build tasks so that you can configure
FDB to wait for the extra frame full of actions that MXML projects have.

Replace 'SomeProject' with your project name.

---------------------------------------
output_file = 'bin/SomeProjectXMLRunner.swf'

# This is the FDB task - if you remove the second continue
# You can interact with the Flex Shell Debugger (breakpoints/etc)
fdb "run_#{output_file}" => output_file do |t|
 t.file = output_file
 t.kill_on_fault = true
 t.run
 t.continue
 t.sleep_until(/fdb/)
 t.continue
end

# Configure this with your libraries and source paths
# as it will not pick up configuration from your ProjectModel
mxmlc output_file do |t|
 t.input 'src/SomeProjectXMLRunner.as'
 t.source_path << 'test'
 t.source_path << 'lib/asunit3'
end

desc "Compile and run CI build"
task :cruise => "run_#{output_file}"

---------------------------------------

Thanks!

Luke

Alex Wong

unread,
Aug 4, 2009, 4:01:54 AM8/4/09
to project...@googlegroups.com
Luke-

Tried to get this monkey patch to work. I'm sure that I missed
something, but I get the following error from rake:

[10:26] kiki:umsclient: rake cruise --trace
(in /Users/alex/Home/Work/brightroll/umsclient)
rake aborted!
Don't know how to build task 'bin/umsXMLRunner.swf'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1724:in `[]'
/usr/local/lib/ruby/gems/1.8/gems/sprout-0.7.211/lib/sprout/tasks/
tool_task.rb:364:in `resolve_libraries'
/usr/local/lib/ruby/gems/1.8/gems/sprout-0.7.211/lib/sprout/tasks/
tool_task.rb:363:in `each'
/usr/local/lib/ruby/gems/1.8/gems/sprout-0.7.211/lib/sprout/tasks/
tool_task.rb:363:in `resolve_libraries'
/usr/local/lib/ruby/gems/1.8/gems/sprout-0.7.211/lib/sprout/tasks/
tool_task.rb:236:in `define'
/usr/local/lib/ruby/gems/1.8/gems/sprout-as3-bundle-1.0.24/lib/sprout/
tasks/fdb_task.rb:153:in `define'
/usr/local/lib/ruby/gems/1.8/gems/sprout-0.7.211/lib/sprout/tasks/
tool_task.rb:60:in `define_task'
/usr/local/lib/ruby/gems/1.8/gems/sprout-as3-bundle-1.0.24/lib/sprout/
tasks/fdb_task.rb:694:in `fdb'
/Users/alex/Home/Work/brightroll/umsclient/rakefile.rb:60
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2379:in `load'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2379:in
`raw_load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2013:in
`load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2012:in
`load_rakefile'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1996:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1994:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.6/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

I also get the same error now when I try to run 'rake test'.

Any help would be greatly appreciated.

-alex

Luke Bayes

unread,
Aug 4, 2009, 12:20:52 PM8/4/09
to project...@googlegroups.com
It looks like this line:

Don't know how to build task 'bin/umsXMLRunner.swf'

is complaining that there isn't a known MXMLC task that creates the SWF.

If you attach your rakefile off list, I'll be happy to take a look at it.


Thanks,

Luke
Reply all
Reply to author
Forward
0 new messages