Commit dc47eb17 authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

make sure we start with a clean junit dir

otherwise we append to existing tests by default, worse yet we may have
old files lying around
parent 6913f0e2
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# You should have received a copy of the GNU Lesser General Public # You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>. # License along with this library. If not, see <http://www.gnu.org/licenses/>.
require 'fileutils'
require 'json' require 'json'
require 'jenkins_junit_builder' require 'jenkins_junit_builder'
...@@ -68,7 +69,8 @@ class JUnit ...@@ -68,7 +69,8 @@ class JUnit
end end
def self.from_openqa(testresults_dir) def self.from_openqa(testresults_dir)
Dir.mkdir('junit') unless Dir.exist?('junit') FileUtils.rm_rf('junit') if Dir.exist?('junit')
Dir.mkdir('junit')
ran = false ran = false
Dir.glob("#{testresults_dir}/result-*.json").each do |test_file| Dir.glob("#{testresults_dir}/result-*.json").each do |test_file|
ran = true ran = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment