Skip to content

Commit

Permalink
[ELITERT-1043] Include MTRs' filenames in JSON export
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Bobillier authored and sergio-bobillier committed Nov 29, 2024
1 parent de6c2fe commit 1e8c581
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Please mark backwards incompatible changes with an exclamation mark at the start

## [Unreleased]

### Added
- The JSON export now includes the path to the MTR files.

### Changed
- The `description` field will now be rendered as Markdown in the HTML report.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def serialize
refs: Array(test_record.id),
result: test_record.result,
review_status: render_review_status,
mtr_file: relative_to_repo(test_record.source_file).to_s,
verification_result: serialized_verification_result,

# TODO: Remove the started_at and finished_at attributes after solving
Expand Down
1 change: 1 addition & 0 deletions req/exporter.dim
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,6 @@ SRS_DRAGNET_0080:
SRS_DRAGNET_0081:
text: |
The JSON exporter shall export the MTR's filename.
tags: covered, tested
test_setups: off_target
status: valid
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
let(:review_comments) { nil }
let(:has_findings) { false }
let(:findings) { nil }
let(:source_file) { Pathname.new('/workspace/path/to/repo/manual/ESR_REQ_7630.yaml') }
let(:files) { nil }
let(:repos) { nil }

Expand All @@ -40,6 +41,7 @@
findings?: has_findings,
findings: findings,
verification_result: verification_result,
source_file: source_file,
files: files,
repos: repos
)
Expand Down Expand Up @@ -276,6 +278,11 @@
end
end

it "includes the TestRecord's source file (relative to the Repository's root)",
requirements: %w[SRS_DRAGNET_0081] do
expect(method_call).to include(mtr_file: 'manual/ESR_REQ_7630.yaml')
end

it "includes the TestRecord's serialized VerificationResult" do
expect(method_call).to include(verification_result: serialized_verification_result)
end
Expand Down
7 changes: 7 additions & 0 deletions spec/integration/dragnet/exporters/json_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
'"refs":["ESR_REQ_9126"],' \
'"result":"passed",' \
'"review_status":"not_reviewed",' \
'"mtr_file":"MTR/PD_3234_voltage.yaml",' \
'"verification_result":{' \
'"status":"skipped",' \
'"started_at":"2024-02-27 14:36:07 +0000",' \
Expand All @@ -168,6 +169,7 @@
'"refs":["ESR_REQ_7817","ESR_REQ_3636"],' \
'"result":"passed",' \
'"review_status":"reviewed",' \
'"mtr_file":"MTR/validators.yaml",' \
'"verification_result":{' \
'"status":"passed",' \
'"started_at":"2024-02-27 14:21:16 +0000",' \
Expand All @@ -190,6 +192,7 @@
'"refs":["ESR_REQ_7661"],' \
'"result":"failed",' \
'"review_status":"not_reviewed",' \
'"mtr_file":"MTR/crypto/diffie.yaml",' \
'"verification_result":{' \
'"status":"failed",' \
'"started_at":"2024-02-27 14:22:04 +0000",' \
Expand Down Expand Up @@ -245,6 +248,10 @@
expect(verification_results).to all(be_a(Hash))
end

it "includes the MTRs' file names", requirements: %w[SRS_DRAGNET_0081] do
expect(re_parsed_json).to all(have_key('mtr_file'))
end

it 'includes the start_at attribute in each Verification Result', requirements: %w[SRS_DRAGNET_0078] do
expect(verification_results).to all(have_key('started_at'))
end
Expand Down

0 comments on commit 1e8c581

Please sign in to comment.