MonoDevelop Integration

210 views
Skip to first unread message

Dale Ragan

unread,
May 29, 2010, 2:11:05 AM5/29/10
to SpecFlow
Sorry about the hiatus on my fork[1] for adding support for
MonoDevelop,
I've been swamped lately. I have some good news to report though. I
decided to spend some time tonight to get my fork updated with all the
changes that you guys have been adding. After merging in latest from
TechTalk's git repository, I went through and made sure everything
compiles. At this point all relevant projects needed to create the
add-in for MonoDevelop compile. I had to add a reference to
IKVM.OpenJDK.Security.dll to the Parser to run and get the Parser
tests passing. I am still receiving 18 test failures when running the
Runtime tests. Instead of receiving a InconclusiveException from
NUnit, we are receiving a NullReferenceException. I will investigate
this more tomorrow.

Also, I received an email from Pete Restall letting me know that he
cloned my fork and was able to run specflow.exe with Mono to generate
his tests based off his feature definitions. At this point things are
looking up on having support for MonoDevelop. The add-in really won't
take very long to create, now that I have all the relevant projects
compiling, which I hope to start this weekend and I'm hoping to have a
alpha version running by Tuesday.

Cheers,

Dale
http://sinesignal.com/

[1]: http://github.com/sinesignal/SpecFlow

Jonas Bandi

unread,
May 29, 2010, 7:36:46 AM5/29/10
to spec...@googlegroups.com
Sounds very cool! Thanks for your efforts!
Keep us informed on any progress.

Would be cool if Pete Restall or you could write down how to use SpecFlow with Mono. Either in a blog post or on the SpecFlow Github wiki (which has no content yet but hopefull will get some in the near future).

-jonas
--
mail: jonas...@gmail.com
web: www.jonasbandi.net
blog: blog.jonasbandi.net
twitter: twitter.com/jbandi

Dale Ragan

unread,
May 29, 2010, 11:06:20 AM5/29/10
to SpecFlow
Thanks Jonas! Once I have the add-in done, I plan on documenting it
as well. I think the best place will be the wiki to start, but I am
sure I will add blog posts as well as I add new features.

-Dale

Dale Ragan

unread,
May 29, 2010, 7:53:18 PM5/29/10
to SpecFlow
Took some time this evening to look into why the
SuccessfulExecutionTest inside the Runtime tests
were failing. I saw where the NullReferenceException was being thrown
and fixed the problem. All Runtime tests are passing now. You can
read my commit message[1] to get the gist of what was happening. The
change I made will work in both environments.

Now that all the necessary projects are compiling and all tests are
passing, I am moving on to create the add-in. I will start on it
tomorrow and hopefully with any luck, have a alpha version ready on
Tuesday.

Cheers,

Dale

[1]: http://github.com/sinesignal/SpecFlow/commit/b887778857f7b08a678b1cb101d41faa74ca3fe4

Dale Ragan

unread,
May 30, 2010, 6:44:45 PM5/30/10
to SpecFlow
Just a clarification, I do have one test failing in FeatureTests. I
realized I didn't run them before. The test failing is the
ExternalStepDefinitionsFeature. There's nothing wrong with the test,
but with the IL generated for the step2 method inside VBStep.vb.
While invoking, an exception is thrown stating that the IL is
invalid. The step1 method runs fine. I translated the step2 method
to C# and placed it in the CSSteps.cs file and the test passes. I
will leave the test failing to remind me about the issue.

You can view the forum post on the issue here:
http://mono.1490590.n4.nabble.com/Using-reflection-to-invoke-a-method-written-in-VB-throws-an-exception-tp2236684p2236684.html

Dale Ragan

unread,
Jun 1, 2010, 12:14:29 AM6/1/10
to SpecFlow
Well, I've made good progress on the add-in despite this being a
holiday weekend for us here in the states. I just finished pushing up
a few commits to my fork with the initial workings. As it stands
right now, the add-in installs and displays the file templates for
Feature, Step Definition, and Event Definition when adding new files
to a project. I also have the skeleton done for the
SpecFlowSingleFileGenerator that runs when the Feature gets created
and on every save. I just have it creating a file right now, with a
comment in it. All I have left to do is hook up the calls into the
Generator to actually create the code, based on the Feature's file
content. I also have a few things left to do on the Step Definition
and Event Definition file templates. You can view the commit messages
for what's left on those, which isn't much. VB support is limited
right now also, due to the exception that I stated in a previous
message above. Hopefully I'll here something back tomorrow on that.

