You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ho...@apache.org on 2021/02/06 12:56:55 UTC

[skywalking-infra-e2e] branch verifier created (now 01248f0)

This is an automated email from the ASF dual-hosted git repository.

hoshea pushed a change to branch verifier
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git.


      at 01248f0  Implement the verify of actual data file

This branch includes the following new commits:

     new 5dd520b  merge poc and resolve conflicts
     new 0973484  move precheck to setup
     new c1f23bd  Implement the verify of actual data file
     new 01248f0  Implement the verify of actual data file

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking-infra-e2e] 01/04: merge poc and resolve conflicts

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hoshea pushed a commit to branch verifier
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 5dd520b0e67babe45dfff612b1470803924f85a4
Merge: eccd48c 7c64325
Author: Hoshea <fg...@gmail.com>
AuthorDate: Fri Feb 5 10:51:13 2021 +0800

    merge poc and resolve conflicts

 .golangci.yml                        |    2 +
 .licenserc.yaml                      |    1 +
 Makefile                             |    4 +-
 go.mod                               |    2 +
 test.go                              |  142 +++++
 third-party/internal/fmtsort/sort.go |  220 +++++++
 third-party/template/exec.go         | 1079 ++++++++++++++++++++++++++++++++++
 third-party/template/funcs.go        |  769 ++++++++++++++++++++++++
 third-party/template/helper.go       |  130 ++++
 third-party/template/option.go       |   74 +++
 third-party/template/parse/lex.go    |  667 +++++++++++++++++++++
 third-party/template/parse/node.go   |  957 ++++++++++++++++++++++++++++++
 third-party/template/parse/parse.go  |  740 +++++++++++++++++++++++
 third-party/template/template.go     |  229 ++++++++
 14 files changed, 5014 insertions(+), 2 deletions(-)

diff --cc .golangci.yml
index 4535951,4535951..617deaf
--- a/.golangci.yml
+++ b/.golangci.yml
@@@ -18,6 -18,6 +18,8 @@@
  
  run:
    tests: false
++  skip-dirs:
++    - third-party
  
  linters-settings:
    govet:
diff --cc .licenserc.yaml
index 45f9a41,45f9a41..9c7b73f
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@@ -69,5 -69,5 +69,6 @@@ header: # `header` section is configura
      - '**/go.sum'
      - 'LICENSE'
      - 'NOTICE'
++    - 'third-party'
  
    comment: on-failure # on what condition license-eye will comment on the pull request, `on-failure`, `always`, `never`.
diff --cc Makefile
index c1db858,09c0fc8..1eee4be
--- a/Makefile
+++ b/Makefile
@@@ -36,7 -36,7 +36,7 @@@ ARCH = amd6
  RELEASE_BIN = skywalking-$(PROJECT)-$(VERSION)-bin
  RELEASE_SRC = skywalking-$(PROJECT)-$(VERSION)-src
  
--all: clean lint license test build
++all: clean lint test build
  
  .PHONY: lint
  lint:
@@@ -68,7 -68,7 +68,7 @@@ clean
  	-rm -rf "$(RELEASE_SRC)"*
  
  .PHONY: verify
--verify: clean license lint test
++verify: clean lint test
  
  release-src: clean
  	-mkdir $(RELEASE_SRC)
diff --cc go.mod
index 30c2d57,6e50f12..1430167
--- a/go.mod
+++ b/go.mod
@@@ -3,23 -3,11 +3,25 @@@ module github.com/apache/skywalking-inf
  go 1.13
  
  require (
 +	github.com/Microsoft/go-winio v0.4.16 // indirect
 +	github.com/containerd/containerd v1.4.3 // indirect
 +	github.com/docker/docker v20.10.3+incompatible
 +	github.com/docker/go-connections v0.4.0 // indirect
 +	github.com/docker/go-units v0.4.0 // indirect
+ 	github.com/google/go-cmp v0.4.0
 +	github.com/gorilla/mux v1.8.0 // indirect
 +	github.com/imdario/mergo v0.3.11 // indirect
 +	github.com/morikuni/aec v1.0.0 // indirect
 +	github.com/opencontainers/image-spec v1.0.1 // indirect
  	github.com/sirupsen/logrus v1.7.0
  	github.com/spf13/cobra v1.1.1
  	gopkg.in/yaml.v2 v2.3.0
+ 	gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
 -	k8s.io/apimachinery v0.19.0 // indirect
 +	k8s.io/api v0.19.0
 +	k8s.io/apimachinery v0.19.0
 +	k8s.io/cli-runtime v0.19.0
 +	k8s.io/client-go v0.19.0
 +	k8s.io/kubectl v0.19.0
 +	k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
  	sigs.k8s.io/kind v0.9.0
  )


[skywalking-infra-e2e] 02/04: move precheck to setup

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hoshea pushed a commit to branch verifier
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 09734846fa148887114b0d1af64db5b83f3332cd
Author: Hoshea <fg...@gmail.com>
AuthorDate: Fri Feb 5 22:30:31 2021 +0800

    move precheck to setup
---
 commands/root.go        | 17 -----------------
 commands/setup/setup.go | 19 +++++++++++++++----
 2 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/commands/root.go b/commands/root.go
index 3843d61..eff9b6c 100644
--- a/commands/root.go
+++ b/commands/root.go
@@ -20,11 +20,6 @@ package commands
 import (
 	"github.com/spf13/cobra"
 
-	"github.com/apache/skywalking-infra-e2e/internal/util"
-
-	"github.com/apache/skywalking-infra-e2e/internal/config"
-	"github.com/apache/skywalking-infra-e2e/internal/constant"
-
 	"github.com/apache/skywalking-infra-e2e/commands/cleanup"
 	"github.com/apache/skywalking-infra-e2e/commands/run"
 	"github.com/apache/skywalking-infra-e2e/commands/setup"
@@ -39,18 +34,6 @@ var Root = &cobra.Command{
 	Version:       version,
 	SilenceErrors: true,
 	SilenceUsage:  true,
-	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
-		err := util.CheckDockerDaemon()
-		if err != nil {
-			return err
-		}
-
-		err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
-		if err != nil {
-			return err
-		}
-		return nil
-	},
 }
 
 // Execute adds all child commands to the root command and sets flags appropriately.
diff --git a/commands/setup/setup.go b/commands/setup/setup.go
index b1f9f7c..92874d4 100644
--- a/commands/setup/setup.go
+++ b/commands/setup/setup.go
@@ -21,19 +21,30 @@ package setup
 import (
 	"fmt"
 
+	"github.com/apache/skywalking-infra-e2e/internal/components/setup"
 	"github.com/apache/skywalking-infra-e2e/internal/config"
-
 	"github.com/apache/skywalking-infra-e2e/internal/constant"
+	"github.com/apache/skywalking-infra-e2e/internal/logger"
+	"github.com/apache/skywalking-infra-e2e/internal/util"
 
 	"github.com/spf13/cobra"
-
-	"github.com/apache/skywalking-infra-e2e/internal/components/setup"
-	"github.com/apache/skywalking-infra-e2e/internal/logger"
 )
 
 var Setup = &cobra.Command{
 	Use:   "setup",
 	Short: "",
+	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
+		err := util.CheckDockerDaemon()
+		if err != nil {
+			return err
+		}
+
+		err = config.ReadGlobalConfigFile(constant.E2EDefaultFile)
+		if err != nil {
+			return err
+		}
+		return nil
+	},
 	RunE: func(cmd *cobra.Command, args []string) error {
 		err := setupAccordingE2E()
 		if err != nil {


[skywalking-infra-e2e] 04/04: Implement the verify of actual data file

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hoshea pushed a commit to branch verifier
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 01248f06e642fcd8b3d8d28eec48451c37f92251
Author: Hoshea <fg...@gmail.com>
AuthorDate: Sat Feb 6 20:56:25 2021 +0800

    Implement the verify of actual data file
---
 commands/verify/verify.go                | 1 +
 internal/components/verifier/verifier.go | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/commands/verify/verify.go b/commands/verify/verify.go
index 06b908b..f178015 100644
--- a/commands/verify/verify.go
+++ b/commands/verify/verify.go
@@ -19,6 +19,7 @@ package verify
 
 import (
 	"fmt"
+
 	"github.com/apache/skywalking-infra-e2e/internal/components/verifier"
 
 	"github.com/spf13/cobra"
diff --git a/internal/components/verifier/verifier.go b/internal/components/verifier/verifier.go
index 4c46263..0c095ca 100644
--- a/internal/components/verifier/verifier.go
+++ b/internal/components/verifier/verifier.go
@@ -81,9 +81,8 @@ func verify(actualData, expectedTemplate string) error {
 		diff := cmp.Diff(expected, actual)
 		fmt.Println(diff)
 		return &MismatchError{}
-	} else {
-		logger.Log.Info("the actual data matches the expected data")
 	}
 
+	logger.Log.Info("the actual data matches the expected data")
 	return nil
 }


[skywalking-infra-e2e] 03/04: Implement the verify of actual data file

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hoshea pushed a commit to branch verifier
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit c1f23bd9b8daaf6b0d52327ea3387260a5c154e2
Author: Hoshea <fg...@gmail.com>
AuthorDate: Sat Feb 6 20:54:59 2021 +0800

    Implement the verify of actual data file
---
 commands/verify/verify.go                |  18 +++-
 internal/components/verifier/funcs.go    |  54 ++++++++++++
 internal/components/verifier/verifier.go |  89 +++++++++++++++++++
 internal/config/e2eConfig.go             |   9 +-
 internal/util/utils.go                   |  14 +++
 test.go                                  | 142 -------------------------------
 test/verify/1.actual.yaml                |  24 ++++++
 test/verify/1.expected.yaml              |  24 ++++++
 8 files changed, 230 insertions(+), 144 deletions(-)

diff --git a/commands/verify/verify.go b/commands/verify/verify.go
index 34c122c..06b908b 100644
--- a/commands/verify/verify.go
+++ b/commands/verify/verify.go
@@ -19,14 +19,30 @@ package verify
 
 import (
 	"fmt"
+	"github.com/apache/skywalking-infra-e2e/internal/components/verifier"
 
 	"github.com/spf13/cobra"
 )
 
+var (
+	query    string
+	actual   string
+	expected string
+)
+
+func init() {
+	Verify.Flags().StringVarP(&query, "query", "q", "", "the query to get the actual data, the result of the query should in YAML format")
+	Verify.Flags().StringVarP(&actual, "actual", "a", "", "the actual data file, only YAML file format is supported")
+	Verify.Flags().StringVarP(&expected, "expected", "e", "", "the expected data file, only YAML file format is supported")
+}
+
 var Verify = &cobra.Command{
 	Use:   "verify",
-	Short: "",
+	Short: "verify if the actual data match the expected data",
 	RunE: func(cmd *cobra.Command, args []string) error {
+		if actual != "" && expected != "" {
+			return verifier.VerifyDataFile(actual, expected)
+		}
 		fmt.Println("Not implemented.")
 		return nil
 	},
diff --git a/internal/components/verifier/funcs.go b/internal/components/verifier/funcs.go
new file mode 100644
index 0000000..597bb89
--- /dev/null
+++ b/internal/components/verifier/funcs.go
@@ -0,0 +1,54 @@
+package verifier
+
+import (
+	"encoding/base64"
+	"fmt"
+	"regexp"
+	"strings"
+
+	"github.com/apache/skywalking-infra-e2e/third-party/template"
+)
+
+// funcMap produces the custom function map.
+// Use this to pass the functions into the template engine:
+// 	tpl := template.New("foo").Funcs(funcMap()))
+func funcMap() template.FuncMap {
+	fm := make(map[string]interface{}, len(customFuncMap))
+	for k, v := range customFuncMap {
+		fm[k] = v
+	}
+	return template.FuncMap(fm)
+}
+
+var customFuncMap = map[string]interface{}{
+	// Basic:
+	"notEmpty": notEmpty,
+
+	// Encoding:
+	"b64enc": base64encode,
+
+	// Regex:
+	"regexp": regexpMatch,
+}
+
+func base64encode(s string) string {
+	return base64.StdEncoding.EncodeToString([]byte(s))
+}
+
+func notEmpty(s string) string {
+	if len(strings.TrimSpace(s)) > 0 {
+		return s
+	}
+	return fmt.Sprintf(`<"%s" is empty, wanted is not empty>`, s)
+}
+
+func regexpMatch(s, pattern string) string {
+	matched, err := regexp.MatchString(pattern, s)
+	if err != nil {
+		return fmt.Sprintf(`<"%s">`, err)
+	}
+	if !matched {
+		return fmt.Sprintf(`<"%s" does not match the pattern %s">`, s, pattern)
+	}
+	return s
+}
diff --git a/internal/components/verifier/verifier.go b/internal/components/verifier/verifier.go
new file mode 100644
index 0000000..4c46263
--- /dev/null
+++ b/internal/components/verifier/verifier.go
@@ -0,0 +1,89 @@
+package verifier
+
+import (
+	"bytes"
+	"errors"
+	"fmt"
+
+	"github.com/apache/skywalking-infra-e2e/internal/logger"
+	"github.com/apache/skywalking-infra-e2e/internal/util"
+	"github.com/apache/skywalking-infra-e2e/third-party/template"
+
+	"github.com/google/go-cmp/cmp"
+	"gopkg.in/yaml.v2"
+)
+
+// MismatchError is the error type returned by the verify functions.
+// Then the caller will know if there is a mismatch.
+type MismatchError struct {
+	Err error
+}
+
+func (e *MismatchError) Unwrap() error { return e.Err }
+
+func (e *MismatchError) Error() string {
+	if e == nil {
+		return "<nil>"
+	}
+	return "the actual data does not match the expected data"
+}
+
+// VerifyDataFile reads the actual data from the file and verifies.
+func VerifyDataFile(actualFile, expectedFile string) error {
+	actualData, err := util.ReadFileContent(actualFile)
+	if err != nil {
+		logger.Log.Error("failed to read the actual data file")
+		return err
+	}
+
+	expectedTemplate, err := util.ReadFileContent(expectedFile)
+	if err != nil {
+		logger.Log.Error("failed to read the expected data file")
+		return err
+	}
+
+	return verify(actualData, expectedTemplate)
+}
+
+// VerifyQuery gets the actual data from the query and then verifies.
+func VerifyQuery(query, expectedFile string) error {
+	return errors.New("not implemented")
+}
+
+// verify checks if the actual data match the expected template.
+// It will print the diff if the actual data does not match.
+func verify(actualData, expectedTemplate string) error {
+	var actual interface{}
+	if err := yaml.Unmarshal([]byte(actualData), &actual); err != nil {
+		logger.Log.Error("failed to unmarshal actual data")
+		return err
+	}
+
+	tmpl, err := template.New("test").Funcs(funcMap()).Parse(expectedTemplate)
+	if err != nil {
+		logger.Log.Error("failed to parse template")
+		return err
+	}
+
+	var b bytes.Buffer
+	if err := tmpl.Execute(&b, actual); err != nil {
+		logger.Log.Error("failed to execute template")
+		return err
+	}
+
+	var expected interface{}
+	if err := yaml.Unmarshal(b.Bytes(), &expected); err != nil {
+		logger.Log.Error("failed to unmarshal expected data")
+		return err
+	}
+
+	if !cmp.Equal(expected, actual) {
+		diff := cmp.Diff(expected, actual)
+		fmt.Println(diff)
+		return &MismatchError{}
+	} else {
+		logger.Log.Info("the actual data matches the expected data")
+	}
+
+	return nil
+}
diff --git a/internal/config/e2eConfig.go b/internal/config/e2eConfig.go
index 836e582..c242947 100644
--- a/internal/config/e2eConfig.go
+++ b/internal/config/e2eConfig.go
@@ -20,7 +20,8 @@ package config
 
 // E2EConfig corresponds to configuration file e2e.yaml.
 type E2EConfig struct {
-	Setup Setup `yaml:"setup"`
+	Setup  Setup        `yaml:"setup"`
+	Verify []VerifyCase `yaml:"verify"`
 }
 
 type Setup struct {
@@ -48,3 +49,9 @@ type Wait struct {
 	LabelSelector string `yaml:"label-selector"`
 	For           string `yaml:"for"`
 }
+
+type VerifyCase struct {
+	Query    string `yaml:"query"`
+	Actual   string `yaml:"actual"`
+	Expected string `yaml:"expected"`
+}
diff --git a/internal/util/utils.go b/internal/util/utils.go
index 50030d7..0c2a2f0 100644
--- a/internal/util/utils.go
+++ b/internal/util/utils.go
@@ -19,6 +19,8 @@
 package util
 
 import (
+	"errors"
+	"io/ioutil"
 	"os"
 	"os/exec"
 )
@@ -38,3 +40,15 @@ func PathExist(_path string) bool {
 	}
 	return true
 }
+
+// ReadFileContent reads the file content.
+func ReadFileContent(filename string) (string, error) {
+	if PathExist(filename) {
+		content, err := ioutil.ReadFile(filename)
+		if err != nil {
+			return "", err
+		}
+		return string(content), nil
+	}
+	return "", errors.New("the file does not exist")
+}
diff --git a/test.go b/test.go
deleted file mode 100644
index cbdfe8e..0000000
--- a/test.go
+++ /dev/null
@@ -1,142 +0,0 @@
-package main
-
-import (
-	"bytes"
-	"encoding/base64"
-	"fmt"
-	"github.com/apache/skywalking-infra-e2e/third-party/template"
-	"github.com/google/go-cmp/cmp"
-	"gopkg.in/yaml.v3"
-	"log"
-	"strings"
-)
-
-var funcMap = template.FuncMap{
-	"b64enc": func(s string) string {
-		return base64.StdEncoding.EncodeToString([]byte(s))
-	},
-	"notEmpty": func(s string) string {
-		if len(strings.TrimSpace(s)) > 0 {
-			return s
-		} else {
-			return fmt.Sprintf(`<"%s" is empty, wanted is not empty>`, s)
-		}
-	},
-}
-
-func main() {
-	test(`
-nodes:
-  - id: VXNlcg==.0
-    name: User
-    type: USER
-    isReal: false
-  - id: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
-    name: Your_ApplicationName
-    type: Tomcat
-    isReal: true
-  - id: bG9jYWxob3N0Oi0x.0
-    name: localhost:-1
-    type: H2
-    isReal: false
-calls:
-  - id: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1-bG9jYWxob3N0Oi0x.0
-    source: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
-    detectPoints:
-      - CLIENT
-    target: bG9jYWxob3N0Oi0x.0
-  - id: VXNlcg==.0-WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
-    source: VXNlcg==.0
-    detectPoints:
-      - SERVER
-    target: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
-`, `
-nodes:
-  - id: {{ b64enc "User" }}.0
-    name: User
-    type: USER
-    isReal: false
-  - id: {{ b64enc "Your_ApplicationName" }}.1
-    name: Your_ApplicationName
-    type: Tomcat
-    isReal: true
-  - id: {{ $h2ID := (index .nodes 2).id }}{{ notEmpty $h2ID }}
-    name: localhost:-1
-    type: H2
-    isReal: false
-calls:
-  - id: {{ notEmpty (index .calls 0).id }}
-    source: {{ b64enc "Your_ApplicationName" }}.1
-    target: {{ $h2ID }}
-    detectPoints:
-      - CLIENT
-  - id: {{ b64enc "User" }}.0-{{ b64enc "Your_ApplicationName" }}.1
-    source: {{ b64enc "User" }}.0
-    target: {{ b64enc "Your_ApplicationName" }}.1
-    detectPoints:
-      - SERVER
-`)
-
-	test(`
-metrics:
-  - name: business-zone::projectA
-    id: YnVzaW5lc3Mtem9uZTo6cHJvamVjdEE=.1
-    value: 1
-  - name: system::load balancer1
-    id: c3lzdGVtOjpsb2FkIGJhbGFuY2VyMQ==.1
-    value: 0
-  - name: system::load balancer2
-    id: c3lzdGVtOjpsb2FkIGJhbGFuY2VyMg==.1
-    value: 0
-`, `
-metrics:
-{{- atLeastOnce .metrics }}
-  name: {{ notEmpty .name }}
-  id: {{ notEmpty .id }}
-  value: {{ gt .value 0 }}
-{{- end }}
-`)
-	test(`
-metrics:
-  - name: business-zone::projectA
-    id: YnVzaW5lc3Mtem9uZTo6cHJvamVjdEE=.1
-    value: 0
-  - name: system::load balancer1
-    id: c3lzdGVtOjpsb2FkIGJhbGFuY2VyMQ==.1
-    value: 0
-  - name: system::load balancer2
-    id: c3lzdGVtOjpsb2FkIGJhbGFuY2VyMg==.1
-    value: 0
-`, `
-metrics:
-{{- atLeastOnce .metrics }}
-  name: {{ notEmpty .name }}
-  id: {{ notEmpty .id }}
-  value: {{ gt .value 0 }}
-{{- end }}
-`)
-}
-
-func test(actualData string, expectedTemplate string) {
-	var actual interface{}
-	yaml.Unmarshal([]byte(actualData), &actual)
-
-	tmpl, err := template.New("test").Funcs(funcMap).Parse(expectedTemplate)
-	if err != nil {
-		log.Fatalf("parsing: %s", err)
-	}
-
-	var b bytes.Buffer
-	err = tmpl.Execute(&b, actual)
-	if err != nil {
-		log.Fatalf("execution: %s", err)
-	}
-
-	var expected interface{}
-	yaml.Unmarshal(b.Bytes(), &expected)
-
-	if !cmp.Equal(expected, actual) {
-		diff := cmp.Diff(expected, actual)
-		println(diff)
-	}
-}
diff --git a/test/verify/1.actual.yaml b/test/verify/1.actual.yaml
new file mode 100644
index 0000000..1e3d89d
--- /dev/null
+++ b/test/verify/1.actual.yaml
@@ -0,0 +1,24 @@
+nodes:
+  - id: VXNlcg==.0
+    name: User
+    type: USER
+    isReal: false
+  - id: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
+    name: Your_ApplicationName
+    type: Tomcat
+    isReal: true
+  - id: bG9jYWxob3N0Oi0x.0
+    name: localhost:-1
+    type: H2
+    isReal: false
+calls:
+  - id: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1-bG9jYWxob3N0Oi0x.0
+    source: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
+    detectPoints:
+      - CLIENT
+    target: bG9jYWxob3N0Oi0x.0
+  - id: VXNlcg==.0-WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
+    source: VXNlcg==.0
+    detectPoints:
+      - SERVER
+    target: WW91cl9BcHBsaWNhdGlvbk5hbWU=.1
\ No newline at end of file
diff --git a/test/verify/1.expected.yaml b/test/verify/1.expected.yaml
new file mode 100644
index 0000000..23b8076
--- /dev/null
+++ b/test/verify/1.expected.yaml
@@ -0,0 +1,24 @@
+nodes:
+  - id: {{ b64enc "User" }}.0
+    name: User
+    type: USER
+    isReal: false
+  - id: {{ b64enc "Your_ApplicationName" }}.1
+    name: Your_ApplicationName
+    type: Tomcat
+    isReal: true
+  - id: {{ $h2ID := (index .nodes 2).id }}{{ notEmpty $h2ID }}
+    name: localhost:-1
+    type: H2
+    isReal: false
+calls:
+  - id: {{ notEmpty (index .calls 0).id }}
+    source: {{ b64enc "Your_ApplicationName" }}.1
+    target: {{ $h2ID }}
+    detectPoints:
+      - CLIENT
+  - id: {{ b64enc "User" }}.0-{{ b64enc "Your_ApplicationName" }}.1
+    source: {{ b64enc "User" }}.0
+    target: {{ b64enc "Your_ApplicationName" }}.1
+    detectPoints:
+      - SERVER
\ No newline at end of file