Skip to content
New issue

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

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

Already on GitHub? # to your account

options accessibility #2

Open
simoneb opened this issue Feb 11, 2013 · 1 comment
Open

options accessibility #2

simoneb opened this issue Feb 11, 2013 · 1 comment

Comments

@simoneb
Copy link

simoneb commented Feb 11, 2013

It would be nice to be able to access the options defined in a server definition inside, say, http get in order to construct the path of the request. Would allow some reuse of tests by parameterizing them with server options. Or maybe it's already possible but I couldn't figure out how. Example:

server "some server", :path => "/somepath"

http do
    get options[:path] do
@rlister
Copy link
Contributor

rlister commented Feb 11, 2013

Because of the way auger works, the cfg file code is evaluated at configuration time, and generates a configuration that is then run across multiple servers. So something like this won't work directly. The options passed to 'server' are specific options understood by the connection plugin (e.g. port, timeout, for http plugin).

What you want to do can be achieved using roles, e.g.:

project "Foo" do
  server "aaa", :somepath
  server "bbb", :otherpath

  [ :somepath, :otherpath ].each do |path|
    http do
      roles path
      get "/#{path}" do
        ...
      end
    end
  end
end

However, I'll have a think about a functional way to expose generic options.

carmi pushed a commit that referenced this issue Jun 12, 2014
Return non-zero exit code when results include anything but all-ticks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants