You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/05/03 05:31:37 UTC
[1/2] incubator-weex git commit: * [test] comment junit result to PR
Repository: incubator-weex
Updated Branches:
refs/heads/0.13-dev b36852d18 -> 9e93fc656
* [test] comment junit result to PR
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/8090f41b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/8090f41b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/8090f41b
Branch: refs/heads/0.13-dev
Commit: 8090f41bdd1c4d7d8b65d377ba839e0f3b54d0c7
Parents: 0c50691
Author: sospartan <so...@apache.org>
Authored: Tue May 2 16:54:30 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed May 3 13:29:00 2017 +0800
----------------------------------------------------------------------
.travis.yml | 5 +++
android/run-ci.sh | 2 +-
dangerfile-junit.js | 80 ++++++++++++++++++++++++++++++++++++++++++++++++
dangerfile.js | 4 +--
package.json | 7 +++--
5 files changed, 92 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8090f41b/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 4d64a45..ae8d3fe 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -49,10 +49,15 @@ matrix:
- extra-google-m2repository
- extra-android-m2repository
- sys-img-armeabi-v7a-android-22
+ before_script:
+ - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
+ - nvm install 7.0
+ - npm install
script:
- cd android
- ./run-ci.sh
- cd $TRAVIS_BUILD_DIR
+ - npm run danger:junit
cache:
directories:
- node_modules
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8090f41b/android/run-ci.sh
----------------------------------------------------------------------
diff --git a/android/run-ci.sh b/android/run-ci.sh
index fae4e74..930fffd 100755
--- a/android/run-ci.sh
+++ b/android/run-ci.sh
@@ -1,4 +1,4 @@
-# !/bin/sh -eu
+# will not exist if err
cd playground
./gradlew assembleDebug :weex_sdk:testDebugUnitTest --info -PdisableCov=true -PtargetSDK=19 -Dorg.gradle.daemon=true -Dorg.gradle.parallel=true -Dorg.gradle.jvmargs="-Xmx512m -XX:+HeapDumpOnOutOfMemoryError" -Dfile.encoding=UTF-8
COLUMNS=2000 ps -m -o pid,rss,command > ../sdk/build/reports/memdump.txt
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8090f41b/dangerfile-junit.js
----------------------------------------------------------------------
diff --git a/dangerfile-junit.js b/dangerfile-junit.js
new file mode 100644
index 0000000..b6d9229
--- /dev/null
+++ b/dangerfile-junit.js
@@ -0,0 +1,80 @@
+/*
+ * 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 { danger, fail, warn } from "danger";
+import { DOMParser } from "xmldom";
+import fs from "fs";
+import path from "path";
+
+const TEST_RESULT_FOLDER = "android/sdk/build/test-results/debug";
+
+const processReports = folder => {
+ var failureCases = [];
+ fs.readdirSync(folder).forEach(file => {
+ const content = fs.readFileSync(path.resolve(folder, file)).toString();
+ let doc = new DOMParser().parseFromString(content, "text/xml");
+ let length = doc.childNodes.length;
+ for (let i = 0; i < length; i++) {
+ let node = doc.childNodes.item(i);
+ if (node.tagName == "testsuite") {
+ let suiteData = parseSuite(node);
+ if (Number.parseInt(suiteData.failures) > 0) {
+ suiteData.testcases.forEach(testcase => {
+ fail(
+ `${suiteData.name}/${testcase.name}:\n\n\n ${testcase.failure}`
+ );
+ });
+ }
+ }
+ }
+ });
+};
+
+const parseCase = testcase => {
+ let data = {
+ name: testcase.getAttribute("name"),
+ classname: testcase.getAttribute("classname")
+ };
+ let failureElems = testcase.getElementsByTagName("failure");
+ if (failureElems != undefined && failureElems.length > 0) {
+ data.failure = failureElems[0].getAttribute("message");
+ }
+ return data;
+};
+
+const parseSuite = testsuite => {
+ let data = {
+ name: testsuite.getAttribute("name"),
+ tests: testsuite.getAttribute("tests"),
+ failures: testsuite.getAttribute("failures"),
+ errors: testsuite.getAttribute("errors"),
+ testcases: []
+ };
+ if (testsuite.hasChildNodes) {
+ let length = testsuite.childNodes.length;
+ for (let i = 0; i < length; i++) {
+ let testcase = testsuite.childNodes.item(i);
+ if (testcase.tagName == "testcase") {
+ data.testcases.push(parseCase(testcase));
+ }
+ }
+ }
+ return data;
+};
+
+processReports(TEST_RESULT_FOLDER);
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8090f41b/dangerfile.js
----------------------------------------------------------------------
diff --git a/dangerfile.js b/dangerfile.js
index b4565a6..a499587 100644
--- a/dangerfile.js
+++ b/dangerfile.js
@@ -21,8 +21,8 @@ import fs from "fs";
import path from 'path';
// Make sure there are changelog entries
-// const hasChangelog = danger.git.modified_files.includes("changelog.md")
-// if (!hasChangelog) { fail("No Changelog changes!") }
+const hasChangelog = danger.git.modified_files.includes("changelog.md")
+if (!hasChangelog) { warn("No Changelog changes!") }
const jsFiles = danger.git.created_files.filter(path => path.endsWith("js"));
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/8090f41b/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 21f4b2f..a7774e0 100644
--- a/package.json
+++ b/package.json
@@ -78,7 +78,8 @@
"copy:js": "cp -vf ./dist/native.js ./android/sdk/assets/main.js",
"copy:examples": "rm -rf ./android/playground/app/src/main/assets/* && cp -vrf ./examples/build/* ./android/playground/app/src/main/assets/",
"copy": "npm run copy:js && npm run copy:examples",
- "danger": "danger"
+ "danger": "danger",
+ "danger:junit": "danger -- --dangerfile dangerfile-junit.js"
},
"dependencies": {
"animationjs": "^0.1.5",
@@ -155,11 +156,11 @@
"vue-template-compiler": "^2.2.6",
"webpack": "^1.13.1",
"weex-components": "^0.2.0",
+ "weex-gcanvas": "^0.3.5",
"weex-loader": "^0.4.0",
"weex-vdom-tester": "^0.2.0",
"weex-wd": "^1.0.23",
"wwp": "^0.3.5",
- "weex-gcanvas":"^0.3.5"
-
+ "xmldom": "^0.1.27"
}
}
[2/2] incubator-weex git commit: Merge branch '0.13-dev' of
https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.13-dev
Posted by so...@apache.org.
Merge branch '0.13-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.13-dev
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9e93fc65
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9e93fc65
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9e93fc65
Branch: refs/heads/0.13-dev
Commit: 9e93fc656e4038e88bc5cfccbe5a0aef35d87468
Parents: 8090f41 b36852d
Author: sospartan <so...@apache.org>
Authored: Wed May 3 13:29:45 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Wed May 3 13:29:45 2017 +0800
----------------------------------------------------------------------
.../java/com/alibaba/weex/WXPageActivity.java | 3 +-
.../taobao/weex/dom/WXRecyclerDomObject.java | 2 +-
.../java/com/taobao/weex/utils/WXUtilsTest.java | 16 +--
.../WeexSDK/Sources/Component/WXTextComponent.m | 29 ++++--
test/pages/components/hyperlink.vue | 31 ++++++
test/pages/components/hyperlink_target.vue | 22 ++++
test/pages/modules/vue_timer.vue | 75 ++++++++++++++
test/pages/modules/we_timer.we | 73 ++++++++++++++
test/scripts/components/hyperlink.test.js | 44 ++++++++
test/scripts/components/text.test.js | 2 +-
test/scripts/modules/timer.test.js | 100 +++++++++++++++++++
11 files changed, 377 insertions(+), 20 deletions(-)
----------------------------------------------------------------------