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
The following commit(s) were added to refs/heads/master by this push:
new 462c8241 Allow for Docker testing
462c8241 is described below
commit 462c8241986d99d599a41153f5d738e4092f7a72
Author: Sebb <[email protected]>
AuthorDate: Sun Jun 8 14:41:02 2025 +0100
Allow for Docker testing
---
lib/spec/lib/svn_spec.rb | 14 ++++++++------
lib/spec/lib/svn_wunderbar_spec.rb | 2 +-
lib/spec/spec_helper.rb | 6 +++++-
www/board/agenda/spec/other_views_spec.rb | 2 +-
4 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/lib/spec/lib/svn_spec.rb b/lib/spec/lib/svn_spec.rb
index f6ff7c28..6b652e7a 100644
--- a/lib/spec/lib/svn_spec.rb
+++ b/lib/spec/lib/svn_spec.rb
@@ -71,7 +71,7 @@ describe ASF::SVN do
it "should return URL for #{SAMPLE_ALIAS}" do
res = ASF::SVN.svnurl(SAMPLE_ALIAS)
expect(res.class).to equal(String)
- expect(res).to match(%r{https://.+/Bills})
+ expect(res).to match(%r{https?://.+/Bills})
end
it "should return nil for #{SAMPLE_MISSING_NAME}" do
@@ -159,7 +159,7 @@ describe ASF::SVN do
it "getInfo(public url) should return a string at least 30 chars long
starting with 'Path: '" do
pub = ASF::SVN.private_public()[1]
repo = ASF::SVN.svnurl(pub[1]) # select a public repo url
- expect(repo).to start_with('https://')
+ expect(repo).to match('https?://')
out, err = ASF::SVN.getInfo(repo)
expect(err).to eq(nil)
expect(out.size).to be > 30
@@ -215,7 +215,9 @@ describe ASF::SVN do
repo = ASF::SVN.svnurl(pub[1]) # select a public repo URL
out, err = ASF::SVN.list(repo)
expect(err).to eq(nil)
- expect(out.size).to be > 10 # need a better test
+ unless repo.start_with? 'http://localhost' # Skip for Docker testing
+ expect(out.size).to be > 10 # need a better test
+ end
end
end
@@ -283,7 +285,7 @@ describe ASF::SVN do
path1 = File.join(ASF::SVN.svnurl('minutes'),'HEADER.html')
path2 =
File.join(ASF::SVN.svnurl('minutes'),'2000','board_minutes_2000_02_28.txt')
out, _err = ASF::SVN.svn('info',[path1, path2], {item: 'kind'})
- expect(out).to match(/^file +https:/)
+ expect(out).to match(/^file +https?:/)
end
it 'svn() should honour :chdir option' do
@@ -409,8 +411,8 @@ describe ASF::SVN do
end
describe 'ASF::SVN.svnpath!' do
- it "svnpath!('board', 'committee-info.txt') should be
https://svn.apache.org/repos/private/committers/board/committee-info.txt" do
- exp =
'https://svn.apache.org/repos/private/committers/board/committee-info.txt'
+ it "svnpath!('board', 'committee-info.txt') should be
#{svn_base}private/committers/board/committee-info.txt" do
+ exp = "#{svn_base}private/committers/board/committee-info.txt"
act = ASF::SVN.svnpath!('board', 'committee-info.txt')
expect(act).to eq(exp)
act = ASF::SVN.svnpath!('board', '/committee-info.txt')
diff --git a/lib/spec/lib/svn_wunderbar_spec.rb
b/lib/spec/lib/svn_wunderbar_spec.rb
index f23d5b1b..b7b433a6 100644
--- a/lib/spec/lib/svn_wunderbar_spec.rb
+++ b/lib/spec/lib/svn_wunderbar_spec.rb
@@ -82,7 +82,7 @@ describe 'ASF::SVN.svn_' do
expect(rc).to be(0)
expect(out['transcript'].class).to equal(Array)
- exp = ['svn', 'info', '--non-interactive', '--',
'https://svn.apache.org/repos/asf/infrastructure/site/trunk/content/foundation/records/minutes/HEADER.html']
+ exp = ['svn', 'info', '--non-interactive', '--',
"#{svn_base}asf/infrastructure/site/trunk/content/foundation/records/minutes/HEADER.html"]
expect(out['transcript'][1]).to eq(exp.join(' '))
end
it "svn_('info', 'no file') should fail with E200009" do
diff --git a/lib/spec/spec_helper.rb b/lib/spec/spec_helper.rb
index d8b1b9c7..123eddd3 100644
--- a/lib/spec/spec_helper.rb
+++ b/lib/spec/spec_helper.rb
@@ -23,7 +23,7 @@ require 'whimsy/asf/svn' # must be loaded before updating
config
# Don't load 'whimsy/asf' here as some classes may depend on overrides below
SAMPLE_SVN_NAME = 'minutes' # name of checkout of public SVN dir
-SAMPLE_SVN_URL_RE = %r{https://.+/minutes}
+SAMPLE_SVN_URL_RE = %r{https?://.+/minutes}
# Override with test data if there is no checkout available (allows local use)
if ENV['RAKE_TEST'] == 'TRUE' or not
(File.exist?(File.join(ASF::Config[:puppet_data], 'apmail_bin')) and
ASF::SVN.find('board'))
@@ -70,6 +70,10 @@ def set_svn(name)
ASF::SVN[name] = File.expand_path(File.join('..', 'test', 'svn', name),
__dir__)
end
+def svn_base
+ ASF::SVN.instance_variable_get(:@base).to_s
+end
+
if TEST_DATA
puts "TEST_DATA=#{TEST_DATA}"
else
diff --git a/www/board/agenda/spec/other_views_spec.rb
b/www/board/agenda/spec/other_views_spec.rb
index 1ab5ae56..01679553 100644
--- a/www/board/agenda/spec/other_views_spec.rb
+++ b/www/board/agenda/spec/other_views_spec.rb
@@ -195,7 +195,7 @@ feature 'other reports' do
visit '/2015-02-18/January-21-2015'
expect(page).to have_selector \
-
'a[href="https://svn.apache.org/repos/private/foundation/board/board_minutes_2015_01_21.txt"]',
+
'a[href="#{svn_base}private/foundation/board/board_minutes_2015_01_21.txt"]',
text: 'board_minutes_2015_01_21.txt'
end