api-smoke-test-go

command module
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 13 Imported by: 0

README

Introduction

Smoke test for APIs that use OpenAPI 3.0 specification. Tests GET requests, if response status code isn't in config.txt file the test will fail, but all endpoints will be tested. This program was tested with GitHub REST API.

Run

api-smoke-test-go.exe -oas OAS_file [options]

-oas File name of the OpenAPI 3.0 specification file.

Options:

-auth Use authentication, i.e. authentication token is used to authorize requests. Env. variable auth_token must be set,

on Windows run set auth_token=your_access_token

on Linux run export auth_token=your_access_token

-help Show help.

-req-param Integer used in requests that contain parameters (default 13).

-single-thread Use single thread for HTTP requests. By default every request is made in separate goroutine.

-validate Validate file given as "oas" argument.

Result of the test is saved to file named api_title_test_results.xml. The file has JUnit format, so it can be used in Azure pipeline as a test result.

TODO

Make other HTTP requests, i.e. POST, PUT, PATCH, DELETE.

oas argument accepts url of OAS file.

Add oAuth2 authorization. Currently only access token is supported.

-localhost, used when testing API that runs on your local machine.

-only-get, test only GET requests.

P.S.

Read usability clause in LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL