Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FI-2096 Add list of applicable options to 'Inferno Tests' sheet in test procedure matrix #455

Merged
merged 4 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/onc_certification_g10_test_kit/tasks/generate_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ def generate_test_procedure_worksheet # rubocop:disable Metrics/CyclomaticComple
end
end

# returns an array of options that apply to this test or group
def applicable_options(runnable)
runnable_and_parents = [runnable].tap do |parents|
parents << parents.last.parent while parents.last.parent.present?
end
runnable_and_parents.map(&:suite_option_requirements).compact.flatten
end

def generate_inferno_test_worksheet # rubocop:disable Metrics/CyclomaticComplexity
workbook.add_worksheet('Inferno Tests')
inferno_worksheet = workbook.worksheets[2]
Expand All @@ -207,7 +215,11 @@ def generate_inferno_test_worksheet # rubocop:disable Metrics/CyclomaticComplexi
.min || 0
description.lines.map { |l| l[natural_indent..] || "\n" }.join.strip
end],
['Test Procedure Steps', 30, ->(test) { inferno_to_procedure_map[test.short_id].join(', ') }]
['Test Procedure Steps', 30, ->(test) { inferno_to_procedure_map[test.short_id].join(', ') }],
['Standard Version Filter', 30, lambda do |test|
applicable_options(test).map(&:value).uniq.join(', ')
end]

]

columns.each_with_index do |row_name, index|
Expand All @@ -218,10 +230,13 @@ def generate_inferno_test_worksheet # rubocop:disable Metrics/CyclomaticComplexi

test_suite.groups.each do |group|
row += 1
inferno_worksheet.add_cell(row, 0, group.title)
inferno_worksheet.add_cell(row, 0, "#{group.short_id}: #{group.title}")
inferno_worksheet.add_cell(row, 6, applicable_options(group).map(&:value).uniq.join(', '))
row += 1
group.groups.each do |test_case|
inferno_worksheet.add_cell(row, 1, "#{test_case.short_id}: #{test_case.title}")
inferno_worksheet.add_cell(row, 6, applicable_options(test_case).map(&:value).uniq.join(', '))

row += 1
test_case.tests.each do |test|
this_row = columns.map do |column|
Expand Down
Binary file modified onc_certification_g10_matrix.xlsx
Binary file not shown.
Loading