Home

Awesome

CLA assistant Codacy Badge Codacy Badge GitHub All Releases Docker Pulls LinuxSuRen/open-source-best-practice

English | δΈ­ζ–‡

This is a API testing tool. πŸš€

Features

Get started

Try in PWD

Install it via hd or download from releases:

hd install atest

or, you can install it in Kubernetes. See also the manifests.

see the following usage:

API testing tool

Usage:
  atest [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  func        Print all the supported functions
  help        Help about any command
  json        Print the JSON schema of the test suites struct
  run         Run the test suite
  sample      Generate a sample test case YAML file
  server      Run as a server mode
  service     Install atest as a Linux service

Flags:
  -h, --help      help for atest
  -v, --version   version for atest

Use "atest [command] --help" for more information about a command.

below is an example of the usage, and you could see the report as well:

atest run -p sample/testsuite-gitlab.yaml --duration 1m --thread 3 --report md

APIAverageMaxMinCountError
GET https://gitlab.com/api/v4/projects1.152777167s2.108680194s814.928496ms990
GET https://gitlab.com/api/v4/projects/45088772840.761064ms1.487285371s492.583066ms100
consume: 1m2.153686448s

Use in Docker

Use atest as server mode in Docker, then you could visit the UI from 8080:

docker run --pull always -p 8080:8080 ghcr.io/linuxsuren/api-testing:master

Use atest-collector in Docker:

docker run -p 1234:8080 -v /var/tmp:/var/tmp \
  ghcr.io/linuxsuren/api-testing atest-collector \
  --filter-path /api \
  -o /var/tmp/sample.yaml
# you could find the test cases file from /var/tmp/sample
# cat /var/tmp/sample

Template

The following fields are templated with sprig:

Functions

You could use all the common functions which comes from sprig. Besides some specific functions are available:

NameUsage
randomKubernetesName{{randomKubernetesName}} to generate Kubernetes resource name randomly, the name will have 8 chars
sleep{{sleep(1)}} in the pre and post request handle

Verify against Kubernetes

It could verify any kinds of Kubernetes resources. Please set the environment variables before using it:

See also the example.

TODO

Limit

Community Exchange

Feel free to talk to us about any questions you may have about API Testing in the following ways.

Mailing List

api-testing-tech@googlegroups.com, Feel free to discuss everything related to API Testing via this mailing list.

GitHub discussion

GitHub Discussion