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

[WIP] feat: new assertion engine #1378

Merged
merged 36 commits into from
Oct 21, 2022
Merged

[WIP] feat: new assertion engine #1378

merged 36 commits into from
Oct 21, 2022

Conversation

mathnogueira
Copy link
Contributor

This PR implements the new assertion engine to allow users to write more complex assertions.

Related material:
#1315 #1350

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

mathnogueira and others added 6 commits October 11, 2022 12:24
* fix: opensearch example by pinning docker image versions (#1358)

pin docker image versions

* add parsing rules

* add filters to the parser

* add more test cases for filters

* add basic comparisons

* add attributes support

* remove dead code

* support duration comparisons

* fix string interpolation

* add more tests for interpolation

* add support for filters and add json_path filter

* support meta attributes

* fix meta attributes and duration precision bug

* update assertion engine to use new expression engine

* update cli to use new assertion format

* fix examples

* patch tracetesting tests

* fix duration conversion

* fix regex to detect id field in definition file

* remove dead code from assertions

* improve filters and add regex filters

* add new test to assert spaces are allowed in filter args

* improve filter implementation to use typed values

* use const instead of string

Co-authored-by: Sebastian Choren <[email protected]>

* rename types and use iota

* remove github actions branch filter for pr pipelines

Co-authored-by: Sebastian Choren <[email protected]>
* docs: new expressions

* apply Julianne changes

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/expressions.md

Co-authored-by: Julianne Fermi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <[email protected]>

Co-authored-by: Julianne Fermi <[email protected]>
@mathnogueira mathnogueira changed the title [WIPfeat: new assertion engine [WIP] feat: new assertion engine Oct 13, 2022
@mathnogueira
Copy link
Contributor Author

#1372 describes a problem that will be solved by the new assertion engine introduced in this PR

mathnogueira and others added 17 commits October 13, 2022 14:21
* feat: support variables in expressions

* docs: add documentation about variables in expressions

* docs: fix variables title

* add benchmark

* Update docs/expressions.md

Co-authored-by: Julianne Fermi <[email protected]>

Co-authored-by: Julianne Fermi <[email protected]>
* fix: opensearch example by pinning docker image versions (#1358)

pin docker image versions

* add parsing rules

* add filters to the parser

* add more test cases for filters

* add basic comparisons

* add attributes support

* remove dead code

* support duration comparisons

* fix string interpolation

* add more tests for interpolation

* add support for filters and add json_path filter

* support meta attributes

* fix meta attributes and duration precision bug

* update assertion engine to use new expression engine

* update cli to use new assertion format

* fix examples

* patch tracetesting tests

* fix duration conversion

* fix regex to detect id field in definition file

* remove dead code from assertions

* improve filters and add regex filters

* add new test to assert spaces are allowed in filter args

* improve filter implementation to use typed values

* use const instead of string

Co-authored-by: Sebastian Choren <[email protected]>

* rename types and use iota

* remove github actions branch filter for pr pipelines

Co-authored-by: Sebastian Choren <[email protected]>
* docs: new expressions

* apply Julianne changes

Co-authored-by: Julianne Fermi <[email protected]>

* Update docs/expressions.md

Co-authored-by: Julianne Fermi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <[email protected]>

Co-authored-by: Julianne Fermi <[email protected]>
* feat: add count filter

* update docs
* feat: allow 'last' as arg for get_index filter

* update documentation
* feat: support variables in expressions

* docs: add documentation about variables in expressions

* docs: fix variables title

* add benchmark

* Update docs/expressions.md

Co-authored-by: Julianne Fermi <[email protected]>

Co-authored-by: Julianne Fermi <[email protected]>
xoscar and others added 8 commits October 18, 2022 14:15
* remove old replacer implementation

* add function calls to expression engine parser

* add full support for function calls in expresions

* remove old functions package and fix tests

* docs: update generator functions docs

* Apply suggestions from code review

Co-authored-by: Julianne Fermi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Sebastian Choren <[email protected]>

* merge count and length filters into a single length filter

Co-authored-by: Julianne Fermi <[email protected]>
Co-authored-by: Sebastian Choren <[email protected]>
* feat: array support and type filter

* update docs

* add test case

* extract value to its own package

* make expression engine use value.Value instead of string

* add Type function to value.Value

* overload contains operator to work with arrays

* add example of array contains in docs

* add chaining type filter example
@mathnogueira mathnogueira marked this pull request as ready for review October 20, 2022 18:34
Copy link
Contributor

@xoscar xoscar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👀

@xoscar xoscar merged commit 2cf036c into main Oct 21, 2022
@xoscar xoscar deleted the new-assertions branch October 21, 2022 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants