More FlexUnit woes (adl hangs)
Hello again,
Well as an experiment to see if I can use gradlefx for the
massive Flex/AS3 project(s) I've "inherited" I decided to fork the
as3corelib and try to build it with gradlefx.
My problem may be with the actual FlexUnit task, however I've
confirmed that using Ant the build runs through normally however
when I try using gradlefx, it is able to execute a few tests (I can
see the report XML files in my build dir) however after a while the
process hangs forever.
I've attached my build.gradle along with the output of my process which for some reason doesn't spew out as much info into the stdout/err as it does when I try to build with Ant.
Has anyone ever had any issues with FlexUnit that resembles this?
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Nicolas Estrada on 22 Mar, 2013 05:19 PM
Forgot to attach my files :)
Support Staff 2 Posted by Maxime Cowez on 22 Mar, 2013 07:07 PM
I can already confirm that the issue is related to ADL.
What I have tried until now:
com/adobe/air/**/*
to theflexUnit.excludes
Support Staff 3 Posted by Maxime Cowez on 22 Mar, 2013 07:16 PM
I gradually started reintegrating your original build script, and I can confirm that it runs normally. (Should've tried that in the first place, grmbl). So discard that previous comment.
It looks like the issue is related to your build environment. Can you give us the specifics of your environment.
Support Staff 4 Posted by Yennick Trevels on 22 Mar, 2013 10:06 PM
I think this can be related to this issue: https://gradlefx.tenderapp.com/discussions/problems/57-flexunit-41-...
To summarize, I was able to reproduce the issue with ant + flexUnit. And for some reason it didn't work on my pc, but it worked on Michael Labriola's pc. But I haven't had time to investigate this any further. The referenced thread should have my test case as attachment.
Support Staff 5 Posted by Maxime Cowez on 23 Mar, 2013 10:57 AM
If it works on one PC and not the other, I guess it should be environment-related.
It works on mine with:
Support Staff 6 Posted by Yennick Trevels on 23 Mar, 2013 11:46 AM
Can you try to run this ant script and see if that also works: https://docs.google.com/open?id=0BwgTrjDn2SAhSmhkWmlQbFlXQ0k
Support Staff 7 Posted by Maxime Cowez on 24 Mar, 2013 10:45 PM
Yes, it runs: with one failing test as a result.
Did this one with standalone ANT 1.9.0
I'll try to have a colleague with a 64-bit Win run this tomorrow.
Support Staff 8 Posted by Yennick Trevels on 25 Mar, 2013 07:15 AM
My ant script also works on my work pc:
But it doesn't work on my pc at home.
Support Staff 9 Posted by Maxime Cowez on 25 Mar, 2013 09:42 AM
Damn! My money was on a 64-bit issue.
The adl used is the one that comes with the SDK, right? So those should be the same as long as you use the same SDK.
Support Staff 10 Posted by Yennick Trevels on 25 Mar, 2013 10:07 AM
Indeed, it's the one in the SDK.
11 Posted by Nicolas Estrada on 25 Mar, 2013 07:24 PM
Well FYI this is my environment:
Now I've noticed a couple of odd things, and being new to Flex (but not new to gradle) maybe you can shed some light:
1. Now I'm able to run the ant test target, and all but 1 test fail, however adl.exe hangs after running the test suite (perhaps related to the bug above)
2. Using the same FLEX_HOME and the same FLEXUNIT_LIBS (I modified the build.xml) using gradlefx I can see in the reports dir that some tests are generated (presence of XML report files) however half aren't.
3. Is it normal that I can't see any stdout/err when running using gradlefx? Is it possible that not capturing the ant task output is what is preventing adl from running properly?
I would be glad to try out someone's build.gradle so that I can see if the problem is indeed purely environment related, although if ant works I don't see why gradlefx wouldn't. The only thing I can think of is that gradlefx generates a TestRunner.swf and the ant builds one based on an mxml file (CoreLibTestRunner in this specific case)
Thanks for any help! :)
Support Staff 12 Posted by Yennick Trevels on 25 Mar, 2013 08:28 PM
Hi Nicolas,
Can you also try this ant script: https://docs.google.com/open?id=0BwgTrjDn2SAhSmhkWmlQbFlXQ0k
You have to set the FLEX_HOME variable in the script and then you can run it by just executing the "ant" command.
Thanks
13 Posted by Nicolas Estrada on 26 Mar, 2013 09:37 AM
Works like a charm. ADL is able to execute the test, and it quits normally. I ran this under cygwin on my Win7 x64 machine. I've attached the output in case it helps at all.
14 Posted by Nicolas Estrada on 26 Mar, 2013 01:07 PM
Thank you Yennick!
Your little project helped me figure out what I needed to do! So I began importing all of the .as files as well as the test .as files into your little flexunit ANT project and after some tests ADL was hanging again.
So I looked around at this site : Configuring the debugger version of Flash Player
and after creating the file
mm.cfg
in C:/Users/nestrada containing :It works! I was able to compile and TEST with gradlefx :) Perhaps you can note this in the documentation if it is not already there ;)
Support Staff 15 Posted by Yennick Trevels on 26 Mar, 2013 01:59 PM
Awesome! This brings us one step further in the process of solving this. While editing the mm.cfg file is a reasonable temporary solution, it is not ideal when you want to share your project with others.
I'll try this out on my pc at home tomorrow and see if it's also solved there with the mm.cfg config.
Thanks for investigating this further!
Support Staff 16 Posted by Yennick Trevels on 28 Mar, 2013 04:46 PM
For some reason I can't reproduce the problem anymore on any of my pc's with the ant script, while it has been failing in the past. Must be witchcraft...
17 Posted by NagRock on 11 Jul, 2013 09:27 AM
Worked for me. Thanks!
18 Posted by sorin.portase on 23 Jul, 2013 11:39 AM
Actually only the ErrorReportingEnable=1 setting is required.
I have also noticed that FlashDevelop magically creates the mm.cfg file with the ErrorReportingEnable=1 setting.
19 Posted by Szymon Bochniak on 08 Aug, 2013 07:29 PM
Thanks for the solution. Adding the mm.cfg helped me as well!
Support Staff 20 Posted by Yennick Trevels on 07 Mar, 2016 09:09 AM
I think I've found the actual cause of this issue and documented the troubleshooting process and solution in the GradleFx documentation: http://doc.gradlefx.org/en/latest/flexunit.html#my-unit-tests-hang-...