Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baseline for acceptance tests #139

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Baseline for acceptance tests #139

wants to merge 1 commit into from

Conversation

joanlopez
Copy link
Member

@joanlopez joanlopez commented May 12, 2023

It sets up the baseline to write acceptance tests.

It..

  • Assumes the binary killgrave exists in the system at testing time.
    • So, you need to compile the app before running these tests, and run them as a black box
  • Relies on txtar files to simplify test cases definition.

The main testing algorithm is:

  • For every directory under acceptance/tests:
    • Creates a temporary directory with files defined at config.txtar (imposters, schemas, responses, etc)
    • Launches the application, specifying the former as the imposters directory
    • For every .txtar file on http directory:
      • It performs the request defined in req.http
      • Asserts the response against the file defined in res.http.

So, it's pretty easy to define multiple acceptance/e2e tests for different imposters.

Further ideas are:

  • Read the execution command from a cmd file (or similar)
    • So, we can make the definition of tests even more dynamic (random port, specific config, etc)
  • Add support for golden files, so we make the definition of additional test cases even easier (just define request, and record response).

Some open questions are:

  • How to integrate it with CI?
  • How to differentiate them from other tests (build flag?)

Thanks!

@joanlopez joanlopez added enhancement New feature or request improvement labels May 12, 2023
@joanlopez joanlopez requested a review from aperezg May 12, 2023 01:30
@joanlopez joanlopez self-assigned this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant