ldp_testsuite_wrapper 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f545d49caa535de0fa085638036a2ce3e36255e5
|
4
|
+
data.tar.gz: b5df7dd9b78f608c2720b31d3b425edc49e9b06a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 755b66ea3c3e1b7ef6de28fd286a0b35324770becd161172c5c2101a4330e39ec51a660f9b62b577e32b458f3743284bade6aafe2117f04834b44427716a842c
|
7
|
+
data.tar.gz: d3ddb33f239451fa5661439883ee5482eb0cc0208a8d3b4f7998a54c6eced90e0350d3a1c4e58a7f19c8b06d6e9d38f8585181e4915c056832aea0c638c4bc13
|
data/exe/ldp_testsuite_wrapper
CHANGED
@@ -16,8 +16,8 @@ module LdpTestsuiteWrapper
|
|
16
16
|
##
|
17
17
|
# @param [Hash] options
|
18
18
|
# @option options [String] :url
|
19
|
-
# @option options [String] :download_dir Local directory to store the downloaded
|
20
|
-
# @option options [String] :download_path Local path for storing the downloaded
|
19
|
+
# @option options [String] :download_dir Local directory to store the downloaded test suite zip and its md5 file in (overridden by :download_path)
|
20
|
+
# @option options [String] :download_path Local path for storing the downloaded test suite zip file
|
21
21
|
# @option options [Boolean] :verbose return verbose info when running commands
|
22
22
|
# @option options [Hash] :env
|
23
23
|
def initialize(options = {})
|
@@ -25,10 +25,9 @@ module LdpTestsuiteWrapper
|
|
25
25
|
end
|
26
26
|
|
27
27
|
##
|
28
|
-
# Run
|
28
|
+
# Run the LDP test suite
|
29
29
|
# @param [Hash] options key-value pairs to transform into command line arguments
|
30
30
|
# @return [StringIO] an IO object for the executed shell command
|
31
|
-
# @see https://github.com/apache/lucene-solr/blob/trunk/solr/bin/solr
|
32
31
|
# If you want to pass a boolean flag, include it in the +options+ hash with its value set to +true+
|
33
32
|
# the key will be converted into a boolean flag for you.
|
34
33
|
def exec(options = {})
|
@@ -123,9 +122,9 @@ module LdpTestsuiteWrapper
|
|
123
122
|
|
124
123
|
# rubocop:disable Lint/RescueException
|
125
124
|
|
126
|
-
# extract a copy of
|
127
|
-
# Does noting if
|
128
|
-
# @return [String] instance_dir Directory where
|
125
|
+
# extract a copy of test suite to instance_dir
|
126
|
+
# Does noting if test suite already exists at instance_dir
|
127
|
+
# @return [String] instance_dir Directory where test suite has been installed
|
129
128
|
def extract
|
130
129
|
return instance_dir if extracted?
|
131
130
|
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'nokogiri'
|
2
|
+
|
3
|
+
RSpec.shared_examples 'ldp test suite' do
|
4
|
+
let(:report_path) { File.expand_path('test-output/testng-results.xml') }
|
5
|
+
let(:report) { Nokogiri::XML(File.read(report_path)) }
|
6
|
+
let(:url) { "#{server_url}/#{SecureRandom.hex}" }
|
7
|
+
|
8
|
+
let(:container_type) do
|
9
|
+
case
|
10
|
+
when test_suite_options[:basic]
|
11
|
+
'http://www.w3.org/ns/ldp#BasicContainer'
|
12
|
+
when test_suite_options[:direct]
|
13
|
+
'http://www.w3.org/ns/ldp#DirectContainer'
|
14
|
+
when test_suite_options[:indirect]
|
15
|
+
'http://www.w3.org/ns/ldp#IndirectContainer'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
let(:ldp_testsuite) do
|
20
|
+
LdpTestsuiteWrapper.default_instance
|
21
|
+
end
|
22
|
+
|
23
|
+
before do
|
24
|
+
response = Faraday.put do |req|
|
25
|
+
req.url url
|
26
|
+
req.headers['Link'] = "<#{container_type}>; rel=\"type\"" if container_type
|
27
|
+
req.headers['Content-Type'] = 'text/turtle'
|
28
|
+
end
|
29
|
+
|
30
|
+
expect(response.status).to eq 201
|
31
|
+
end
|
32
|
+
|
33
|
+
before do
|
34
|
+
$response ||= {}
|
35
|
+
$response[test_suite_options] ||= ldp_testsuite.exec(test_suite_options.merge(server: url))
|
36
|
+
end
|
37
|
+
|
38
|
+
before do
|
39
|
+
expect(File).to exist(report_path)
|
40
|
+
end
|
41
|
+
|
42
|
+
describe 'LDP test suite' do
|
43
|
+
it 'passes tests' do
|
44
|
+
# Report PASS / FAIL tests
|
45
|
+
aggregate_failures 'test suite response' do
|
46
|
+
report.xpath('//test-method').each do |method|
|
47
|
+
next if method['status'] == 'SKIP' || skipped_tests.include?(method['name'])
|
48
|
+
expect(method['status']).to eq('PASS'), <<-EOF.gsub(/^\s+/, '')
|
49
|
+
#{method['name']}: #{method['description']}
|
50
|
+
#{method.xpath('exception/@class')}
|
51
|
+
#{method.xpath('exception/message').text}
|
52
|
+
EOF
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'skips skipped tests' do
|
58
|
+
pending 'skipped LDP tests'
|
59
|
+
|
60
|
+
# Report skipped tests as pending
|
61
|
+
aggregate_failures 'skipped test suite response' do
|
62
|
+
report.xpath('//test-method').each do |method|
|
63
|
+
next unless method['status'] == 'SKIP' || skipped_tests.include?(method['name'])
|
64
|
+
expect(method['status']).to eq('PASS'), <<-EOF.gsub(/^\s+/, '')
|
65
|
+
#{method['name']}: #{method['description']}
|
66
|
+
#{method.xpath('exception/@class')}
|
67
|
+
#{method.xpath('exception/message').text}
|
68
|
+
EOF
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldp_testsuite_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- ldp_testsuite_wrapper.gemspec
|
118
118
|
- lib/ldp_testsuite_wrapper.rb
|
119
119
|
- lib/ldp_testsuite_wrapper/instance.rb
|
120
|
+
- lib/ldp_testsuite_wrapper/rspec.rb
|
120
121
|
- lib/ldp_testsuite_wrapper/version.rb
|
121
122
|
- spec/lib/ldp_testsuite_wrapper_spec.rb
|
122
123
|
- spec/spec_helper.rb
|