Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbrunnkvist/461262 to your computer and use it in GitHub Desktop.
Save cbrunnkvist/461262 to your computer and use it in GitHub Desktop.
ci_reporter rake task for making Cucumber output Hudson (JUnit) XML
From 24aa2efa9d59da352f21b7bfac75cba03b4a11e0 Mon Sep 17 00:00:00 2001
From: Conny Brunnkvist <cb16@sanger.ac.uk>
Date: Fri, 2 Jul 2010 12:30:09 +0100
Subject: [PATCH] Rake task for Cucumber output: Hudson (JUnit) XML
---
lib/tasks/ci_setup_cucumber_replacement.rake | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 lib/tasks/ci_setup_cucumber_replacement.rake
diff --git a/lib/tasks/ci_setup_cucumber_replacement.rake b/lib/tasks/ci_setup_cucumber_replacement.rake
new file mode 100644
index 0000000..2d1cb2a
--- /dev/null
+++ b/lib/tasks/ci_setup_cucumber_replacement.rake
@@ -0,0 +1,15 @@
+# Works only if you do NOT have the require cucumber step in your Rakefile
+namespace :ci do
+ namespace :setup do
+ @reports_dir = ENV['CI_REPORTS'] || 'features/reports'
+
+ task :cucumber_report_cleanup do
+ rm_rf @reports_dir
+ end
+
+ task :cucumber => :cucumber_report_cleanup do
+ extra_opts = "--format junit --out #{@reports_dir}"
+ ENV["CUCUMBER_OPTS"] = "#{ENV['CUCUMBER_OPTS']} #{extra_opts}"
+ end
+ end
+end
\ No newline at end of file
--
1.7.0.6+GitX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment