I have an interesting problem. I am using Ant which executes JUnit tests (test suite composed with 50 tests) via build.xml element. The problem is that I receive OutOfMemoryError.
I have enlarged heap space using ANT_OPTS arguments but it did not help. When I execute the same test suite in Eclipse - everything is fine - memory is released thanks to GC.
I think that this problem is related to Ant and its JUnit task.
Maybe logging of the tests are the reason(but on the other hand I have printsummary="false", [maybe outputtoformatters should be set to false as well???]).
My second guess is that TEST***.xml file (generated at the end of the test) is held in memory and flushed at the end of the test. Is there any way to reduce logs which are in that file?
Guys, please give me some clues.
You need to set the maxmemory attribute in the junit task. See the Ant documentation.
to sum up I want to say that the root of the problems was logging. Logs were sent to the stream and not flushed. After switching the logs off - everything was fine.
By default the fork mode is off. Please try with fork mode on and forkmode set to pertest.
Related
I am running Fitnesse on several dispathers and then copy Fitnesse history and logs from all dispatchers to a separate machine. Some other project members need access to test results on this machine but I don't want them to be able to click Test or Suite there. Is it somehow possible to disable Test and Suite buttons?
I would be glad for any options: either somehow configure it in Fitnesse, or get a patched fitnesse.jar, or any other options.
On the main Fitnesse site (http://fitnesse.org/StayInformed), there is the following note: "Note, the Test and Suite buttons on this site have been disabled because search engines tend to invoke them and put my server under stress. This site is actually created with FitNesse.". So I need something like that, if possible.
Is it possible? Not sure I can find a corresponding place in source code to patch and re-build it. My hope is whether someone already did it or find it easy to help. I raised an issue in GitHub where Fitnesse source code is located but I didn't get any feedback yet.
Thank you!
It is indeed possible, that is indeed what is done for fitnesse.org.
I'm not 100% sure how its done but I suspect it is done by disabling 'responders', see http://fitnesse.org/FitNesse.UserGuide.AdministeringFitNesse.ConfigurationFile.
In that page a description is given to disable creating new pages:
Responders=addChild:fitnesse.responders.DisabledResponder,new:org.fitnesse.responders.DisabledResponder
You can probably also use this to disable SuiteResponder and TestResponder, by using:
Responders=suite:fitnesse.responders.DisabledResponder,test:org.fitnesse.responders.DisabledResponder
The full list of responders is in fitnesse.responders.ResponderFactory
On a side note: why do need a full FitNesse installation to show test results? I recommend you look into generating tests results in html format, and just publish that html somewhere. I usually use the jUnit runner to run the tests on a build server (it also creates html output) and then publish the html files generated as build artefact which people can open/view.
Sample, from FitNesse project, generating html in build/fitnesse-results:
import org.junit.runner.RunWith;
#RunWith(FitNesseRunner.class)
#FitNesseRunner.Suite("FitNesse.SuiteAcceptanceTests.SuiteSlimTests.TestScriptTable")
#FitNesseRunner.FitnesseDir(".")
#FitNesseRunner.OutputDir("./build/fitnesse-results")
public class FitNesseRunnerTest {
}
I have a number of geb functional tests for a grails application.
The tests are working as expected when executed from terminal or IDE.
Although the tests need to be executed by hudson, so they are run in headless mode using Xvfb.
The problem is that the tests keep failing, or behaving unexpectedly, returning errors like RequiredPageContentNotPresent and Stale Element Reference Exception in places that doesn't make sense.
For example:
(at LicencePage is verified above, and page isn't changed)
when:
addDocument(Data.Test_Doc_name,Data.Test_Doc_file)
sometimes throws
Failure: Add Actual Licence (HomePageSpec)
| geb.error.RequiredPageContentNotPresent: The required page content 'addDocument - SimplePageContent (owner: LicencePage, args: [Functional Test Doc, /var/lib/hudson/jobs/KB-Functional_Tests/workspace/app/../manual_test_data/so_v3/os_test_1], value: null)' is not present
at geb.content.TemplateDerivedPageContent.require(TemplateDerivedPageContent.groovy:61)
at geb.content.PageContentTemplate.create_closure1(PageContentTemplate.groovy:63)
at geb.content.PageContentTemplate.create(PageContentTemplate.groovy:82)
at geb.content.PageContentTemplate.get(PageContentTemplate.groovy:54)
at geb.content.NavigableSupport.getContent(NavigableSupport.groovy:45)
at geb.content.NavigableSupport.methodMissing(NavigableSupport.groovy:121)
at geb.Browser.methodMissing(Browser.groovy:194)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at HomePageSpec.Add Actual Licence (HomePageSpec.groovy:228)
The method addDocument() is defined on an 'abstract' page, which LicencePage is extending. In most cases like this, if I copy the method code directly into my Spec, it is going to work, although its ruining all the structure I have on my test pages.
Anyone has experience running geb tests with Xvfb? Have you faced these issues?
All tests are passing when executed locally, and this not a data issue as the DB is always cleared
Also, without making any changes, the tests are behaving non-deterministic (on hudson) so the above exception is not always thrown. Without any changes at all, tests are sometimes successful and sometimes fail.
The description you gave seems to be the symptom of a flackey test-suite. we were facing this problem as well some time ago. A good starting point for this is this presentation (around min. 35) and the documentation about the wait stuff in geb.
If you think, it could have something to do with xvfb (where i have no experiences with), you could try to use phantomjs as the test-runner and check if it works correctly.
I'm using grails 1.3.7.I installed code-coverage plugin.And placed the cobertura 1.9.4.jar and asm2.2.3.jar in project lib folder in STS workspace.Running using grails test-app -coverage command.When i'm doing this it runs the whole Junit test casses as well it generate the report in Cobertura folder in target.But in generated HTML code it showing Zero classes and all others are zero.
In console at last it displays 0 classes loading and 0 classes saving like this after running the test casses.
As well I tried in BuildConfig.groovy to add,
coverage { sourceInclusions = ['grails-app/target*'] }
It's not resolving the path
So how can i solve this problem to get correct cobertura report..??
While i'm running using the above mentioned command will the code-coverage (cobertura) automatically instrument the classes or mannually we have to say..??
I go through the cobertura instrumentation ref via comment lines document..in that they used cobertura-instrumented.bat --destination ... if use these comments cobertura-instrumented.bat is not internal or external command like this error is comming..
How to correct this and make this plugin work correct to get correct result rather than 0%..??
Thanks..
Make sure your app is not running at the same time you are running the test suite. Cobertura needs to instrument your compiled code and if the app is running it can interfere with that.
Code-Coverage correctly shows the output after i changed the lib jars as asm2.2.1 to asm3.1 as well asm-util.jar and oro.jar was added on it.
I have a test in fitnesse which used to work, but when I got into work today the test did not start at all. As soon as I press test I get the "0 errors 0 warrings..." text on the top of the test. Looking in the source control software, I can not find any changes to the test, or to anything related to it. I have noticed that the runner process does not start when I run the test. Other tests seem to work fine, and I can copy the tables from the test which is not working into an other test and everything is fine. Any ideas on what could be wrong?
My standard answer in this situation is, "have you checked your classpath?"
I say this, as typically when this sort of thing happens, it is that the !path doesn't point to the stuff you need, whether it be FitNesse.jar or your own custom code.
Also, do you get an output page where you can check the classpath? i doubt it, but that can help diagnose classpath issues.
I am trying to figure out how to spawn a process / start an EXE from Rhozet Carbon Coder.
The manual mentions a task that sounds promising, "ExternalProcess", in section 5.8.2 but does not document this task.
Has anybody had success doing this, or knows where the ExternalProcess task is documented?
I have heard back from Rhozet that the ExternalProcess command mentioned tangentially in the manual is a typo, there isn't any task by that name.
Currently the only way to launch a process is to use the Notify task.
For example the folowing xml put in the Sources section of a configuration file launches notepad before running the job.
<Notify>
<PreTaskNotify>
<ProcessNotify_0 NotifyCommand="notepad.exe" />
</PostTaskNotify>
</Notify>