Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FitNesseRunner lacks an option to override variables #1152

Closed
micw opened this issue Aug 31, 2018 · 2 comments
Closed

FitNesseRunner lacks an option to override variables #1152

micw opened this issue Aug 31, 2018 · 2 comments

Comments

@micw
Copy link

micw commented Aug 31, 2018

When running with fitnesse-standalone, it is possible to override variables by adding url params. Internally this is done by parsing the params and creating an UrlPathVariableSource from it. Later during variable resolution, UserVariable source checkis if the page variable source is of type UrlPathVariableSource, and if so, it is used with higher priority than the other variable sources. This is an implementation that is full of implicit assumptions - maybe this should be re-written some day.

When using FitNesseRunner, there's no option to override variables this way. The reason is that FitNesseRunner does not call context.getRootPage() with a map of values.
Since all those calls are in private methods, there's also no way to create a custom FitNesseRunner that calls the method with Map arguments.

I propose to
a) refactor FitNesseRunner to allow overriding this behaviour
b) define a proper way to set custom parameters (e.g. provide a class that does it by using a annotation)

micw pushed a commit to micw/fitnesse that referenced this issue Aug 31, 2018
micw pushed a commit to micw/fitnesse that referenced this issue Aug 31, 2018
provider for custom variables
@micw micw mentioned this issue Aug 31, 2018
@fhoeben
Copy link
Collaborator

fhoeben commented Nov 3, 2018

As a suggestion to 'workaround' this issue you could consider using my plugin (https://github.com/fhoeben/hsac-fitnesse-plugin, sample usage https://raw.githubusercontent.com/fhoeben/hsac-fitnesse-fixtures/master/wiki/FitNesseRoot/HsacExamples/SymbolSamples.wiki).

It defines a !defineDefault extension to the wiki language that allows you to define a variable that may be overridden by system properties. Alternatively it defines !defineDefaultFromProperties that allows the variables to be overridden using a .properties file.

I use this to override variables when running tests (with the jUnit FitNesseRunner) on build server.
This way the jUnit class also does not have to contain the values to use during the test run, but they can be specified externally. Specifically I use it to point my tests to the correct server.

@woodybrood
Copy link
Collaborator

The hsac-fitnesse-plugin option also should allow for -D vm arguments at the command line. I'm going to close this with a viable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants