{"id":13528229,"url":"https://github.com/robwhitby/shakedown","last_synced_at":"2026-03-11T20:27:38.362Z","repository":{"id":36513324,"uuid":"40819036","full_name":"robwhitby/shakedown","owner":"robwhitby","description":"A tiny Bash DSL for HTTP testing","archived":false,"fork":false,"pushed_at":"2024-04-17T13:45:56.000Z","size":28,"stargazers_count":103,"open_issues_count":1,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-02T13:34:19.299Z","etag":null,"topics":["bash","http","smoke-test","test-framework"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"madhums/node-express-mongoose","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robwhitby.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-16T13:26:32.000Z","updated_at":"2024-04-25T19:49:39.000Z","dependencies_parsed_at":"2024-11-02T13:31:40.483Z","dependency_job_id":"e805b240-3ea5-469d-9d58-e9221d23f258","html_url":"https://github.com/robwhitby/shakedown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robwhitby%2Fshakedown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robwhitby%2Fshakedown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robwhitby%2Fshakedown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robwhitby%2Fshakedown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robwhitby","download_url":"https://codeload.github.com/robwhitby/shakedown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246631773,"owners_count":20808752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bash","http","smoke-test","test-framework"],"created_at":"2024-08-01T06:02:20.343Z","updated_at":"2026-03-11T20:27:38.303Z","avatar_url":"https://github.com/robwhitby.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# shakedown\n\nA tiny Bash DSL for HTTP testing with zero dependencies\u003csup\u003e*\u003c/sup\u003e.\n\nMake HTTP requests and assert on the response body and headers.\n\n\u003csub\u003e* unless you count cURL and grep\u003c/sub\u003e\n\n## Example\nCreate `test.sh`:\n```bash\n#!/usr/bin/env bash\nsource shakedown.sh                             # load the framework\n\nshakedown GET /about                            # make a GET request\n  status 200                                    # assert response status is 200\n  content_type 'text/html'                      # assert Content-Type header contains string\n  header 'Expires'                              # assert response header exists containing string\n  contains 'Take back your privacy!'            # assert response body contains string\n\nshakedown POST / -d 'q=Shakedown'               # make a POST request with form data\n  status 200\n  contains 'Bob Seger'\n```\n\nRun the tests against a base URL:\n```\n$ ./test.sh -u https://duckduckgo.com\nStarting shakedown of https://duckduckgo.com\n\nGET /about\n ✔ status 200\n ✔ Content-Type: text/html\n ✔ header Expires\n ✔ contains \"Take back your privacy!\"\n\nPOST /\n ✔ status 200\n ✔ contains \"Bob Seger\"\n\nShakedown complete. 2 passed, 0 failed.\n```\n\n\n## DSL\n```\nshakedown \u003cVERB\u003e \u003cPATH\u003e \u003cCURL OPTIONS\u003e\n  \u003cassertion\u003e\n  \u003cassertion\u003e\n  ...\n```\n\n\n## Assertions\n```\nstatus          \u003ccode\u003e           Response status code = \u003ccode\u003e\ncontains        \u003cstring\u003e         Response body contains \u003cstring\u003e\nmatches         \u003cregex\u003e          Response body matches \u003cregex\u003e\nheader          \u003cstring\u003e         Response headers contains \u003cstring\u003e\nno_header       \u003cstring\u003e         Response headers do not contain \u003cstring\u003e\ncontent_type    \u003cstring\u003e         Content-Type header contains \u003cstring\u003e\nheader_contains \u003cname\u003e \u003cstring\u003e  Response header \u003cname\u003e contains \u003cstring\u003e\n```\n\n\n## HTTP Authentication\nUse the -c option to provide credentials.\n\n```./test.sh -u my.domain.com -c user:pass```\n\n\n## Setting cURL options\nAny parameters after the path are passed straight on to cURL.\n\ne.g. To send form data, follow redirects and set verbose output.\n\n```shakedown POST /search -d 'query=shakedown' -L -v```\n\n\n## Exit code\nThe exit code is set to the number of failed tests.\n\n\n## Debugging\nTo help diagnose failing tests use ```print_headers```, ```print_body```, or make cURL verbose with '-v'.\n\n\n## More Examples\n```bash\n#!/usr/bin/env bash\nsource shakedown.sh                               # load the framework\n\nshakedown GET /foo                                # make a GET request\n  status 404                                      # assert on http status code\n  content_type 'text/html'                        # assert Content-Type header contains string\n  contains 'Not found'                            # assert body contains string\n  matches 'No.*'                                  # assert body matches regex\n\nshakedown HEAD /                                  # make a HEAD request\n  status 302\n\nshakedown GET / -H 'Accept: application/json'     # add curl options\n  print_headers                                   # output response headers for debugging\n  print_body                                      # output response body for debugging\n  status 200\n  header 'Expires'\n\nshakedown PUT /user/1 -d name=Rob                 # make a PUT request\n  status 201\n\nshakedown GET http://www.google.com -L            # provide full url to override default base url.\n  status 200                                      # -L cURL option to follow redirects\n\nshakedown GET http://www.google.com\n  header_contains 'Referrer-Policy' 'no-referrer' # assert header 'Referrer-Policy' contains value 'no-referrer'\n\nshakedown GET /about\n  contains \"$(cat about.html)\" | head -n1         # because this is a bash script we can read files etc.\n```\n\n\n## Environment variables\nThe environment variables `SHAKEDOWN_URL` and `SHAKEDOWN_CREDENTIALS` can be used instead of passing -u and -c options.\n\n```SHAKEDOWN_URL=https://duckduckgo.com ./test.sh```\n\nRequest timeouts can be set with:\n```\nSHAKEDOWN_CONNECT_TIMEOUT=5  # sets the curl option --connect-timeout. defaults to 5 seconds.\nSHAKEDOWN_MAX_TIME=30        # sets the curl option --max-time. defaults to 30 seconds.\n```\n\n## Running tests in parallel\nDivide your tests into multiple files, then run those in parallel, for example:\n\n```bash\nexport SHAKEDOWN_URL=https://duckduckgo.com\nls -1 test-*.sh | parallel bash\n```\n\n## Docker\n\n[![Push to DockerHub](https://github.com/robwhitby/shakedown/actions/workflows/docker.yml/badge.svg)](https://github.com/robwhitby/shakedown/actions/workflows/docker.yml)\n\n\u003chttps://hub.docker.com/r/robwhitby/shakedown\u003e\n\n```\ndocker run -t -v \"$PWD\":/work robwhitby/shakedown /work/sample-test.sh -u https://duckduckgo.com\n```\n\n\n## GitHub Action\n\n```yaml\n- name: Shakedown\n  uses: robwhitby/shakedown@v1\n  with:\n    tests: sample-test.sh        # required. path to test file\n    url: https://duckduckgo.com  # required. base url to test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobwhitby%2Fshakedown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobwhitby%2Fshakedown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobwhitby%2Fshakedown/lists"}