NUnit 2.2.8 with NAnt 0.85 rc4

I recently attributed some blame to NUnit 2.2.8 for not maintaining backwards compatibility with the test case names. It turns out that it is half the problem with the new software releases of the open source agile tools.
If you’re executing tests with NAnt 0.85Rc4 and using the task, you’re going to skip a whole bunch of tests, unintentionally.
Using , only 44 of +1800 test cases get recognized! :0
Using exec and the nunit-console, i get all my test cases recognized [but that’s including the fix i made to nunit 2.2.8].

out with the old:

<target name="executeTest" verbose="true" failonerror="true" >
<nunit2 failonerror="false" verbose="true" >
<formatter type="Xml" usefile="true" outputdir=".\TestResults" extension=".xml" />
<test assemblyname="${test.assemblyPath}"
appconfig="${test.assemblyPath}.config" />
</nunit2>
<property name="testdllname" value="${test.assemblyName}"/>
</target>

in with the new:

<target name="executeTestEx" verbose="true" failonerror="false">
<exec program="${NUnit}\nunit-console.exe" failonerror="false">
<arg value="${test.assemblyPath}" />
<arg value="/xml=.\TestResults\${test.assemblyName}.xml" />
<arg value="/config='${test.assemblyPath}.config'" />
</exec>
</target>

.NET Migration v1.1 – v2.0

So the code migration was fairly straightforward. There’s enough documentation and learned lessons available to get you through that relatively pain-free. Also, striving to keep the code base as straightforward as possible helps tremendously. The deploy was not *as* obvious.

Dev boxes and staging environments deployed without fuss, but as it will be, the LIVE production box will always have something different about it 🙂

If you’re suddenly getting “404 Not Found” errors, check that v2 has actually been allowed to run. Verify with the “Web Service Extensions” section in managing IIS6.

These two urls were particularly useful:
“HTTP Error 404 – File or Directory not found” error message when you request dynamic content with IIS 6.0
IIS 6.0: ASP.NET Is Not Automatically Installed on Windows Server 2003

as part of a response to the question:
ASP.NET doesn’t work Error Code 404 2 1260

hopefully this saves you 30minutes somewhere 🙂

Open Source Advantages

There are just some things that *must* be open source. I usually find it’s the automated utility type software. Compilers, browsers, email clients, communication tools: they must just work and if they don’t. Uninstall, install something else. 🙂

But when it comes to software that automates tasks, and in my environment that includes mostly Nant, you can NOT have a black box. And no surprise, there really isn’t a black box alternative worth paying for. NUnit is my another automation machine.

These automation frameworks can be used in so many different ways that to NOT have the source code is just limiting yourself to all sorts of possibilities, the least of which is:
i..quick bug fixes not in main branch
ii.added functionality due to “custom” requirements [circumstances]

Like today for example. is NUnit 2.2.8 backwards compatible with test case method names [first four letters == ‘test’]? Documentation says yes, but i beg to differ…


modified Oct 05: as of 2.2.1 this compatibility was dropped but the documentation remains outdated.. now where has this debate surfaced before 🙂

Now to have your entire migration process bottlenecked by something silly like that… 🙂

The Programmer

In trying to describe what a programmer does, it’s easy to get sidetracked into discussions about compilers, delivery methodologies, design principles and frameworks. And then we try define the attributes of a “good” programmer when we’re really trying to define a “valuable programmer” [or team]. And even then, we can get sidelined into discussions about how a valuable programmer communicates, approaches design, deals with team conflict, translates and can abstract appropriately.

and that’s all good. But there is a less spoken of attribute which is very valuable:
is the programmer a servant?

As a programmer, i believe my existence is [should be] one of servanthood. All my decisions regarding design, implementation, methodologies, conflict- should be underpinned by an attitude of “to serve”.
I have heard programmers [myself included] negate a user request because:
“…the system is not designed to do it that way…”
“…it’s too difficult to implement…”
“…it’s too much effort…”
“…it’ll break the class design…”
“…too much refactoring…”
i do conceded that these may be valid reasons in the right context. As i’ve paraphrased them here, imagine these responses to be expressed void of any attitude to serve.

