Apropos writing tests in the code

Thomas Sødring thomas.sodring at hioa.no
Sun Feb 19 12:38:58 CET 2017


On 02/19/2017 12:19 PM, Petter Reinholdtsen wrote:
> [Alexander Alemayhu]
>> IIRC there already some tests but they did not seem to work last I
>> checked.
> Aha.  How can I run them to see how they fail?

Good question! A test framework was one of the last things I was working
on when I was developing the rough shell of the project. I hit a brick
wall with logging in to do the tests and just left the code as it is.
The second thing I didn't figure out was whether or not the tests had go
via HTTP or we just called the functions from test.

-Dmaven.test.skip=true is stopping the tests from being run, but when
you run without this it throws exceptions.

My understanding is now that you should not require login to run the
tests, and the tests do not run over HTTP. I'll try to get the basic
tests up and running again this week. This will also mean that we no
longer will require -Dmaven.test.skip=true on the command line.

>
>> This might be too crazy but maybe we could use JUnit with Docker.
>> Xavier has some nice examples[0]. I am not sure if his project[1] is
>> being maintained, but we can always try reaching out over email.
> I would prefer something more lightweight we could run with only a java
> engine available.  It would be easier to run from github, and also
> should be quick enough for everyone to run it before commiting.
The internal tests should cover this. I think this is something that can
be discussed. But the tests that Petter has created are tests that I
would run internally. Making sure the core is in adherence to the standard.
>
>> I guess this would encourage black box testing, but that would still be
>> better IMO than no active tests.
> My noark5-tester script is kind of a black box tester, and I suspect we
> are better of by making that kind of tests as a separate system.
>
Test code is found under
nikita-noark5-core/core-webapp/src/test/java/no/arkivlab/hioa/nikita/webapp/
. It's in place, we just need to switch it on, and make sure it works
properly. I'll take a look at it during the week and see what I can get
up and running.



 - Tom



More information about the nikita-noark mailing list