Fitnesse read only mode? - fitnesse

Is it possible to set fitnesse into a read-only mode?
For the software delivery lifecycle it makes sense to have 'edit' and 'test' modes but I was wondering if fitnesse can be made read only so that we can use it as our documentation site for anyone that wants to view and not edit.

Yes it's possible. That is what http://fitnesse.org is: a readonly FitNesse server.
One needs to override some 'Responders' in the plugins.properties file, so that all responders that cause updates or run tests are disabled as described in the documentation under 'Disabled Responders'. A list of all available Responders can be found here.
See https://github.com/fitnesse/fitnessedotorg/blob/master/plugins.properties for how fitnesse.org does it
Responders =addChild:fitnesse.responders.DisabledResponder,createDir:fitnesse.responders.DisabledResponder,delete:fitnesse.responders.DisabledResponder,deleteConfirmation:fitnesse.responders.DisabledResponder,deleteFile:fitnesse.responders.DisabledResponder,deletePage:fitnesse.responders.DisabledResponder,edit:fitnesse.responders.DisabledResponder,executeSearchProperties:fitnesse.responders.DisabledResponder,executeSearchProperties:fitnesse.responders.DisabledResponder,files:fitnesse.responders.DisabledResponder,fitClient:fitnesse.responders.DisabledResponder,import:fitnesse.responders.DisabledResponder,movePage:fitnesse.responders.DisabledResponder,names:fitnesse.responders.DisabledResponder,new:fitnesse.responders.DisabledResponder,packet:fitnesse.responders.DisabledResponder,pageData:fitnesse.responders.DisabledResponder,properties:fitnesse.responders.DisabledResponder,proxy:fitnesse.responders.DisabledResponder,refactor:fitnesse.responders.DisabledResponder,releaseDownload:com.objectmentor.fitnesse.releases.DownloadResponder,renameConfirmation:fitnesse.responders.DisabledResponder,renameFile:fitnesse.responders.DisabledResponder,renamePage:fitnesse.responders.DisabledResponder,replace:fitnesse.responders.DisabledResponder,rollback:fitnesse.responders.DisabledResponder,saveData:fitnesse.responders.DisabledResponder,saveProperties:fitnesse.responders.DisabledResponder,search:fitnesse.responders.DisabledResponder,shutdown:fitnesse.responders.DisabledResponder,socketCatcher:fitnesse.responders.DisabledResponder,suite:fitnesse.responders.DisabledResponder,symlink:fitnesse.responders.DisabledResponder,test:fitnesse.responders.DisabledResponder,upload:fitnesse.responders.DisabledResponder,whereUsed:fitnesse.responders.DisabledResponder,partition:fitnesse.responders.DisabledResponder
But my recommendation would be to publish the html results of tests as documentation (for a given release). These can provide some additional insight by showing actual results and not just expectations.

Related

Fitnesse: is it possible to disable Test and Suite buttons?

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 {
}

Where can I find the default templates for all the Grails fields plugin types?

I was hopping to have an easy way to customize the display behavior of the Grails fields plugin after reading its docs, but I just realized that it demands an enormous effort as there is no available templates to start from.
I can see the display functionality is hard-coded in FormFieldsTagLib (from methods like renderDefaultInput() ) but I think it is imperative to have the templates themselves (or a way to generate them, somewhat like generating static scaffolding in Grails).
I can see no consistent (and reasonable) way to customize display behaviors for the Grails fields plugin without that. Am I missing something?
Imagine the use case where someone wants to change the boolean default rendering just to display the field label after (and not before) the checkbox, and keep it available to all the boolean fields within its application. Which concerns will he need to handle regarding if the field is required, has errors, prefix and so on? When all he needed was just moving two divs around.
Grails version: 2.5.4, fields-plugin version: 1.5.1
You aren't missing something. You'd have to re-create the existing implementation of each field type rendering in a template for use with the plugin. There isn't a way to generate a file to start with (like scaffolding).
I won't bore you with the historical reason as to why this is the case, but if you do create a set of base templates it would be a good idea to contribute back to the plugin.
I had an issue with the <f:table> tag, and found this post, which led me to find the base or default template inside the plugin repo.
Take a look at
https://github.com/grails3-plugins/fields/tree/master/grails-app/views
That may help you finding some default templates, along with the official doc and this answer on where to put the override.
Hope it helps you.

New Relic: JS error monitoring

I am trying to enable the Browser monitoring provided by New Relic in my Rails app. I followed the steps listed in the docs - which is basically turning on the feature within the New Relic settings for the app. But not all errors are being logged within the JS Errors tab. My questions is do I need to do some changes within Rails app to include new relic agent on the page? I currently have browser_monitoring.auto_instrument: false in my newrelic.yml because I use the manual way of doing this for some specific pages. Is this property also responsible for doing the error monitoring?
Thanks!
Yes, the auto instrumentation is what injects NewRelic's JavaScript into your page to analyze performance and report errors. The default is true. If you've turned it off, you'll only catch errors from pages where you're manually including it.
If you turn it back on, you can disable it on certain pages where you're doing things manually using newrelic_ignore.

Rails how to automatic check if a link is broken?

How is it possible to automatic check if a link is broken?
What is the best solution (Screenscraping or other)
You could try selenium which is an automated testing framework.
You could also try monit which is a monitoring application (daemon). Sometimes I just use that service to check if a particular website or link is up. You can set it to check periodically.

Modifying Grails apps post deployment

I'm investigating Grails vs. other Agile web frameworks, and one key use case I'm trying to support is the ability to modify controllers and install plugins post deployment. It appears that this isn't possible with Grails, but I want to make sure before I write it off.
As far as modifying controllers goes, it would be sufficient if the Groovlet behavior existed (compile-on-demand).
As far as plugin installs go, I understand this may be a long shot, but I thought I'd check to be sure.
For your information, I need this because I work on a product that requires a little site-specific customization, such as adding validation of simple meta-data, integrating with customer security environments, and maybe even including new controllers/pages quickly.
Out of the box, no, grails doesn't really support what you want. There may be ways to customize it but I've never looked into it. A PHP framework might be more of your ally since there is no real deployment process other than copying PHP files to a location.
That said, I personally would prefer a strict set of deployment policies. And honestly, deploying changes with Grails is as simple as running the 'grails war' command and copying that war to your servlet container. The site's downtime is negligible and if you have multiple web servers with a load-balancer, your customers should never see down time due to deployments.
Although it's not recommended for complex coding; You could execute groovy code from a string that you could store in database or a file on the fly at run time:
check out Groovy template engine:
http://groovy.codehaus.org/Groovy+Templates
but even then, you are still limited on what you can do or can't do let alone debugging will lack. you may want to consider an interpreted language; few to mention PHP/Perl/Coldfusion.

Resources