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

shenyi pushed a commit to branch test-autorun
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit d561931f605aa0f8e762211175ff3683cc88cb43
Author: pissang <bm2736...@gmail.com>
AuthorDate: Wed Sep 11 16:49:09 2019 +0800

    test: add more run options.
---
 test/runTest/client/client.js  | 44 ++++++++++++++++++++++++++++--------------
 test/runTest/client/index.html |  7 ++++---
 2 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/test/runTest/client/client.js b/test/runTest/client/client.js
index 2cd0563..7f644ed 100644
--- a/test/runTest/client/client.js
+++ b/test/runTest/client/client.js
@@ -109,6 +109,22 @@ const app = new Vue({
             }).sort(sortFunc);
         },
 
+        selectedTests() {
+            return this.fullTests.filter(test => {
+                return test.selected;
+            });
+        },
+        unfinishedTests() {
+            return this.fullTests.filter(test => {
+                return test.status !== 'finished';
+            });
+        },
+        failedTests() {
+            return this.fullTests.filter(test => {
+                return test.status === 'finished' && test.summary !== 
'success';
+            });
+        },
+
         currentTest() {
             let currentTest = this.fullTests.find(item => item.name === 
this.currentTestName);
             if (!currentTest) {
@@ -171,20 +187,20 @@ const app = new Vue({
             runTests([testName]);
         },
         run(runTarget) {
-            const tests = this.fullTests.filter(test => {
-                if (runTarget === 'selected') {
-                    return test.selected;
-                }
-                else if (runTarget === 'unfinished') {
-                    return test.status !== 'finished';
-                }
-                else {  // Run all
-                    return true;
-                }
-            }).map(test => {
-                return test.name;
-            });
-            runTests(tests);
+            let tests;
+            if (runTarget === 'selected') {
+                tests = this.selectedTests;
+            }
+            else if (runTarget === 'unfinished') {
+                tests = this.unfinishedTests;
+            }
+            else if (runTarget === 'failed') {
+                tests = this.failedTests;
+            }
+            else {
+                tests = this.fullTests;
+            }
+            runTests(tests.map(test => test.name));
         },
         stopTests() {
             this.running = false;
diff --git a/test/runTest/client/index.html b/test/runTest/client/index.html
index 64c2eba..8706c33 100644
--- a/test/runTest/client/index.html
+++ b/test/runTest/client/index.html
@@ -46,10 +46,11 @@ under the License.
                             @click="run('selected')"
                             @command="run"
                         >
-                            <i class="el-icon-caret-right"></i> Run selected
+                            <i class="el-icon-caret-right"></i> Run selected 
({{selectedTests.length}})
                             <el-dropdown-menu slot="dropdown" >
-                                <el-dropdown-item command="unfinished">Run 
unfinished</el-dropdown-item>
-                                <el-dropdown-item command="all">Run 
all</el-dropdown-item>
+                                <el-dropdown-item command="unfinished">Run 
unfinished ({{unfinishedTests.length}})</el-dropdown-item>
+                                <el-dropdown-item command="failed">Run failed 
({{failedTests.length}})</el-dropdown-item>
+                                <el-dropdown-item command="all">Run all 
({{fullTests.length}})</el-dropdown-item>
                             </el-dropdown-menu>
                         </el-dropdown>
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to