FlexUnit 4 und TeamCity

Wissenswertes
8 Kommentare

Nur in Englisch verfügbar.

Vorheriger Beitrag
Structure101g AS Screencast
Nächster Beitrag
24. Wispri: Hindernisse auf dem Weg zum Ziel beseitigen

Related Posts

AsFlavor: Structure101g for Flex and Actionscript

Together with “The Structure Guys” from Headway Software we developed an Actionscript “flavor” for their latest Structure101 product family member Structure101g(eneric). AsFlavor makes the same esteemed structural and architectural analysis functionality available to the Flex and Actionscript community, that is well known to Java and C++ developers since years.

Weiterlesen

8 Kommentare. Hinterlasse eine Antwort

Hi Harald, I’m just taking a look into this now and was wondering if you could explain how you are running your tests under TeamCity?

We’re using ant with the flexunit ant task here and the tracing to std out by the TeamCityListener is not getting picked up. How do you get this trace into the TeamCity logs using ant?

Thanks,
Mike

Antworten

@ Mike

You have to add the listener to your test runner manually:


private function run():void {
    var core:FlexUnitCore = new FlexUnitCore();
    core.addListener(new TeamCityListener());
    core.run(LibraryTestSuite);
}

other than that, we don’t do anything special, we just run the swf within the flashplayer within ant with:


<exec executable="${player.home}/flashplayer">
    <arg line="${bin.dir}/TeamCityTestRunner.swf"/>
</exec>

Cheers,
Harald

Antworten

@ Harald Radi

Thanks Harald, I had part one in place but was using flex ant task to build.

Switching over to use exec I’m noticing that the flash player will not obviously close once tests are complete.

Our build process compiles a number of test swfs so this means the build will freeze up unless we spawn a new player instance for each test. We then need to kill these at the end of the build. This raises an issue if the tests aren’t complete when we do the final kill.

How do you get around closing the player once tests are complete?

Antworten

Just looking over your source I see you call fscommand(“quit”); once the tests are complete. Not sure why this isn’t closing the standalone player for me. I’ll recompile and do some digging.

Antworten

@ Mike

The player should actually close itself properly, the only hint i could give is not to use other listeners together with the TeamCityListener as they could prevent the player from closing properly.

Antworten

OK so I’ve got everything in place like you said but still no trace output from the flash player to the teamcity logs. If I run the ant script locally I don’t see any trace output either, just:

Buildfile: C:\build.xml
test:
testClean:
testCompile:
[mxmlc] Loading configuration file C:Program Files (x86)AdobeAdobe Flash Builder 4sdks4.1.0frameworksflex-config.xml
[mxmlc] C:\testflexUnit-runnerShellUnitTestRunner.swf (737742 bytes)
testRunner:
BUILD SUCCESSFUL
Total time: 5 seconds

The runner task is exactly like you specified above and opens, runs and closes the test swf.

If I run the tests under FlashBuilder I see the teamcity traces as expected. Also worth saying that if I add the XMLListener I can confirm the tests do run when compiling through Ant.

Sorry for the repeat updates. Any pointers appreciated on how to get trace out through Ant.

Antworten

Just to close this off, I’ve update your TeamCityListener to broadcast results over a socket and updated FlexUnitTask with an option to prints what it receives to std out. This is all working great now. If I get a sec this weekend I’ll do a fork with these updates on githhub.

Cheers,
Mike

Antworten

Hey Mike,

Did you ever fork and make these changes to the TeamCityListener?

Thanks,
Jay

Antworten

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Bitte füllen Sie dieses Feld aus
Bitte füllen Sie dieses Feld aus
Bitte gib eine gültige E-Mail-Adresse ein.
Sie müssen den Bedingungen zustimmen, um fortzufahren

Menü