You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2019/08/08 17:52:01 UTC

[couchdb] 03/05: Capture EUnit and ExUnit test results for Jenkins

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

kocolosk pushed a commit to branch junit-reports-and-jenkins-env
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 26f39a997c20b926f56f63fc44a30289280012b7
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Aug 6 21:12:18 2019 -0400

    Capture EUnit and ExUnit test results for Jenkins
---
 Jenkinsfile         | 38 ++++++++++++++++++++++++++++++++++++++
 mix.exs             |  1 +
 rebar.config.script |  2 +-
 3 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index b2deb8e..f37e9bf 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -144,6 +144,9 @@ pipeline {
             } // withEnv
           } // steps
           post {
+            always {
+              junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+            }
             cleanup {
               sh 'rm -rf $COUCHDB_IO_LOG_DIR'
             }
@@ -173,6 +176,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -215,6 +223,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -258,6 +271,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -300,6 +318,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -342,6 +365,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -384,6 +412,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
@@ -426,6 +459,11 @@ pipeline {
                 unstash 'tarball'
                 sh( script: build_and_test )
               }
+              post {
+                always {
+                  junit '**/.eunit/*.xml, **/_build/*/lib/couchdbtest/*.xml'
+                }
+              }
             }
             stage('Build CouchDB packages') {
               steps {
diff --git a/mix.exs b/mix.exs
index 2e213ae..43c8b6d 100644
--- a/mix.exs
+++ b/mix.exs
@@ -35,6 +35,7 @@ defmodule CouchDBTest.Mixfile do
   # Run "mix help deps" to learn about dependencies.
   defp deps() do
     [
+      {:junit_formatter, "~> 3.0", only: [:dev, :test, :integration]},
       {:httpotion, "~> 3.0", only: [:dev, :test, :integration], runtime: false},
       {:jiffy, path: Path.expand("src/jiffy", __DIR__)},
       {:ibrowse,
diff --git a/rebar.config.script b/rebar.config.script
index 6445057..c38b6e2 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -156,7 +156,7 @@ AddConfig = [
     {sub_dirs, SubDirs},
     {lib_dirs, ["src"]},
     {erl_opts, [{i, "../"} | ErlOpts]},
-    {eunit_opts, [verbose]},
+    {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]},
     {plugins, [eunit_plugin]},
     {dialyzer, [
         {plt_location, local},