If all goes well tomorrow, I should have it all finished like I
projected and ready to use for the most part. I will then spend time
doing a write up on how to install it and what is required. Then walk
through the steps of using it.

Jonas Bandi

unread,
Jun 1, 2010, 3:26:33 AM6/1/10
to spec...@googlegroups.com
Cool!
I think the missing  VB support is definitely no issue here.
The crucial thing will be in my opinion, to have the whole thing documented for possible end users ...

Keep up the good work.
jonas

Dale Ragan

unread,
Jun 1, 2010, 10:57:48 PM6/1/10
to SpecFlow
I am pleased to announce support for MonoDevelop. I just finished
pushing up the commit to my fork[1]. Ran some small dry runs and
testing and everything is working fine. I will start on the
documentation tomorrow. Just wanted to pass on the good news. We
will probably need to discuss you pulling in the changes also.

[1]: http://github.com/sinesignal/SpecFlow

Gáspár Nagy

unread,
Jun 3, 2010, 9:30:31 AM6/3/10
to SpecFlow
Super!

Dale Ragan

unread,
Jun 4, 2010, 11:31:20 AM6/4/10
to SpecFlow
OK, here's a little update. I just about have the documentation
wrapped up on using SpecFlow with Mono and MonoDevelop. The
documentation states what versions of Mono and MonoDevelop are
supported and required to run SpecFlow and the Add-In. It then steps
you through adding the Add-In into MonoDevelop. Next, I do a walk
through on retrieving a package which will be just a zipped tar.gz
download of the latest release of SpecFlow. Users can use this
package for committing the binary's of SpecFlow into their source
control tree if they want. It is also so they can put the binary's
where they want for referencing in their projects. I will build this
package for you for each release and you can provide it on the
SpecFlow site. I feel it is best to keep a central location for
user's to grab what they need. There's no need for them to come to my
site for instance to get the files. There's also no need to have an
installer due to the way we can load add-ins in MonoDevelop. The rest
of the document walks you in using the Add-In and I follow it up with
how to use specflow.exe for generating feature code files and the
reports.

Over the last few days I have also been spending some time in making
sure that all the options in specflow.exe work. I first ran into an
issue with GenerateAll when calling
MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild. Inside that
method there is a call to Engine.GlobalEngine.GetLoadedProject. It
kept throwing a KeyNotFoundException for the project file that was
passed in. Well, this doesn't match the MSDN documentation on what is
suppose to happen. The method is suppose to return null if it can't
find an associated project object for the given project file. I
created a regression test and fixed the issue and submitted a patch to
the Mono Dev Team. After that, everything worked fine.

Next up was to run the StepDefinitionReport which has brought up a
couple of issues so far. The first issue stems from loading the
SpecDefinitionReport style sheet with the XslCompiledTransform class.
For some reason, during the execution of calling Load, after it gets
done parsing SpecDefinitionReport.xslt. I found where it is
lowercasing SpecFlow.TechTalk.Reporting which makes it not possible to
load the assembly. It needs to load the assembly so the Common.xslt
resource can be retrieved. Once I corrected the value in the
debugger, I was able to proceed. I then ran into an issue when
GetResourceStream on ResourceXmlReader is called with the passed in
resource name set to ..\Common\Common.xslt. It cannot retrieve the
stream. I believe it is due to the back slashes. This is where I
stopped. I will look into it further tonight and also get some fixes
in place so I can continue, hopefully this will be the last road block
for running the StepDefinitionReport.

Hopefully by the end of the weekend, I will be ready to send you a
pull request and then we can discuss the changes. Nothing I have done
so far should break when running under the .NET Framework. I have
kept this in mind when ever I have made a change in what I call the
shared projects to make it cross platform. I will discuss what those
are when we go over the changes. Second, what is the time frame for
the next release or is there one yet?

