Skip to content

Commit

Permalink
fix: typos (#593)
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <[email protected]>
  • Loading branch information
fsamin authored Oct 19, 2022
1 parent 6259c5d commit 0910e2e
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 61 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Venom is a CLI (Command Line Interface) that aim to create, manage and run your
<a href="https://github.com/ovh/venom/releases/latest"><img alt="GitHub release" src="https://img.shields.io/github/v/release/ovh/venom.svg?logo=github&style=flat-square"></a>
[![GoDoc](https://godoc.org/github.com/ovh/venom?status.svg)](https://godoc.org/github.com/ovh/venom)
[![Go Report Card](https://goreportcard.com/badge/github.com/ovh/venom)](https://goreportcard.com/report/github.com/ovh/venom)
[![Dicussions](https://img.shields.io/badge/Discussions-OVHcloud-brightgreen)](https://github.com/ovh/venom/discussions)
[![Discussions](https://img.shields.io/badge/Discussions-OVHcloud-brightgreen)](https://github.com/ovh/venom/discussions)
<a href="https://gitpod.io/#https://github.com/ovh/venom"><img src="https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod" alt="Contribute with Gitpod"/></a>

# Table of content
Expand Down Expand Up @@ -162,7 +162,7 @@ Flags:
--output-dir string Output Directory: create tests results file inside this directory
--stop-on-failure Stop running Test Suite on first Test Case failure
--var stringArray --var cds='cds -f config.json' --var cds2='cds -f config.json'
--var-from-file strings --var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionnary
--var-from-file strings --var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionary
-v, --verbose count verbose. -vv to very verbose and -vvv to very verbose with CPU Profiling
```

Expand Down Expand Up @@ -237,7 +237,7 @@ Flags:
--output-dir string Output Directory: create tests results file inside this directory
--stop-on-failure Stop running Test Suite on first Test Case failure
--var stringArray --var cds='cds -f config.json' --var cds2='cds -f config.json'
--var-from-file strings --var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionnary
--var-from-file strings --var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionary
-v, --verbose count verbose. -vv to very verbose and -vvv to very verbose with CPU Profiling
```

Expand Down Expand Up @@ -647,7 +647,7 @@ Example:

### Using logical operators

While assertions use `and` operator implicitely, it is possible to use other logical operators to perform complex assertions.
While assertions use `and` operator implicitly, it is possible to use other logical operators to perform complex assertions.

Supported operators are `and`, `or` and `xor`.

Expand Down Expand Up @@ -858,7 +858,7 @@ The following data types are supported, each exposing contexted variables `.inde

For instance, the following example will iterate over an array of two items containing maps:
```yaml
- name: range with harcoded array
- name: range with hardcoded array
steps:
- type: exec
range:
Expand Down
4 changes: 2 additions & 2 deletions assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ func checkBranch(ctx context.Context, tc TestCase, stepNumber int, rangedIndex i
err = fmt.Errorf("no assertions succeeded:\n%s\n", strings.Join(results, "\n"))
}
if assertionsSuccess > 1 {
err = fmt.Errorf("multiple assertions succeeded but expected only one to suceed:\n%s\n", strings.Join(results, "\n"))
err = fmt.Errorf("multiple assertions succeeded but expected only one to succeed:\n%s\n", strings.Join(results, "\n"))
}
case "not":
if assertionsSuccess > 0 {
err = fmt.Errorf("some assertions succeeded but expected none to suceed:\n%s\n", strings.Join(results, "\n"))
err = fmt.Errorf("some assertions succeeded but expected none to succeed:\n%s\n", strings.Join(results, "\n"))
}
default:
return newFailure(ctx, tc, stepNumber, rangedIndex, "", fmt.Errorf("unsupported assertion operator %s", operator))
Expand Down
2 changes: 1 addition & 1 deletion assertions/assertions.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func ShouldBeMap(actual interface{}, expected ...interface{}) error {
//
func ShouldEqual(actual interface{}, expected ...interface{}) error {
// if expected is an array, we consider that this array is an array of string
// so, we concat all values before doing the comparaison
// so, we concat all values before doing the comparison
if len(expected) > 0 {
var args string
for i := range expected {
Expand Down
2 changes: 1 addition & 1 deletion cmd/venom/run/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {
stopOnFailureFlag = Cmd.Flags().Bool("stop-on-failure", false, "Stop running Test Suite on first Test Case failure")
htmlReportFlag = Cmd.Flags().Bool("html-report", false, "Generate HTML Report")
verboseFlag = Cmd.Flags().CountP("verbose", "v", "verbose. -vv to very verbose and -vvv to very verbose with CPU Profiling")
varFilesFlag = Cmd.Flags().StringSlice("var-from-file", []string{""}, "--var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionnary")
varFilesFlag = Cmd.Flags().StringSlice("var-from-file", []string{""}, "--var-from-file filename.yaml --var-from-file filename2.yaml: yaml, must contains a dictionary")
variablesFlag = Cmd.Flags().StringArray("var", nil, "--var cds='cds -f config.json' --var cds2='cds -f config.json'")
outputDirFlag = Cmd.PersistentFlags().String("output-dir", "", "Output Directory: create tests results file inside this directory")
libDirFlag = Cmd.PersistentFlags().String("lib-dir", "", "Lib Directory: can contain user executors. example:/etc/venom/lib:$HOME/venom.d/lib")
Expand Down
4 changes: 2 additions & 2 deletions executors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, erro
//...

systemout := "foo"
ouputCode := 0
outputCode := 0

// prepare result
r := Result{
Code: ouputCode, // return Output Code
Code: outputCode, // return Output Code
Command: e.Command, // return Command executed
Systemout: systemout, // return Output string
}
Expand Down
4 changes: 2 additions & 2 deletions executors/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, erro
for {
line, errs := stdoutreader.ReadString('\n')
if errs != nil {
// ReadString returns what has been read even though an error was encoutered
// ReadString returns what has been read even though an error was encountered
// ie. capture outputs with no '\n' at the end
result.Systemout += line
stdout.Close()
Expand All @@ -165,7 +165,7 @@ func (Executor) Run(ctx context.Context, step venom.TestStep) (interface{}, erro
for {
line, errs := stderrreader.ReadString('\n')
if errs != nil {
// ReadString returns what has been read even though an error was encoutered
// ReadString returns what has been read even though an error was encountered
// ie. capture outputs with no '\n' at the end
result.Systemerr += line
stderr.Close()
Expand Down
4 changes: 2 additions & 2 deletions executors/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ In your yaml file, you can use:
- proxy (optional): set to use a proxy server for connection to url
- resolve (optional): array of custom resolver of host and port pair. example: foo.com:443:127.0.0.1
- ignore_verify_ssl (optional): set to true if you use a self-signed SSL on remote for example
- basic_auth_user (optional): username to use for HTTP basic authentification
- basic_auth_password (optional): password to use for HTTP basic authentification
- basic_auth_user (optional): username to use for HTTP basic authentication
- basic_auth_password (optional): password to use for HTTP basic authentication
- no_follow_redirect (optional): indicates that you don't want to follow Location if server returns a Redirect (301/302/...)
- skip_body: skip the body and bodyjson result
- skip_headers: skip the headers result
Expand Down
2 changes: 1 addition & 1 deletion executors/kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In your yaml file, you can use:
- with_avro optional - describes if this test should expect Avro schema to be used. NOTE if you used it for consumer, you will have to use it for Producer too.
- user optional
- password optional
- kafka_version optional, defaut is 0.10.2.0
- kafka_version optional, default is 0.10.2.0

- client_type mandator: producer or consumer

Expand Down
2 changes: 1 addition & 1 deletion executors/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (e Executor) consumeMessages(ctx context.Context) ([]Message, []interface{}

consumerGroup, err := sarama.NewConsumerGroup(e.Addrs, e.GroupID, config)
if err != nil {
return nil, nil, fmt.Errorf("error instanciate consumer err: %w", err)
return nil, nil, fmt.Errorf("error instantiate consumer err: %w", err)
}
defer func() { _ = consumerGroup.Close() }()

Expand Down
2 changes: 1 addition & 1 deletion executors/plugins/odbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Step to execute SQL queries into databases:

* **ODBC**

It use the package `sqlx` under the hood: https://github.com/jmoiron/sqlx to retreive rows as a list of map[string]interface{}
It use the package `sqlx` under the hood: https://github.com/jmoiron/sqlx to retrieve rows as a list of map[string]interface{}

## Input

Expand Down
4 changes: 2 additions & 2 deletions executors/rabbitmq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ testcases:
- value: '{"a": "b"}'
contentType: application/json
contentEncoding: utf8
persistant: false
persistent: false
headers:
myCustomHeader: value
myCustomHeader2: value2
Expand Down Expand Up @@ -110,7 +110,7 @@ testcases:
- value: '{"a": "b"}'
contentType: application/json
contentEncoding: utf8
persistant: false
persistent: false
headers:
myCustomHeader: value
myCustomHeader2: value2
Expand Down
4 changes: 2 additions & 2 deletions executors/rabbitmq/rabbitmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Executor struct {
Exchange string `json:"exchange" yaml:"exchange"`
// RoutingKey represents the RabbitMQ routing key
ExchangeType string `json:"exchange_type" yaml:"exchangeType"`
// ExchangeType respresents the type of exchange (fanout, etc..)
// ExchangeType represents the type of exchange (fanout, etc..)
RoutingKey string `json:"routing_key" yaml:"routingKey"`

// Represents the limit of message will be read. After limit, consumer stop read message
Expand Down Expand Up @@ -241,7 +241,7 @@ func (e Executor) consumeMessages(ctx context.Context) ([]string, []interface{},
if err != nil {
return nil, nil, nil, nil, err
}
venom.Debug(ctx, "Q declated '%s'", q.Name)
venom.Debug(ctx, "Q declared '%s'", q.Name)

// If an exchange if defined
if e.Exchange != "" {
Expand Down
6 changes: 3 additions & 3 deletions executors/readfile/readfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func (e *Executor) readfile(workdir string) (Result, error) {
mod := make(map[string]string)

for _, f := range filesPath {
f, erro := os.Open(f)
if erro != nil {
return result, fmt.Errorf("Error while opening file: %s", erro)
f, error := os.Open(f)
if error != nil {
return result, fmt.Errorf("Error while opening file: %s", error)
}
defer f.Close()

Expand Down
4 changes: 2 additions & 2 deletions executors/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Use case: your software need to make call to a Redis.

## Input

The follwing inputs are available:
The following inputs are available:
- `commands`: an array of Redis command
- `path`: a file which contains a series of Redis command. If path property is filled, commands property will be ignored.
- `dialURL`: Redis server URL
Expand Down Expand Up @@ -54,7 +54,7 @@ testcases:
steps:
- type: redis
path: testredis/commands.txt
dialURL: "redis://localhost:6379/0" # The global dialURL is overriden by this setting
dialURL: "redis://localhost:6379/0" # The global dialURL is overridden by this setting
assertions:
- result.commands.commands0.response ShouldEqual OK
- result.commands.commands1.response ShouldEqual bar
Expand Down
2 changes: 1 addition & 1 deletion executors/sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Step to execute SQL queries into databases:
* **PostgreSQL**
* **Oracle**

It use the package `sqlx` under the hood: https://github.com/jmoiron/sqlx to retreive rows as a list of map[string]interface{}
It use the package `sqlx` under the hood: https://github.com/jmoiron/sqlx to retrieve rows as a list of map[string]interface{}

## Input

Expand Down
12 changes: 6 additions & 6 deletions executors/web/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,40 @@ type Action struct {
HistoryAction string `yaml:"historyAction,omitempy"`
}

// Fill represents informations needed to fill input/textarea
// Fill represents information needed to fill input/textarea
type Fill struct {
Find string `yaml:"find,omitempty"`
Text string `yaml:"text,omitempty"`
Key *string `yaml:"key,omitempty"`
}

// Click represents informations needed to click on web components
// Click represents information needed to click on web components
type Click struct {
Find string `yaml:"find,omitempty"`
Wait int64 `yaml:"wait"`
}

// Navigate represents informations needed to navigate on defined url
// Navigate represents information needed to navigate on defined url
type Navigate struct {
URL string `yaml:"url,omitempty"`
Reset bool `yaml:"reset,omitempty"`
}

// Select represents informations needed to select an option
// Select represents information needed to select an option
type Select struct {
Find string `yaml:"find,omitempty"`
Text string `yaml:"text,omitempty"`
Wait int64 `yaml:"wait,omitempty"`
}

// UploadFile represents informations needed to upload files
// UploadFile represents information needed to upload files
type UploadFile struct {
Find string `yaml:"find,omitempty"`
Files []string `yaml:"files,omitempty"`
Wait int64 `yaml:"wait,omitempty"`
}

// SelectFrame represents informations needed to select the frame
// SelectFrame represents information needed to select the frame
type SelectFrame struct {
Find string `yaml:"find,omitempty"`
}
24 changes: 12 additions & 12 deletions process_testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func (v *Venom) runTestSteps(ctx context.Context, tc *TestCase, tsIn *TestStepRe
allVars.AddAll(tc.computedVars.Clone())
tsResult.ComputedVars = tc.computedVars.Clone()

assign, _, err := processVariableAssigments(ctx, tc.Name, allVars, rawStep)
assign, _, err := processVariableAssignments(ctx, tc.Name, allVars, rawStep)
if err != nil {
tsResult.appendError(err)
Error(ctx, "unable to process variable assignments: %v", err)
Expand Down Expand Up @@ -544,11 +544,11 @@ func parseRanged(ctx context.Context, rawStep []byte, stepVars H) (Range, error)
return ranged, nil
}

func processVariableAssigments(ctx context.Context, tcName string, tcVars H, rawStep json.RawMessage) (H, bool, error) {
func processVariableAssignments(ctx context.Context, tcName string, tcVars H, rawStep json.RawMessage) (H, bool, error) {
var stepAssignment AssignStep
var result = make(H)
if err := yaml.Unmarshal(rawStep, &stepAssignment); err != nil {
Error(ctx, "unable to parse assignements (%s): %v", string(rawStep), err)
Error(ctx, "unable to parse assignments (%s): %v", string(rawStep), err)
return nil, false, err
}

Expand All @@ -561,27 +561,27 @@ func processVariableAssigments(ctx context.Context, tcName string, tcVars H, raw
tcVarsKeys = append(tcVarsKeys, k)
}

for varname, assigment := range stepAssignment.Assignments {
for varname, assignment := range stepAssignment.Assignments {
Debug(ctx, "Processing %s assignment", varname)
varValue, has := tcVars[assigment.From]
varValue, has := tcVars[assignment.From]
if !has {
varValue, has = tcVars[tcName+"."+assigment.From]
varValue, has = tcVars[tcName+"."+assignment.From]
if !has {
if assigment.Default == nil {
err := fmt.Errorf("%s reference not found in %s", assigment.From, strings.Join(tcVarsKeys, "\n"))
if assignment.Default == nil {
err := fmt.Errorf("%s reference not found in %s", assignment.From, strings.Join(tcVarsKeys, "\n"))
Info(ctx, "%v", err)
return nil, true, err
}
varValue = assigment.Default
varValue = assignment.Default
}
}
if assigment.Regex == "" {
if assignment.Regex == "" {
Info(ctx, "Assign '%s' value '%s'", varname, varValue)
result.Add(varname, varValue)
} else {
regex, err := regexp.Compile(assigment.Regex)
regex, err := regexp.Compile(assignment.Regex)
if err != nil {
Warn(ctx, "unable to compile regexp %q", assigment.Regex)
Warn(ctx, "unable to compile regexp %q", assignment.Regex)
return nil, true, err
}
varValueS, ok := varValue.(string)
Expand Down
6 changes: 3 additions & 3 deletions process_testcase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gopkg.in/yaml.v2"
)

func TestProcessVariableAssigments(t *testing.T) {
func TestProcessVariableAssignments(t *testing.T) {
InitTestLogger(t)
assign := AssignStep{}
assign.Assignments = make(map[string]Assignment)
Expand All @@ -26,7 +26,7 @@ func TestProcessVariableAssigments(t *testing.T) {

tcVars := H{"here.some.value": "this is the \nvalue"}

result, is, err := processVariableAssigments(context.TODO(), "", tcVars, b)
result, is, err := processVariableAssignments(context.TODO(), "", tcVars, b)
assert.True(t, is)
assert.NoError(t, err)
assert.NotNil(t, result)
Expand All @@ -38,7 +38,7 @@ func TestProcessVariableAssigments(t *testing.T) {
script: echo 'foo'
`)
assert.NoError(t, yaml.Unmarshal(b, &wrongStepIn))
result, is, err = processVariableAssigments(context.TODO(), "", tcVars, b)
result, is, err = processVariableAssignments(context.TODO(), "", tcVars, b)
assert.False(t, is)
assert.NoError(t, err)
assert.Nil(t, result)
Expand Down
2 changes: 1 addition & 1 deletion process_testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (v *Venom) runTestSuite(ctx context.Context, ts *TestSuite) {
}
}

// Intialiaze the testsuite varibles and compute a first interpolation over them
// Intialiaze the testsuite variables and compute a first interpolation over them
ts.Vars.AddAll(v.variables.Clone())
vars, _ := DumpStringPreserveCase(ts.Vars)
for k, v := range vars {
Expand Down
2 changes: 1 addition & 1 deletion tests/grpc/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const mockServer = createMockServer({
serviceName: "Greeter",
rules: [
{ method: "hello", input: { message: "Hello" }, output: { message: "Hello" } },
{ method: "hello", input: { message: "Hi" }, output: { message: "A little familar, are't you" } },
{ method: "hello", input: { message: "Hi" }, output: { message: "A little familiar, are't you" } },
{ method: "goodbye", input: ".*", output: { message: "Goodbye" } },

{
Expand Down
2 changes: 1 addition & 1 deletion tests/rabbitMQ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ testcases:
- value: '{"a": "b"}'
contentType: application/json
contentEncoding: utf8
persistant: false
persistent: false
headers:
myCustomHeader: value
myCustomHeader2: value2
Expand Down
Loading

0 comments on commit 0910e2e

Please sign in to comment.