So… rather, if the class design won’t handle it, change the design.
If it’s a mission… make a plan.
Bottom line, a programmer exists to serve the needs of the user [ note: i say “user” and not necc the whims of the product manager/owner- that’s a different discussion alltogether 🙂 ]

And if you approach your choice of compiler, methodology, framework, team members, or principles; how to deal with conflict resolution, translation, communication… all of the above with attitude to serve, and serve your user well… the rest is mostly detail …

Lord and Saviour

Kinda like a tale of the vicious cycle of debt…

You owe the bank a lot of money and decide to pay it off. But it’s hard going and you could spend a long time trying to pay off that debt. Let’s assume that day eventually does arrive and you square up your account… what then? From that moment on you have the opportunity to live your life starting with zero debt and every decision from then on is a conscious one to either engage in debt, or not. If you choose to not engage in any more debt, you have to think differently. You cannot expect the same style of thinking that got you into debt in the first place to now suddenly keep you out of debt. Remember, before you even started round one, you already had no debt [and sometimes you might even protest, had no choice]. No matter how you try and decide to look at it or convince otherwise, your debt is still your debt.

God makes it easy for us to square the account. In fact, He already paid the debt for our sin. Our sin is against God Himself. But He says No-More-Debt. He paid the price [because someone had to do it] and He shows us, at length and in detail, just how He did it. He explains the What, Why, How, and Who. We need to accept that and when we receive His grace, we start life with a clean slate. Jesus, The Saviour.

Now we’re walking a “Christian” walk- but it’s not just about how we pray, who we pray to, what church we attend [or not], wether we have long hair and tattoos or wear a hat on Sundays. Those are not the primary issues. What is primary is: Is Jesus Lord of your life? Are you obeying what He says? Because you need a new way of approaching life now. You cannot reasonably expect that the mind that sold you into sin is going to now keep you out of it. Listen to someone who knows how to live a debt-free life: listen to Jesus. And Jesus is the Word Of God [John1]

To those in Christ, keep fighting the good fight. the connection between the promises God has for us and our obedience to Him have always been interlinked. We cannot expect to walk in Christ if we do not obey Him. To those who have yet to know Christ… set yourself free. Accept Jesus is Saviour and embark on living your life “new” with a just, loving and mighty Lord!

(Joh 3:36) He that believeth on the Son hath eternal life; but he that obeyeth not the Son shall not see life, but the wrath of God abideth on him.

(Act 5:32) And we are witnesses of these things; and so is the Holy Spirit, whom God hath given to them that obey him.

(Rom 6:16) Know ye not, that to whom ye present yourselves as servants unto obedience, his servants ye are whom ye obey; whether of sin unto death, or of obedience unto righteousness?
(Rom 6:17) But thanks be to God, that, whereas ye were servants of sin, ye became obedient from the heart to that form of teaching whereunto ye were delivered;

(2Co 10:5) casting down imaginations, and every high thing that is exalted against the knowledge of God, and bringing every thought into captivity to the obedience of Christ;

(Heb 5:8) though he was a Son, yet learned obedience by the things which he suffered;
(Heb 5:9) and having been made perfect, he became unto all them that obey him the author of eternal salvation;

(1Jo 5:2) Hereby we know that we love the children of God, when we love God and do his commandments.
(1Jo 5:3) For this is the love of God, that we keep his commandments: and his commandments are not grievous.

