You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/01 07:52:57 UTC

[GitHub] [skywalking-website] wu-sheng commented on a change in pull request #206: Add design doc of NGE2E Verifier

wu-sheng commented on a change in pull request #206:
URL: https://github.com/apache/skywalking-website/pull/206#discussion_r567619524



##########
File path: content/blog/2021-02-01-e2e-verifier-design/index.md
##########
@@ -0,0 +1,182 @@
+---
+title: "[Design] The Verifier of NGE2E"
+date: 2021-02-01
+author: "[Zhenxu Ke](https://github.com/kezhenxu94), Tetrate.io; [Huaxi Jiang](http://github.com/fgksgf), Committer; [Ke Zhang](http://github.com/HumbertZhang), Committer"
+description: "The design of Next Generation End-to-End Testing Framework  Verifier"
+
+tags:
+- Testing
+---
+
+## Background
+
+The verifier is an important part of the next generation End-to-End Testing framework (NGE2E), which is responsible for verifying whether the actual output satisfies the expected template.
+
+## Design Thinking
+
+We will implement the verifier with [Go template](https://golang.org/pkg/text/template/), plus some enhancements. Firstly, users need to write a Go template file with provided functions and actions to describe how the expected data looks like. Then the verifer renders the template with the actual data object. Finally, the verifier compares the rendered output with the actual data. If the rendered output is not the same with the actual output, it means the actual data is inconsist with the expected data. Otherwise, it means the actual data match the expected data. On failure, the verifier will also print out what are different between expected and actual data.
+
+## Branches / Actions
+
+The verifier inherits all the actions from the standard Go template, such as `if`, `with`, `range`, etc. In addition, we also provide some custom actions to satisfy our own needs.
+
+### At Least Once of List Elements Match
+
+`atLeastOnce` checks if there is at least one element of list matches the given template.
+
+Examples:
+
+```yaml
+metrics:
+{{- atLeastOnce .metrics }}
+  name: {{ notEmpty .name }}
+  id: {{ notEmpty .id }}
+  value: {{ gt .value .0 }}
+{{- end }}
+```
+
+Note that between the `{{- atLeastOnce .metrics }}` and `{{- end }}` it is a single object, instead of a list.

Review comment:
       Could you share an example of a list?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org