-
Notifications
You must be signed in to change notification settings - Fork 10
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
ADR-05 test execution #18
base: dev
Are you sure you want to change the base?
Changes from 5 commits
70e1672
eacf5c1
28ea451
6ee9e57
6515f70
d83d658
7a5b534
c663a53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# ADR-05: Test execution | ||
|
||
| authors | revision | revision date | | ||
| ---------------- | --------:| --------------:| | ||
| Andrey Kuprianov | 1 | July 18, 2022 | | ||
|
||
The present ADR describes the external interfaces of the `Execute` component that deals with test execution, either from a given abstract trace, or from (a set of) traces generated from a TLA+ model. | ||
|
||
|
||
## Command line interface | ||
|
||
Test execution CLI provides two main entry points: | ||
|
||
- `test trace [--trace <trace-file>] [--reactor <reactor-file>]` allows to execute an abstract test trace against the chain. All additional parameters are optional; when omitted, the defaults will be used. | ||
- `--trace <trace-file>` allows to specify which test trace file to execute. | ||
- `--reactor <reactor-file>` allows to provide explicitly the reactor to employ; when omitted, the reactor previously generated via `reactor` command will be used. | ||
- `test model [--model <model-file>] [--config <config-file>] [--sample <sample-operator>]` allows to execute test traces generated from a TLA+ model. All additional parameters are optional; when omitted, the defaults will be used. | ||
- `--model <model-file>` allows to specify which TLA+ model to use. | ||
- `--config <config-file>` specifies the model configuration file. | ||
- `--sample <sample-operator>` gives the name of the sample operator describing the test traces. | ||
|
||
**TODO**: add configuration capabilities, e.g.: | ||
- `test set timeout <TIMEOUT>` allows to specify the timeout (in seconds) for execution of a single test. | ||
|
||
## Programmatic dependencies | ||
|
||
`Execute` component depends on all three upstream components: | ||
|
||
### Setup | ||
|
||
From `Setup` component it needs three functions provided via an agreed upon entry point: | ||
- `setup()` sets up the chain with the default configured parameters; | ||
- **TODO**: agree upon the way to provide initialization parameters (e.g. the set of users and their wallets)from the trace into the chain genesis. | ||
- `get_client()` provides the configured `LCDClient` ready to be used with the chain; | ||
- `teardown()` destroys the previously set up chain. | ||
|
||
## Model | ||
|
||
From `Model` component it needs two functions provided via an agreed upon entry point: | ||
- `get_trace(trace = None)` retrieves the ITF trace, either the default one, or from the provided location; | ||
- `get_model_trace(model = None, config = None, sample = None)` provides a trace from the model, using either default, or the provided parameters. | ||
|
||
## React (Generate) | ||
|
||
From `React` component it needs one function provided via an agreed upon entry point: | ||
- `get_trace_reactor(trace, reactor = None)` provides the reactor for the given trace, and checks that they match each other. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to clarify this part: isn't the return value of this function a path to the reactor file (this, at least, makes the most sense to me). In that case, giving a I'd like to suggest that we explicitly ask for checking a reactor by invoking There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point! the formulation is not precise enough, let me refine it... Better like that?
|
||
|
||
In the current version, `Execute` doesn't provide any programmatic service to other components. | ||
|
||
## Environment interaction | ||
|
||
### File read | ||
|
||
`Execute` doesn't read any files by itself, all read access is mediated programmatically via other components. A non-exhaustive list of possible read dependencies: | ||
- `Setup`-mediated: chain configuration | ||
- `React`-mediated: reactor file (either default or from provided location) | ||
- `Model`-mediated: model, config & trace files (either default or from provided locations) | ||
|
||
### File write | ||
|
||
`Execute` writes into the following locations: | ||
- `tests` folder: writes the generated Pytest-based test file, that links together the setup, the reactor, and the execution of the ITF trace | ||
|
||
### Processes | ||
|
||
`Execute` runs the following (non-exhaustive) list of processes, mediated by other components: | ||
- `Setup`-mediated: blockchain binary | ||
- `Model`-mediated: model checker (Apalache) | ||
|
||
By itself, `Execute` runs `Pytest`, by supplying it the name of the generated test file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
React
calls different associations than Reactor (I would guess most people would connect it somehow to reactive programming. I suggest the nameReactorRoom
(as in my PR) or to settle on plainGenerate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, you are right; I forgot about that other
React
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I like the name
Reactor
. Short and clear enough. I just caught myself at calling your component that way in my mind:)