Repository: incubator-mnemonic
Updated Branches:
  refs/heads/master a4bb10ebd -> 0f2476d43


MNEMONIC-329: Travis Continuous Integration
MNEMONIC-331: Circle Continuous Integration


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/0f2476d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/0f2476d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/0f2476d4

Branch: refs/heads/master
Commit: 0f2476d43024a886a0bf7e5e2644a77077d1d415
Parents: a4bb10e
Author: Wang, Gang(Gary) <gang1.w...@intel.com>
Authored: Fri Aug 11 11:23:06 2017 -0700
Committer: Wang, Gang(Gary) <gang1.w...@intel.com>
Committed: Sat Aug 12 19:42:16 2017 -0700

----------------------------------------------------------------------
 .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++++++
 .travis.yml          | 42 ++++++++++++++++++++++++++++++++++++++++++
 README.md            |  3 +++
 bin/runTestCases.py  |  2 ++
 bin/runall.sh        | 12 ++++++------
 5 files changed, 93 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/0f2476d4/.circleci/config.yml
----------------------------------------------------------------------
diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 0000000..fb60929
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,40 @@
+#
+# 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.
+#
+
+version: 2
+jobs:
+  build:
+    working_directory: /ws/incubator-mnemonic
+    docker:
+      - image: mnemonic/mneci
+    branches:
+      only:
+        - master
+    steps:
+      - run:
+          name: Clean up
+          command: |
+            rm -rf /ws/incubator-mnemonic
+      - checkout
+      - run:
+          name: Run tests
+          command: |
+            git log -1 --stat
+            git clean -xdf
+            mvn clean install
+#           the runall cannot be fulfilled using free plan since it needs more 
resource to run.
+#           bin/runall.sh
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/0f2476d4/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..7904b93
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,42 @@
+#
+# 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.
+#
+
+sudo: required
+dist: trusty
+language: python
+python:
+  - 2.7
+
+services:
+  - docker
+
+branches:
+  only:
+    - master
+
+before_install:
+  - docker pull mnemonic/mneci
+  - docker images
+
+install:
+  - pip install mock
+
+script:
+  - ls -l $TRAVIS_BUILD_DIR
+  - docker run -v $TRAVIS_BUILD_DIR:/ws/incubator-mnemonic --rm -t 
mnemonic/mneci /bin/bash -c "cd /ws/incubator-mnemonic; git log -1 --stat; git 
clean -xdf; mvn clean install"
+#  the runall cannot be fulfilled using free plan since it needs more resource 
to run.
+#  - docker run -v $TRAVIS_BUILD_DIR:/ws/incubator-mnemonic --rm -t 
mnemonic/mneci /bin/bash -c "cd /ws/incubator-mnemonic; git log -1 --stat; 
bin/runall.sh"

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/0f2476d4/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 0ad9547..ac7b6be 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,9 @@
 
 ## <a href="https://mnemonic.incubator.apache.org/"; target="_blank">Mnemonic 
Official Website</a>
 
+[![Build 
Status](https://travis-ci.org/NonVolatileComputing/incubator-mnemonic.svg?branch=master)](https://travis-ci.org/NonVolatileComputing/incubator-mnemonic)
+[![CircleCI](https://circleci.com/gh/NonVolatileComputing/incubator-mnemonic.svg?style=svg)](https://circleci.com/gh/NonVolatileComputing/incubator-mnemonic)
+
 Apache Mnemonic is an advanced hybrid memory storage oriented library, it 
proposed a non-volatile/durable Java object model and durable computing service 
that bring several advantages to significantly improve the performance of 
massive real-time data processing/analytics. developers are able to use this 
library to design their cache-less and SerDe-less high performance applications.
 
 ### Features:

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/0f2476d4/bin/runTestCases.py
----------------------------------------------------------------------
diff --git a/bin/runTestCases.py b/bin/runTestCases.py
index 4d3c95a..6b67918 100755
--- a/bin/runTestCases.py
+++ b/bin/runTestCases.py
@@ -27,6 +27,7 @@ testLogDir = "testlog/"
 if not os.path.exists(testLogDir):
     os.makedirs(testLogDir)
 
+cleanupCmd = r'find mnemonic-* -type f \( -name "*.mne" -o -name "*.dat" \) 
-exec rm {} \;'
 testCmdFile = 'bin/test.conf'
 tcCmdReg = re.compile('^mvn\s.*$')
 tcNameReg = re.compile('-D(?:test|suites)=(.+?)\s')
@@ -40,6 +41,7 @@ with open(testCmdFile) as fp:
             try:
                 #maven build
                 subprocess.check_call(match[0] + ">" + logFilePath, 
stderr=subprocess.STDOUT, shell=True)
+                subprocess.call(cleanupCmd, stderr=subprocess.STDOUT, 
shell=True)
                 print("[SUCCESS] Test case " + tcNameReg.findall(line)[0] + " 
for \"" + tcModuleReg.findall(line)[0]+ "\" is completed!")
             except subprocess.CalledProcessError as e:
                 print("[ERROR] This test case requires \"pmalloc\" memory 
service to pass, please check if \"pmalloc\" has been configured correctly! If 
\"pmalloc\" is installed, please refer to testlog/" + 
tcNameReg.findall(line)[0] + ".log for detailed information.")

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/0f2476d4/bin/runall.sh
----------------------------------------------------------------------
diff --git a/bin/runall.sh b/bin/runall.sh
index f3d5afc..3318346 100755
--- a/bin/runall.sh
+++ b/bin/runall.sh
@@ -61,14 +61,14 @@ fi
 
 if [ ! -d "testlog" ]
 then
-mkdir testlog
+  mkdir testlog
 fi
 
 mvn clean package install > testlog/build.log
 if [ $? -gt 0 ]
 then
-echo [ERROR] Build failed, please check package dependency and refer to 
testlog/build.log for error messages.
-exit 1
+  echo [ERROR] Build failed, please check package dependency and refer to 
testlog/build.log for error messages.
+  exit 1
 fi
 echo [SUCCESS] Build Success!
 
@@ -76,11 +76,11 @@ echo [INFO] Running mnemonic example...
 mvn exec:exec -Pexample -pl mnemonic-examples > testlog/mnemonic-example.log
 if [ $? -gt 0 ]
 then
-echo [ERROR] This example requires \"vmem\" memory service to run, please 
check if \"vmem\" has been configured correctly! If \"vmem\" is installed, 
please refer to testlog/mnemonic-example.log for detailed information.
-exit 1
+  echo [ERROR] This example requires \"vmem\" memory service to run, please 
check if \"vmem\" has been configured correctly! If \"vmem\" is installed, 
please refer to testlog/mnemonic-example.log for detailed information.
+  exit 1
 fi
 echo [SUCCESS] Mnemonic example is completed!
 
-python bin/runTestCases.py
+python bin/runTestCases.py || { echo "Test failed"; exit 33; }
 
 popd

Reply via email to