Duncan-tree-zhou commented on PR #66:
URL: https://github.com/apache/skywalking-swck/pull/66#issuecomment-1229451607

   Hi @dashanji 
   
   I got a problem adding verifying on optional plugin.
   
   i can use the following scripts to generate a yaml 
   
   ``` bash
   kubectl logs -l app=demo -n skywalking-system --tail=-1 | grep -Eo 
"AgentClassLoader.*webflux.*\.jar loaded" | grep -Eo 
"/sky/agent/plugins/.*webflux.*\.jar" | jq -R -s -c "split(\"\n\")[:-1]" |  yq 
e 'to_entries'
   ```
   
   and i can get the results:
   
   ``` yaml
   - key: 0
     value: 
"/sky/agent/plugins/apm-spring-webflux-5.x-plugin-8.12.0-SNAPSHOT.jar"
   - key: 1
     value: 
"/sky/agent/plugins/spring-webflux-5.x-webclient-plugin-8.12.0-SNAPSHOT.jar"
   ```
   
   so i make a validate file to verify the output:
   
   ```
   {{- contains . }}
   value: {{ notEmpty .value }}
   {{- end }}
   ```
   In e2e test, the scripts should be translation to:
   
   ``` bash
   'kubectl logs -l app=demo -n skywalking-system --tail=-1 | grep -Eo 
"AgentClassLoader.*webflux.*\.jar loaded" | grep -Eo 
"/sky/agent/plugins/.*webflux.*\.jar" | jq -R -s -c "split(\"\n\")[:-1]" |  yq 
e ''to_entries'''
   ```
   
   but i still get error in my repo in the case:
   
   ```
   ......
   ......
   INFO verified the output: swctl --display yaml 
--base-url=http://${service_skywalking_system_oap_host}:${service_skywalking_system_oap_12800}/graphql
 metrics linear --name endpoint_cpm --endpoint-name GET:/hello --service-name 
Your_ApplicationName | yq e 'to_entries' - 
   INFO verified the output: kubectl get pods -l app=demo -o yaml | yq e 
'.items[0].spec.volumes' 
   INFO verified the output: kubectl get pods -l app=demo -o yaml | yq e 
'.items[0].spec.initContainers[0]' 
   INFO verified the output: kubectl get pods -l app=demo -o yaml | yq e 
'.items[0].spec.containers[0]' 
   ERROR failed to unmarshal index: 0, yaml: unmarshal errors:
     line 2: cannot unmarshal !!map into []interface {} 
   ERROR failed to unmarshal index: 1, yaml: unmarshal errors:
     line 2: cannot unmarshal !!map into []interface {} 
   INFO deleting kind cluster...                     
   Deleting cluster "kind" ...
   INFO delete kind cluster succeeded                
   INFO deleting k8s cluster config file:/tmp/e2e-k8s.config 
   INFO cleanup part finished successfully           
   panic: bytes: negative Repeat count [recovered]
        panic: bytes: negative Repeat count
   
   goroutine 1 [running]:
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.errRecover(0xc000841870)
        /e2e/third-party/go/template/exec.go:174 +0x1c5
   panic(0x2290e00, 0x27ddb90)
        /usr/local/go/src/runtime/panic.go:965 +0x1b9
   bytes.Repeat(...)
        
/usr/local/go/src/bytes/bytes.go:[596](https://github.com/Duncan-tree-zhou/skywalking-swck/runs/8047613983?check_suite_focus=true#step:4:600)
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*state).walkContains.func2(0xc00000af00,
 0xb4, 0x100, 0xffffffffffffffff, 0xffffffffffffffff, 0x0, 0x0)
        /e2e/third-party/go/template/exec.go:460 +0x3e8
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*state).walkContains(0xc0008417e0,
 0x224a420, 0xc00057e348, 0x97, 0xc000a54340)
        /e2e/third-party/go/template/exec.go:473 +0xabf
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*state).walk(0xc0008417e0,
 0x224a420, 0xc00057e348, 0x97, 0x28477e0, 0xc000a54340)
        /e2e/third-party/go/template/exec.go:281 +0x4b1
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*state).walk(0xc0008417e0,
 0x224a420, 0xc00057e348, 0x97, 0x2847948, 0xc0002bb800)
        /e2e/third-party/go/template/exec.go:268 +0x13c
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*Template).execute(0xc000a54180,
 0x2800a80, 0xc0002bbad0, 0x224a420, 0xc00057e348, 0x0, 0x0)
        /e2e/third-party/go/template/exec.go:225 +0x1c6
   
github.com/apache/skywalking-infra-e2e/third-party/go/template.(*Template).Execute(...)
        /e2e/third-party/go/template/exec.go:208
   
github.com/apache/skywalking-infra-e2e/internal/components/verifier.Verify(0xc00097[600](https://github.com/Duncan-tree-zhou/skywalking-swck/runs/8047613983?check_suite_focus=true#step:4:604)0,
 0xb8, 0xc00077d880, 0x347, 0xc000043a00, 0x3e)
        /e2e/internal/components/verifier/verifier.go:59 +0x2c7
   
github.com/apache/skywalking-infra-e2e/commands/verify.verifySingleCase(0xc000103560,
 0x56, 0x0, 0x0, 0xc0001b0380, 0xd5, 0x0, 0x0)
        /e2e/commands/verify/verify.go:77 +0x154
   
github.com/apache/skywalking-infra-e2e/commands/verify.DoVerifyAccordingConfig(0xc00013e070,
 0xc000000004)
        /e2e/commands/verify/verify.go:109 +0x211
   github.com/apache/skywalking-infra-e2e/commands/run.runAccordingE2E(0x0, 0x0)
        /e2e/commands/run/run.go:100 +0x445
   github.com/apache/skywalking-infra-e2e/commands/run.glob..func1(0x33cb740, 
0xc00012a900, 0x0, 0x6, 0x0, 0x0)
        /e2e/commands/run/run.go:37 +0x25
   github.com/spf13/cobra.(*Command).execute(0x33cb740, 0xc00012a8a0, 0x6, 0x6, 
0x33cb740, 0xc00012a8a0)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x472
   github.com/spf13/cobra.(*Command).ExecuteC(0x33cb240, 0x34869b0, 0x25a8dec, 
0x6)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
   github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:902
   github.com/apache/skywalking-infra-e2e/commands.Execute(0xc01a25, 
0xc000102058)
        /e2e/commands/root.go:98 +0x395
   main.main()
        /e2e/cmd/main.go:28 +0x26
   Error: Process completed with exit code 2.
   ......
   ......
   ```
   
   do you have any good ideas about verifying the option plugins?
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to