(Mat 19:17) And he said unto him, Why askest thou me concerning that which is good? One there is who is good: but if thou wouldest enter into life, keep the commandments.
(Luk 11:28) But he said, Yea rather, blessed are they that hear the word of God, and keep it.
(Joh 8:51) Verily, verily, I say unto you, If a man keep my word, he shall never see death.
(Joh 14:15) If ye love me, ye will keep my commandments.
(Joh 14:23) Jesus answered and said unto him, If a man love me, he will keep my word: and my Father will love him, and we will come unto him, and make our abode with him.
(Joh 14:24) He that loveth me not keepeth not my words: and the word which ye hear is not mine, but the Father’s who sent me.
(Joh 15:10) If ye keep my commandments, ye shall abide in my love; even as I have kept my Father’s commandments, and abide in his love.
(1Jo 2:3) And hereby we know that we know him, if we keep his commandments.
(1Jo 2:4) He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him;

(1Jo 3:22) and whatsoever we ask we receive of him, because we keep his commandments and do the things that are pleasing in his sight.
(1Jo 3:23) And this is his commandment, that we should believe in the name of his Son Jesus Christ, and love one another, even as he gave us commandment.
(1Jo 3:24) And he that keepeth his commandments abideth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he gave us.

(Mat 7:21) Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father who is in heaven.
(Mat 7:22) Many will say to me in that day, Lord, Lord, did we not prophesy by thy name, and by thy name cast out demons, and by thy name do many mighty works?
(Mat 7:23) And then will I profess unto them, I never knew you: depart from me, ye that work iniquity.
(Mat 7:24) Every one therefore that heareth these words of mine, and doeth them, shall be likened unto a wise man, who built his house upon the rock:

Google vs Microsoft

A bit iffy really that two huge companies war with each other in the way they do… {sigh}
But then again, on the other side of the {sigh} is a…
cool. it’s what makes companies healthy, string.. heck.. everything gets stronger with a little bit of sparring.

But the “war” reached my doorstep with Google’s recent toolbar update. I clicked the OK informational informing it was updated.. and then…

Ad-Watch recorded +4300 events within seconds! Dang! I thought i was under attack until i read the notification [they were all the same]:

Registry modification detected
Root: HKEY_CURRENT_USER
Key: Software\Microsoft\Internet Explorer\Main
Value: Search Page
Data: http://www.msn.com/access/allinone.asp
New Data: http://www.google.com

IE and Google battling it out to be the default search on my lone little machine.. :D… i had to engage in fairly lo-level advanced user diagnostics to stop my registry from being assualted and my machine slowing down- between IE, Google Toolbar and Ad-Watch, the discussions were getting pretty heavy.

Hey, Google.. How about letting the user decide who wins instead of trying to force your way in? It’s like you think you own my PC just because i chose to use your software? {gggrrrr}

Irritated is all.

FtpWebRequest Part II

.. following on from the first one, the project has now been updated to include some work with the new BackgroundWorker component available in Net 2.0… 😀

Creating responsive UI’s on lengthy processes has never been so easy!

including source code

FtpWebRequest

After looking for a trim Ftp client library for .Net 1.1, .Net 2.0 releases with FtpWebRequest. I completely missed this one in the search to find *something*.

After hacking around with it for a very short while, it proved to be by far the easist “library” to integrate with… the fruits of that freely available here .

There’s not much to the code itself as most of it is just a straightforward copy-paste out of MSDN but it ends up being the very light file dumper i was looking for.

Myth Busting

Atheists.org are a fascinating bunch.
For a start, an atheist is supposed to beleive that there is no God; have no theistic beliefs; disbelieve the existence of deities; the idea of god to them is senseless; yet is an as active religious system as most others? more definitions here

So despite the fact they don’t believe there to be God, they go one step further out of their way to propogate what they call “myths” about Christianity. Now, it’s one thing not have a belief in God, but a completely different story if you’re going out of your way to try and prove that He doesn’t exist.

Why do you need to prove that He doesn’t exist if you already believe that He doesn’t?

My guess is because the evidence is so overwhelming that He does exist that if you want to hold to the belief that He doesn’t, with any form of reasonable grip and integrity, you need to counterweigh the evidence. And the weighing, in most cases, is based on quantity rather than quality of argument.