Dale Ragan

unread,
Jun 6, 2010, 6:02:40 PM6/6/10
to SpecFlow
Well, I got the StepDefiniton report working. I had to change some
code which will need to be tested on your end before merging after
pulling my changes. I then moved on to the NUnitExecutionReport. I
have everything running, but it doesn't pick up the tests that ran.
It just spits out the tables that should hold the results, but with no
data. I haven't looked at the XSLT yet, but I wonder if the XML
output from NUnit is different? What version of NUnit did you write
the XSLT against? Once I get this issue resolved, everything will be
ready to go.

Dale Ragan

unread,
Jun 6, 2010, 6:44:09 PM6/6/10
to SpecFlow
Also, what's the reasoning behind creating the extension method for
Transform and then using reflection to do the transformation instead
of calling one of the public overloaded Transform methods on
XslCompiledTransform? I went ahead and changed the code to call one
of the public Transform[1] methods. The mono runtime doesn't have a
feild called command, so I had to change it up. I'm sure there was a
reason and I was wondering what it was.


[1]: http://msdn.microsoft.com/en-us/library/ms163443.aspx.

Dale Ragan

unread,
Jun 8, 2010, 1:29:06 AM6/8/10
to SpecFlow
Whew, got the SpecFlow.exe tool working under Mono. I pushed up my
commit a little while ago to my fork. Like I stated before, I had to
make a few changes to the SpecFlow reporting code to get everything to
work under Mono. You may want to take a gander at the changes and my
previous messages, since I haven't heard back from anybody on my
questions. Don't worry about the question on what version of NUnit
that the XSLT was created against, though. It turned out that I was
using the wrong XML output by NUnit for the TestResult.xml input. I
was using the output by the NUnit Runner inside MonoDevelop instead of
the output from nunit-console. Don't ask me why I was doing this.

I am putting the finishing touches on the documentation now and
hopefully have a first draft of it checked in tomorrow. Just so you
know, we will need to wait on a couple of items from the Mono and
MonoDevelop dev teams before we release. As previously, stated I had
to submit a few bug reports and patches for Microsoft.BuildEngine.*
libraries to the Mono dev team to get this working. The SpecFlow.exe
tool was mainly affected by these issues. One of those patches is
already in a release, but the other one won't be in until the next
2.6.x release, which I think will be 2.6.5. I believe the 2.6.5
release will be out very soon though. Second, MonoDevelop didn't have
support until recently for running custom tools on files. Therefore,
the next release of MonoDevelop will be required. Right now the
current release of the next version is Beta 2, which will work, but
the final release should be any day now.

After I finish up the documentation, I will send you a pull request.
On a side note, we will need to discuss how you want to handle
receiving files from me for hosting on http://www.specflow.org. You
can ping me at dale.ragan AT sinesignal DOT com. At this point, I am
finished for this version of Mono and MonoDevelop support. I have
plans for the next version already, like syntax highlighting and
intellisense of Feature files for example.

Well, time to head off to bed.

Jonas Bandi

unread,
Jun 8, 2010, 1:50:50 AM6/8/10
to spec...@googlegroups.com
Great!
Thanks a lot for all the effort.
Give us some time after you send the pull request, probably we cannot
keep up with the high pace you have shown in the last days :-)
Keep us up to date on the documentation and on above Mono/MonoDevelop
releases, as we are not watching this currently.

Thanks again
jonas

--

Dale Ragan

unread,
Jun 8, 2010, 2:19:47 AM6/8/10
to SpecFlow
Here's a few screenshots for those who can't wait!
http://www.flickr.com/photos/sinesignal

I generated a majority of the screenshots the other day for
documentation. I will add some more after I get some sleep. These
were taken running Mono off of svn trunk and MonoDevelop 2.4 Beta 2 in
Ubuntu 10.04. I plan on doing some Mac testing later and I will post
screenshots of those results also.

Take your time on the pull request, like I stated, we need to wait on
the Mono and MonoDevelop teams at this point anyways. I will let you
know when they release and we can base the next release of SpecFlow on
a date shortly after.

Good Night!
Reply all
Reply to author
Forward
0 new messages