Fix browser command with non-default root path. #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make the browser command easier to use when run against a
juttle-engine/juttle-service with a root path other than /. Do this by
fetching the server's root directory and comparing that to the path
provided in the --path argument. If the root directory isn't a prefix
of the --path argument, throw an error. Otherwise, take just the part
not covered by the --root argument and use that as the ?path= cgi
param in the url.
In juttle-engine-client, also fully resolve the path immediately
instead of several times in the function for each command.
Also update juttle-engine to rely on juttle-service's built-in
defaults with juttle-config.js and command-line overrides. This
simplifies the initialization steps a bit.
These changes caused the test coverage numbers to dip slightly below
the thresholds, so provide some additional options when creating the
engine to cover one additional branch, which got the coverage numbers
up again.
This PR depends on changes in juttle-service (juttle/juttle-service#67). I can wait to merge this until we're ready to push a new juttle-service, or do an early juttle-service release (bumping the minor number), and update package.json for juttle-engine to depend on it.
@demmer @go-oleg @VladVega