For example, one of their arguments for one of the many alleged myths around Christianity go something like…
<argument>
Jesus said..
If I alone bear witness about myself, my testimony is not deemed true- John 5:31

And then later says…

I am the one who bears witness about myself.. – John 8:18

So therefore he’s a false witness.
</argument>

It’s funny how we will sometimes scrutinize fragments of the scripture to try and make a point. In cases like this, it seems the search for “truth” already began with a foregone conclusion and then evidence was gathered in support. Honestly, if we were to be real here, we would set out to find the evidence first and then come to a conclusion….

1. In John 8:18, the FULL quote is actually…
I am the one who bears witness about myself, and the Father who sent me bears witness about me.
And just before that He says [v14]
Even if I do bear witness about myself, my testimony is true, for I know where I came from and where I am going, but you do not know where I come from or where I am going

2. John 5:13 leads into the next verse…
There is another who bears witness about me, and I know that the testimony that he bears about me is true.
And then He continues and talks about John bearing witness too.

Both, fully quoted in context, make very powerful and merciful claims.. but i guess there are none so deaf as those who do not want to hear.

Owning Your Continous Integration

The ideas here is to “own” your continous integration process and make it work for you. Afterall, you spent some time setting up CruiseControl.Net and it’s ticking along nicely. At some stage, you need to make it “yours” and let it reflect your needs in terms of your process and record build data that you use [need] to make decisions.

<soapbox>
In fact, i’d encourage you to really push into making it your own. Not just the look ‘n feel- but the real nitty gritty. Define and extend and experiment with your continuous integration process to make it add value…
</soapbox>

the Scenario
Our automated build process runs a series of tests against a database. Before we start the tests, we need to record some information about the database; this being gathered by means of a stored procedure. We also need to persist the results as part of the build so we can monitor trends.

the Tools
* Nant build script
* Nant custom user task
* stored procedure
* xslt template
* cc.net config files

The Nant build script is included as part of the build process kickstarted by the bootstrap.build configured in cc. For more information on setting up cc.net, review the documentation that comes as part of the distribution. The ccnet.config file should include a nant <node> under tasks, similar to this…


<nant>
<executable>C:\nant-0.85\bin\nant.exe</executable>
<buildArgs>-D:debug=false</buildArgs>
<buildFile>bootstrap.build</buildFile>
<targetList>
<target>go</target>
</targetList>
</nant>

The Nant build script then calls a Nant custom user task which has the responsibility of executing the stored procedure and formatting the results into an xml file. To execute the custom task, somewhere along your build path, you will include something like…


<project name="ccnetLaunch" default="go">
<target name="go">
<loadtasks assembly="${nant::get-base-directory()}/mytask.dll" />
<myTask ConnectionString="MY_CONNECTION_STRING" SqlStatement="sp_myTask"
LogFile="myTask.xml" />
</target>
</project>

<loadtasks/> helps define <myTask/> which is built into an assembly and in this case, placed into the nant/bin directory. The nant custom user task is straightforward and the nant distribution includes a basic template sample which you can follow easily enough. another sample here

The xml output file itself is then merged into the cc build report. Again, your ccnet.config file handles this easily with…

<publishers>
<merge>
<files>
<file>myTask.xml</file>
</files>
</merge>
<xmllogger />
</publishers>

Finally, you need to add the xslt which transforms the xml output into the cc.net dashboard. Add the xslt file to the webdashboard xslt folder and append to the dashboard.config file, something similar to this…


<xslReportBuildPlugin description="My Results" actionName="MyDataReport" xslFileName="xsl\mytask.xsl" />

Now each build successfully calls your custom user task, saves the result of the stored procedure to an xml file which is merged into the build output and accessible from the dashboard for as long as you got build logs 🙂

Following this concept should give you an idea of how to start owning your process and not just going with the stock standard install. Set it up, take some risks and call it your own.