You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2021/08/16 15:51:12 UTC

[whimsy] branch master updated (827a35b -> 06c006e)

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

sebb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git.


    from 827a35b  Show PMC size
     new 909ec3f  Fix test TODO at last
     new 06c006e  Ensure work dirs are tidied up

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 lib/Rakefile             | 27 +++++++++++++++++++++++++--
 lib/spec/lib/svn_spec.rb | 20 ++++++++------------
 lib/spec/spec_helper.rb  |  1 +
 3 files changed, 34 insertions(+), 14 deletions(-)

[whimsy] 02/02: Ensure work dirs are tidied up

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 06c006e814141c6571821c0917dc22f154c85331
Author: Sebb <se...@apache.org>
AuthorDate: Mon Aug 16 16:51:04 2021 +0100

    Ensure work dirs are tidied up
---
 lib/Rakefile | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lib/Rakefile b/lib/Rakefile
index 74f7b17..738d332 100644
--- a/lib/Rakefile
+++ b/lib/Rakefile
@@ -1,12 +1,13 @@
 require 'rspec/core/rake_task'
 RSpec::Core::RakeTask.new(:spec)
-task :default => :spec
-task :test => :spec
+task :default => [:spec, :end]
+task :test => [:spec, :end]
 task :spec => :work
 task :work => ['test/svn/incubator-podlings']
 
 file 'test/work/repository' do
   unless File.exist? 'test/work/repository/format'
+    mkdir 'test/work' unless Dir.exist? 'test/work'
     system 'svnadmin create test/work/repository'
   end
 end
@@ -17,3 +18,10 @@ file 'test/svn/incubator-podlings' => 'test/work/repository' do
     system "svn co file:///#{Dir.pwd}/work/repository svn/incubator-podlings"
   end
 end
+
+task :end => [:clobber, :clean]
+
+# cleanup
+require 'rake/clean'
+CLEAN.include 'test/work'
+CLOBBER.include 'test/svn/incubator-podlings'

[whimsy] 01/02: Fix test TODO at last

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

commit 909ec3f0b86511d2c59e11c7a8eddd5b9bc6ae76
Author: Sebb <se...@apache.org>
AuthorDate: Mon Aug 16 15:56:52 2021 +0100

    Fix test TODO at last
---
 lib/Rakefile             | 15 +++++++++++++++
 lib/spec/lib/svn_spec.rb | 20 ++++++++------------
 lib/spec/spec_helper.rb  |  1 +
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/lib/Rakefile b/lib/Rakefile
index eb2717f..74f7b17 100644
--- a/lib/Rakefile
+++ b/lib/Rakefile
@@ -2,3 +2,18 @@ require 'rspec/core/rake_task'
 RSpec::Core::RakeTask.new(:spec)
 task :default => :spec
 task :test => :spec
+task :spec => :work
+task :work => ['test/svn/incubator-podlings']
+
+file 'test/work/repository' do
+  unless File.exist? 'test/work/repository/format'
+    system 'svnadmin create test/work/repository'
+  end
+end
+
+file 'test/svn/incubator-podlings' => 'test/work/repository' do
+  Dir.chdir('test') do
+    rm_rf 'svn/incubator-podlings' if File.exist? 'svn/incubator-podlings'
+    system "svn co file:///#{Dir.pwd}/work/repository svn/incubator-podlings"
+  end
+end
diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index a2bb527..0ba11d6 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -254,32 +254,28 @@ describe ASF::SVN do
     end
     it "svn('info', [path]) should return 'Name: path'" do
       repo = File.join(ASF::SVN.svnurl('attic-xdocs'),'_template.xml')
-      out, err = ASF::SVN.svn('info',[repo])
+      out, _err = ASF::SVN.svn('info',[repo])
       expect(out).to match(/^Name: _template.xml$/)
     end
     it "svn('info', [path1, path2], {item: kind'}) should return 'file ...'" do
       path1 = File.join(ASF::SVN.svnurl('attic-xdocs'),'_template.xml')
       path2 = File.join(ASF::SVN.svnurl('attic-xdocs'),'jakarta.xml')
-      out, err = ASF::SVN.svn('info',[path1, path2], {item: 'kind'})
+      out, _err = ASF::SVN.svn('info',[path1, path2], {item: 'kind'})
       expect(out).to match(/^file +https:/)
     end
 
     it "svn() should honour :chdir option" do
-      begin # Hack to avoid Travis fail; TODO ensure there is a suitable SVN checkout for the test
-        pods = ASF::SVN['incubator-podlings']
-        if pods
-          out, err = ASF::SVN.svn('info', '.', {chdir: pods})
-          expect(err).to eq(nil)
-          expect(out).to match(/^URL: /)
-        end
-      rescue Exception => e
-        puts e
+      pods = ASF::SVN['incubator-podlings'] # arbitrary, but must be set up in Rakefile and spec_helper
+      if pods
+        out, err = ASF::SVN.svn('info', '.', {chdir: pods})
+        expect(err).to eq(nil)
+        expect(out).to match(/^URL: /)
       end
     end
 
     # TODO fix these tests
     it "svn(['help'], 'help') should return some help" do
-      out, err = ASF::SVN.svn(['help'],'help')
+      out, _err = ASF::SVN.svn(['help'],'help')
       expect(out).to match(/Describe the usage of this program or its subcommands/)
     end
     # it "svn(['help', '-v'], 'help') should return Global help" do
diff --git a/lib/spec/spec_helper.rb b/lib/spec/spec_helper.rb
index 634d8c3..a1b0138 100644
--- a/lib/spec/spec_helper.rb
+++ b/lib/spec/spec_helper.rb
@@ -16,6 +16,7 @@ if ENV['RAKE_TEST'] == 'TRUE' or not (ASF::SVN.find('apmail_bin') and ASF::SVN.f
   ASF::SVN['board'] = File.expand_path('../test/svn/board', __dir__)
   ASF::SVN[SAMPLE_SVN_NAME] = File.expand_path('../test/svn/minutes', __dir__)
   ASF::Config[:subscriptions] = File.expand_path('../test/subscriptions', __dir__)
+  ASF::SVN['incubator-podlings'] = File.expand_path('../test/svn/incubator-podlings', __dir__)
 else
   TEST_DATA = false
 end