Skip to content

Commit 18d697a

Browse files
authored
Merge pull request #34 from PractiTest/pt1-4945_FC_run_fields_not_filled
pt1-4945_FC_run_fields_not_filled
2 parents fce53cb + 2a9a528 commit 18d697a

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

src/practitest_firecracker/parser/core.clj

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -347,26 +347,28 @@
347347
(not specflow-scenario))
348348
(log/warn "Unable to detect BDD scenario for test" (:classname test) (:name test) " - will create FC test"))
349349

350-
(assoc test
351-
:bdd-test? (some? bdd-scenario)
352-
:gherkin-scenario bdd-scenario
353-
;; Extract scenario outline params to special arg (accessible via ?outline-params-row in firecracker config)
354-
:outline-params-row (:row (:outline-params bdd-scenario))
355-
:outline-params-map (:map (:outline-params bdd-scenario))
356-
:errors (count (filter #(= (:failure-type %) :error) (:test-cases test)))
357-
:failures (count (filter #(= (:failure-type %) :failure) (:test-cases test)))
358-
:flakes (count (filter #(= (:failure-type %) :flake) (:test-cases test)))
359-
:skipped (count (filter #(= (:failure-type %) :skipped) (:test-cases test)))
360-
:tests (count (:test-cases test))
361-
;; :name name
362-
;; :name-test-suite name
363-
:suite-name (:suite-name test)
364-
:pt-first-case-name (:name (first (:test-cases test)))
365-
:pt-test-name name
366-
:pt-name-combine (str name " - " (:name (first (:test-cases test))))
367-
:time-elapsed (round (reduce + (map :time (:test-cases test))) :precision 3)
368-
:full-class-name (:classname test)
369-
:package-name package)))
350+
(merge
351+
;; Computed defaults (lowest priority)
352+
{:errors (count (filter #(= (:failure-type %) :error) (:test-cases test)))
353+
:failures (count (filter #(= (:failure-type %) :failure) (:test-cases test)))
354+
:flakes (count (filter #(= (:failure-type %) :flake) (:test-cases test)))
355+
:skipped (count (filter #(= (:failure-type %) :skipped) (:test-cases test)))
356+
:tests (count (:test-cases test))}
357+
;; Original XML attributes (higher priority - user settings override defaults)
358+
test
359+
;; Required computed fields (highest priority - must be set)
360+
{:bdd-test? (some? bdd-scenario)
361+
:gherkin-scenario bdd-scenario
362+
;; Extract scenario outline params to special arg (accessible via ?outline-params-row in firecracker config)
363+
:outline-params-row (:row (:outline-params bdd-scenario))
364+
:outline-params-map (:map (:outline-params bdd-scenario))
365+
:suite-name (:suite-name test)
366+
:pt-first-case-name (:name (first (:test-cases test)))
367+
:pt-test-name name
368+
:pt-name-combine (str name " - " (:name (first (:test-cases test))))
369+
:time-elapsed (round (reduce + (map :time (:test-cases test))) :precision 3)
370+
:full-class-name (:classname test)
371+
:package-name package})))
370372

371373
(defn get-test-aggregations [test val {:keys [scenarios-map]
372374
:as options}]

src/practitest_firecracker/practitest.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@
331331
this-param)
332332
xml-test (get group-xml-tests [test-name this-param])
333333
sys-test (get tst 1)
334-
[run run-steps] (eval/sf-test-suite->run-def options (first xml-test) sys-test this-param)
335-
additional-run-fields (eval/eval-additional-fields run (:additional-run-fields options))
334+
[_run-duration run-steps] (eval/sf-test-suite->run-def options (first xml-test) sys-test this-param)
335+
additional-run-fields (eval/eval-additional-fields (first xml-test) (:additional-run-fields options))
336336
additional-run-fields (merge additional-run-fields (:system-fields additional-run-fields))
337337
run (eval/sf-test-run->run-def additional-run-fields sys-test)]
338338
{:instance-id (:id instance)

0 commit comments

Comments
 (0)