Closed russcam closed 4 years ago
Just noticed lazy_static
in the codebase already. Maybe I can open a PR after this one lands to migrate to once_cell
, if that is the direction we want to go?
I am finally getting the time to migrate my project over to this crate and so I will have more time to dig into things; I figure PRs like that will help me get re-familiarized with the code...
Just noticed lazy_static in the codebase already. Maybe I can open a PR after this one lands to migrate to once_cell, if that is the direction we want to go?
Had a look at once_cell
, seems like a better API than lazy_static
, so I would be +1 on a PR to moving over to replacing lazy_static
with it.
I am finally getting the time to migrate my project over to this crate and so I will have more time to dig into things; I figure PRs like that will help me get re-familiarized with the code...
Awesome! 😃
Ok! I will open a PR for once_cell
ASAP
@mwilliammyers I've brought in once_cell
into the yaml_test_runner to create a singleton client for all of the yaml tests, which has made a massive difference to test run times 😄
About to merge this in and release a new client package
This PR adds a yaml_test_runner package to the repository. This package produces a binary that can be invoked to
As an example, the following cat.aliases test
generates the following test (use directives omitted for brevity)
Tests are generated in a tests directory in the yaml_test_runner package so that they can be invoked with
cargo test
.The yaml_test_runner package takes dependencies on both api_generator and elasticsearch packages. It uses the Api model from the former to ascertain how to generate client calls from the values defined in yaml, and uses the latter in executing tests.
The typical flow to generate and run tests is
Define
ELASTICSEARCH_VERSION
environment variableThis is used to determine which test suite to generate, based on whether the version uses the default distribution (xpack suite), or the oss distribution (oss suite).
Run yaml_test_runner
where
--branch
is the elasticsearch branch to target to download yaml tests--token
is a GitHub access token to use to download the yaml tests using the content API--path
is the path to download rest specs toRun the generated tests
The tests must be run synchronously, so a single thread must be used.
Closes #19