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

Develop #3

Merged
merged 17 commits into from
Aug 13, 2017
Merged

Develop #3

merged 17 commits into from
Aug 13, 2017

Conversation

ViaoV
Copy link
Contributor

@ViaoV ViaoV commented Aug 13, 2017

  • Fake data expansion
  • hammer command
  • refactored explorer commands
  • refactored scripting objects

ViaoV added 16 commits August 13, 2017 01:21
Empty configuration files would cause a config error. It now will
quietly load the default configuration.

Fixed an issue with lower case method names

Request methods are now converted to uppercase from the endpoint
configuration.

End to end testing for request module

The request module now has tests end to end. This packages tests act as
a kind of integration test.
Changes the objects exposed to scripts.

$payload has been removed. It's functionality is now in
$response.body and $request.setBody().

$headers has been removed. It's functionality is now in
$request.headers.get(), $request.headers.set(), $response.headers.get()
Explorer commands now match the script commands

Auto display request data on request

Request data and payload are now automatically displayed when the request
is ran.

Corrected several issues with the JSON highlighting.
Added fake data expansion to URLs, query params, and request data.
Fake data can be inserted by using a '#{key}' template variable in any
field value.
The hammer command will execute an endpoint request multiple times and
report back overall details about the requests.
* Added TravisCI integration

* Added README

* Variable Expansion in Endpoint Configurations

Config objects themselves support performing expanding strings
containing variables.

This was implemented in the endpoint configuration. Variables can now be
used in request data, query params, headers, request method, and in the
URL. If the variable exists in either configuration it will be expanded
to its value.
Empty configuration files would cause a config error. It now will
quietly load the default configuration.

Fixed an issue with lower case method names

Request methods are now converted to uppercase from the endpoint
configuration.

End to end testing for request module

The request module now has tests end to end. This packages tests act as
a kind of integration test.
* Added TravisCI integration

* Added README

* Variable Expansion in Endpoint Configurations

Config objects themselves support performing expanding strings
containing variables.

This was implemented in the endpoint configuration. Variables can now be
used in request data, query params, headers, request method, and in the
URL. If the variable exists in either configuration it will be expanded
to its value.
Empty configuration files would cause a config error. It now will
quietly load the default configuration.

Fixed an issue with lower case method names

Request methods are now converted to uppercase from the endpoint
configuration.

End to end testing for request module

The request module now has tests end to end. This packages tests act as
a kind of integration test.
* Added TravisCI integration

* Added README

* Variable Expansion in Endpoint Configurations

Config objects themselves support performing expanding strings
containing variables.

This was implemented in the endpoint configuration. Variables can now be
used in request data, query params, headers, request method, and in the
URL. If the variable exists in either configuration it will be expanded
to its value.
Empty configuration files would cause a config error. It now will
quietly load the default configuration.

Fixed an issue with lower case method names

Request methods are now converted to uppercase from the endpoint
configuration.

End to end testing for request module

The request module now has tests end to end. This packages tests act as
a kind of integration test.
* Added TravisCI integration

* Added README

* Variable Expansion in Endpoint Configurations

Config objects themselves support performing expanding strings
containing variables.

This was implemented in the endpoint configuration. Variables can now be
used in request data, query params, headers, request method, and in the
URL. If the variable exists in either configuration it will be expanded
to its value.
)

type (
Response struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type Response should have comment or be unexported

err := scriptEngine.ExecuteFile(scriptPath)
if err != nil {
return res, err
return res, errors.New(fmt.Sprintf("Error parsing script (%s): %s",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)

)

func Do(config *endpoint.EndpointConfig) (*Response, error) {
func Do(epConfig *endpoint.EndpointConfig) (*Response, error) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function Do should have comment or be unexported

return otto.Value{}
}

// getResHeader - Returns a header from the response.
func (engine *ScriptEngine) getResHeader(call otto.FunctionCall) otto.Value {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

receiver name engine should be consistent with previous receiver name eng for ScriptEngine

// setHeader - sets a header on the request.
func (engine *ScriptEngine) setHeader(call otto.FunctionCall) otto.Value {
// setReqHeader - sets a header on the request.
func (engine *ScriptEngine) setReqHeader(call otto.FunctionCall) otto.Value {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

receiver name engine should be consistent with previous receiver name eng for ScriptEngine

}
}

func (bar *ProgressBar) Stop() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method ProgressBar.Stop should have comment or be unexported

}
}

func (bar *ProgressBar) Inc() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method ProgressBar.Inc should have comment or be unexported

startTime time.Time
}

func NewProgress(max int) *ProgressBar {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function NewProgress should have comment or be unexported

"time"
)

type ProgressBar struct {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type ProgressBar should have comment or be unexported

}
)

func New() *EndpointConfig {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function New should have comment or be unexported

}

//Execute - Executes a Javascript.
func (eng *ScriptEngine) Execute(script string) error {
func (engine *ScriptEngine) Execute(script string) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

receiver name engine should be consistent with previous receiver name eng for ScriptEngine

@ViaoV ViaoV merged commit f36d73d into master Aug 13, 2017
ViaoV added a commit that referenced this pull request Aug 13, 2017
This reverts commit f36d73d.
@ViaoV ViaoV mentioned this pull request Aug 13, 2017
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

Successfully merging this pull request may close these issues.

2 participants