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/20 13:36:02 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #6409: Supplement the E2E test for skywalking-client-js

kezhenxu94 commented on a change in pull request #6409:
URL: https://github.com/apache/skywalking/pull/6409#discussion_r579652301



##########
File path: .github/workflows/e2e.js.yaml
##########
@@ -60,3 +60,30 @@ jobs:
         with:
           name: logs
           path: logs
+  JavaScriptClientWithRealAgent:
+    name: Java Script Client With Real Agent
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodules: true
+      - name: Set Skip Env Var
+        uses: ./.github/actions/skip
+      - name: Cache local Maven repository
+        if: env.SKIP_CI != 'true'
+        uses: actions/cache@v2
+        with:
+          path: ~/.m2/repository
+          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          restore-keys: |
+            ${{ runner.os }}-maven-
+      - name: Run E2E Test
+        if: env.SKIP_CI != 'true'
+        uses: ./.github/actions/e2e-test
+        with:
+          test_class: org.apache.skywalking.e2e.browser.BrowserWithClientJSE2E
+      - uses: actions/upload-artifact@v1
+        if: failure()
+        with:
+          name: logs
+          path: logs

Review comment:
       If you don't print the logs into the `logs` directory (seems to be the case), this step makes no sense

##########
File path: test/e2e/e2e-test/docker/browser/with-skywalking-client-js/index.js
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// import ClientMonitor from '../node_modules/skywalking-client-js/src/index';

Review comment:
       ```suggestion
   
   ```

##########
File path: test/e2e/e2e-test/docker/browser/with-skywalking-client-js/index.js
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// import ClientMonitor from '../node_modules/skywalking-client-js/src/index';
+import ClientMonitor from 'skywalking-client-js';
+import Vue from 'vue';
+
+ClientMonitor.register({
+    service: 'test-ui',
+    pagePath: 'index.html',
+    serviceVersion: 'v1.0.0',
+    vue: Vue,
+    useFmp: true
+});
+
+// vue error
+new Vue({
+    data: {
+        name: "chen",
+        age: 18,
+        message: "--------------------------------",
+        src3: "https://pic.xiaohuochai.site/blog/chromePerformance2_error.png",
+        src4: "",

Review comment:
       Seems these are not used but increase confusion 

##########
File path: test/e2e/e2e-test/docker/browser/with-skywalking-client-js/index.js
##########
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+// import ClientMonitor from '../node_modules/skywalking-client-js/src/index';
+import ClientMonitor from 'skywalking-client-js';
+import Vue from 'vue';
+
+ClientMonitor.register({
+    service: 'test-ui',
+    pagePath: 'index.html',
+    serviceVersion: 'v1.0.0',
+    vue: Vue,
+    useFmp: true
+});
+
+// vue error
+new Vue({
+    data: {
+        name: "chen",
+        age: 18,
+        message: "--------------------------------",
+        src3: "https://pic.xiaohuochai.site/blog/chromePerformance2_error.png",
+        src4: "",
+    },
+    methods: {
+        async click() {
+            this.name = 'click'
+            await timeout();
+        },
+        async click1() {
+            this.name = 'click1'
+            throw {msg: 'async function error', status: 1000};
+        },
+        test() {
+            throw {
+                msg: 'vue error',
+                status: 3000
+            }
+        }
+    },
+    created() {
+        this.click1();
+        this.test();

Review comment:
       Here you throw 2 errors, why are there only one in the expected data?




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