Skip to content

Commit

Permalink
Change format of ignore list to not be per-engine keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed May 22, 2024
1 parent 0b46348 commit ec3615e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"rest-xml" : {
"input" : {},
"output" : {
"ox": {
"SimpleScalarPropertiesComplexEscapes": "OxEngine does not handle all escape cases but other engines supports it"
"SimpleScalarPropertiesComplexEscapes": {
"description": "OxEngine does not handle all escape cases but other engines supports it",
"engines": ["ox"]
},
"nokogiri": {
"SimpleScalarPropertiesWithXMLPreamble": "Nokogiri doesn't support XML preamble?"
"SimpleScalarPropertiesWithXMLPreamble": {
"description": "Nokogiri doesn't support XML preamble?",
"engines": ["nokogiri"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
describe 'input tests' do
ProtocolTestsHelper.each_test_case(self, files['input']) do |group, suite, test_case, test_id, description|
group.it("ID: #{test_id} - #{description}") do
ProtocolTestsHelper.skip_test_if_ignored(protocol, 'input', engine, test_id, self)
ProtocolTestsHelper.skip_test_if_ignored(protocol, 'input', test_id, engine, self)
ProtocolTestsHelper::Matcher.setup_matchers(test_id, self)

client = ProtocolTestsHelper.client_for(suite, test_case, "Input_#{test_id}")
Expand Down Expand Up @@ -42,7 +42,7 @@
describe 'output tests' do
ProtocolTestsHelper.each_test_case(self, files['output']) do |group, suite, test_case, test_id, description|
group.it("ID: #{test_id} - #{description}") do
ProtocolTestsHelper.skip_test_if_ignored(protocol, 'output', engine, test_id, self)
ProtocolTestsHelper.skip_test_if_ignored(protocol, 'output', test_id, engine, self)

client = ProtocolTestsHelper.client_for(suite, test_case, "Output_#{test_id}")
client.handle(step: :send) do |context|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ def ignore_list
# "protocol" : {
# "input" : {},
# "output" : {
# "some_engine": { "SomeTestId": "Description" }
# "SomeTestId": {
# "description": "Description",
# "engines": ["engine"]
# }
# }
# },
def skip_test_if_ignored(protocol, test_type, engine, test_id, it)
if (test_id, description = check_ignore_list(protocol, test_type, engine, test_id))
def skip_test_if_ignored(protocol, test_type, test_id, engine, it)
if (test_id, description = check_ignore_list(protocol, test_type, test_id, engine))
it.skip("ID: #{test_id} - #{description}")
end
end
Expand Down Expand Up @@ -188,14 +191,15 @@ def underscore(str)

private

def check_ignore_list(protocol, test_type, engine, test_id)
def check_ignore_list(protocol, test_type, test_id, engine)
return nil if protocol.include?('extras')

ignore_list
.fetch(protocol, {})
.fetch(test_type, {})
.fetch(engine.to_s, {})
.find { |k, _v| k == test_id }
.fetch(test_id, {})
.fetch("engines", [])
.find { |e| engine.to_s == e }
end

end
Expand Down

0 comments on commit ec3615e

Please sign in to comment.