{"id":44675388,"url":"https://github.com/dwtechnologies/steptest","last_synced_at":"2026-02-15T03:05:13.169Z","repository":{"id":57493153,"uuid":"131807632","full_name":"dwtechnologies/steptest","owner":"dwtechnologies","description":"Package and program made to make transactional load test easy.","archived":false,"fork":false,"pushed_at":"2018-05-02T06:27:01.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"beta1","last_synced_at":"2026-02-14T05:01:45.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dwtechnologies.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-02T06:25:51.000Z","updated_at":"2018-10-09T08:01:15.000Z","dependencies_parsed_at":"2022-08-28T17:02:32.513Z","dependency_job_id":null,"html_url":"https://github.com/dwtechnologies/steptest","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dwtechnologies/steptest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwtechnologies%2Fsteptest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwtechnologies%2Fsteptest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwtechnologies%2Fsteptest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwtechnologies%2Fsteptest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwtechnologies","download_url":"https://codeload.github.com/dwtechnologies/steptest/tar.gz/refs/heads/beta1","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwtechnologies%2Fsteptest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29466925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T01:01:38.065Z","status":"online","status_checked_at":"2026-02-15T02:00:07.449Z","response_time":118,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-15T03:05:12.865Z","updated_at":"2026-02-15T03:05:13.159Z","avatar_url":"https://github.com/dwtechnologies.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StepTest\n\nPackage and program made to make transactional load test easy.\n\n## Motivation\n\nMost other load testing packages/frameworks was made for testing REST APIs in a non transactional way.\nThis package was born out of the necessity to test our Magento based eCommerce platforms checkout over\nmultiple website ids and payment methods.\n\nFor this we needed a package that can, in a flexible way, test multiple steps in a transactional manner.\nIt must also be able to loop over values and also set variables based on the result body / headers from\nprevious transaction.\n\nIt also has the possibility to replay real scenarios. Jobs can be added with a \"start after\" value.\nMaking it possible to replay old load exactly as it happened.\n\n## Usage\n\nThe first part of making StepTest is work is defining a steps -file.\nThis includes the different steps that the Server will run for each job that is added with the specified steps -file.\n\nThe steps -files syntax support a range of different functions such as `VAR`, `VARFROM`, `ARRAY`, `FOR`, `AUTH`, `HEADER`, `COOKIE` and of course HTTP\nfunctions such as `GET`, `POST`, `PUT`, `PATCH`, `DELETE`. Functions can be declared either in upper or lower case.\n\nEach step is divided by a dash `-`, any leading/trailing spaces and tabs will be removed.\n\n## Example\n\n### steps.txt\n\n    - var { \"name\": \"url\", \"value\": \"example.com\" }\n      array { \"name\": \"productList\", \"values\": [ \"prodId1\", \"prodId2\", \"prodId3\" ] }\n\n    - get https://{{url}}/getSession\n      varfrom { \"from\": \"body\", \"name\": \"session\", \"syntax\": \"\u003cinput name=\\\"session\\\" type=\\\"hidden\\\" value=\\\"{{StepTestSyntax}}\\\" /\u003e\"}\n\n    - for product in {{productList}}\n      post https://{{url}}/addProduct {\"session\":\"{{session}}\",\"product\":\"{{product}}\"}\n      forend\n\n    - get https://{{url}}/getCart\n\n### main.go\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/dwtechnologies/steptest\"\n)\n\nfunc main() {\n    // Create a new StepTest server with 10 virtual users and 15s http timeout.\n    srv, err := steptest.New(10, 15)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    // Add a job with no vars or startAfter value.\n    srv.AddJob(\"steps.txt\", 1, nil, nil)\n\n    // Start the server and then wait until StepTest has finished all requests.\n    srv.Start()\n    srv.WaitDone()\n\n    // Print some results.\n    if errors := srv.GetNumberOfErrors(); errors \u003e 0 {\n        fmt.Printf(\"\u003e\u003e\u003e Number of errors: %d\\n\\n\", errors)\n\n        for _, err := range srv.GetErrorMessages() {\n            fmt.Printf(\"%s\\n\", err.Error)\n        }\n        fmt.Printf(\"\\n\")\n    }\n\n    fmt.Printf(\"\u003e\u003e\u003e Total number of fetches: %d\\n\", srv.GetNumberOfRequests())\n    fmt.Printf(\"\u003e\u003e\u003e Average time: %d ms\\n\", srv.GetAverageFetchTime())\n    fmt.Printf(\"\u003e\u003e\u003e Total runtime: %d s\\n\", srv.GetTotalRunTime())\n}\n```\n\n## Reference - Stepfile\n\nEvery line that starts with a dash followed by a space will be defined as a step separator.\nEvery function in a step is divided by every line that starts with two spaces.\n\n### GET\n\n`get http://example.com`\n\n\u003e Creates a new GET request against http://example.com\n\n### POST\n\n`post http://example.com {\"name\":\"value\"}`\n\n\u003e Creates a new POST request against http://example.com with a JSON body.\n\n### PUT\n\n`put http://example.com name%3Dvalue`\n\n\u003e Creates a new PUT request against http://example.com with a URL Encoded body.\n\n### PATCH\n\n`patch http://example.com/id/1234 {\"partial\":\"info\"}`\n\n\u003e Creates a new PATCH request against http://example.com with a JSON body.\n\n### DELETE\n\n`delete http://example.com/id/1234`\n\n\u003e Creates a new DELETE request against http://example.com with a empty body.\n\n### VAR\n\n`var { \"name\": \"var1\", \"value\": \"val1\" }`\n\n\u003e Creates a new variable called var1 with a value of val1.\n\n### ARRAY\n\n`array { \"name\": \"arr1\", \"values\": [ \"val1\", \"val2\", \"val3\" ] }`\n\n\u003e Creates a new array called arr1 with values val1, val2 and val3.\n\n### VARFROM\n\n`varfrom { \"from\": \"body\", \"name\": \"var1\", \"syntax\": \"\u003cinput name=\\\"session\\\" type=\\\"hidden\\\" value=\\\"{{StepTestSyntax}}\\\" /\u003e\" }`\n\n\u003e Creates a variable called var1. The value of var1 will be based on the requests BODY where it will look for the syntax `\u003cinput name=\\\"session\\\" type=\\\"hidden\\\" value=\\\"{{StepTestSyntax}}\\\" /\u003e`. And anything thats contained in the `{{StepTestSyntax}}` will be the value of the variable.\n\n### COOKIE\n\n`cookie { }`\n\n\u003e Creates a new cookie with the values...\n\n### HEADER\n\n`header { \"name\": \"header1\", \"value\": \"val1\" }`\n\n\u003e Creates a new header with name header1 and value val1. (local to the step)\n\n### \\@HEADER\n\n`@header { \"name\": \"header1\", \"value\": \"val1\" }`\n\n\u003e Creates a new global header with name header1 and value val1. (global for whole job)\n\n### AUTH\n\n`auth { \"username\": \"user1\", \"password\": \"pass1\" }`\n\n\u003e Adds Auth to the request with username and password user1 and pass1. (local to the step)\n\n### \\@AUTH\n\n`@auth { \"username\": \"user1\", \"password\": \"pass1\" }`\n\n\u003e Adds Global Auth to the request with username and password user1 and pass1. (global for whole job)\n\n### FOR\n\n`for i in {{arr1}}`\n`for i in [ \"val1\", \"val2\", \"val3\" ]`\n`for i in {{var1}}` // var1 needs to contain a stringified JSON array that can be unmarshaled.\n\n\u003e Creates a for loop that will loop through all the values in the array and set the variable i to the value\n\u003e from the array. More than one step can be included in the forloop. Should be ended with a forend.\n\u003e The step that the for is defined in will be included in the for loop.\n\n### FOREND\n\n`forend`\n\n\u003e Ends a for loop. Can be part of the same step as for. Then only that step will be looped over.\n\n## Reference - Exported functions\n\n### New\n\n```go\nsteptest.New(v int, t int) (*Server, error)\n```\n\n\u003e New takes a number of virtual users v and request timeout t and creates a StepTest Server.\n\u003e Returns *Server and error.\n\n### AddJob\n\n```go\n*Server.AddJob(s string, r int, v map[string]string, a *time.Time) error\n```\n\n\u003e AddJob will parse a job and add it to the *Server.\n\u003e It takes the path to a stepsfile s, r number of runs, v variables as a map of strings\n\u003e and time a when to start the job, for direct execution just nil.\n\u003e Returns error.\n\n### Start\n\n```go\n*Server.Start()\n```\n\n\u003e Start will start the execution of parsed jobs. If there are any unparsed jobs left\n\u003e in the queue it will wait for them to finish before starting execution.\n\n### StopParsing\n\n```go\n*Server.StopParsing() error\n```\n\n\u003e StopParsing will send a signal to stop all parsing being done on the Server.\n\u003e StopParsing can only be called when the Server is in a IsParsing -state.\n\u003e Returns error.\n\n### StopRunning\n\n```go\n*Server.StopRunning() error\n```\n\n\u003e StopRunning will send a signal to stop fetching requests on the Server.\n\u003e StopRunning can only be called when the Server is in a IsRunning -state.\n\u003e Returns error.\n\n### WaitDone\n\n```go\n*Server.WaitDone()\n```\n\n\u003e WaitDone will wait until the Server has finished fetching all the requests in the *Server.jobs map.\n\u003e WaitDone will block the program until it has finished.\n\n### GetNumberOfVirtualUsers\n\n```go\n*Server.GetNumberOfVirtualUsers() int\n```\n\n\u003e GetNumberOfVirtualUsers returns the number of virtual users.\n\u003e Returns int.\n\n### GetNumberOfJobs\n\n```go\n*Server.GetNumberOfJobs() int\n```\n\n\u003e GetNumberOfJobs returns the number of jobs stored on the Server.\n\u003e Returns int\n\n### GetNumberOfRequests\n\n```go\n*Server.GetNumberOfRequests() int\n```\n\n\u003e GetNumberOfRequests returns the number of successfull requests.\n\u003e Returns int.\n\n### GetNumberOfErrors\n\n```go\n*Server.GetNumberOfErrors() int\n```\n\n\u003e GetNumberOfErrors will return the amount of requests that errored.\n\u003e Returns int.\n\n### GetErrorMessages\n\n```go\n*Server.GetErrorMessages() []error\n```\n\n\u003e GetErrorMessages will return all the error messages since the Server was started.\n\u003e Returns Error.\n\n### GetAverageFetchTime\n\n```go\n*Server.GetAverageFetchTime() time.Duration\n```\n\n\u003e GetAverageFetchTime will return the average fetch time for all the requests. Requests that resultet in errors will be ignored in the average.\n\u003e Returns time.Duration.\n\n### IsParsing\n\n```go\n*Server.IsParsing() bool\n```\n\n\u003e IsParsing returns true if the Server is still parsing jobs. False if it has finished or manually been stopped.\n\u003e Returns bool.\n\n### IsRunning\n\n```go\n*Server.IsRunning() bool\n```\n\n\u003e IsRunning returns true if the Server is still running jobs. False if it has finished or manually been stopped.\n\u003e Returns bool.\n\n### GetTotalRunTime\n\n```go\n*Server.GetTotalRunTime() time.Duration\n```\n\n\u003e GetTotalRunTime will return the total runtime since Server start.\n\u003e Returns time.Duration.\n\n## Installation\n\n`go get -u github.com/dwtechnologies/steptest`\n\n## Contributors\n\nTo improve on the project, please submit a pull request.\n\n## License\n\nThe code is copyright under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwtechnologies%2Fsteptest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwtechnologies%2Fsteptest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwtechnologies%2Fsteptest/lists"}