Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Endpoint to Generate Full XUnit Report #860

Open
rjkennedy98 opened this issue Nov 10, 2017 · 0 comments
Open

Endpoint to Generate Full XUnit Report #860

rjkennedy98 opened this issue Nov 10, 2017 · 0 comments

Comments

@rjkennedy98
Copy link

rjkennedy98 commented Nov 10, 2017

Endpoint to Generate Full XUnit Report

Add endpoint for generating full xunit report

I see there is a function "run" that can generate an xunit report for a suite, but I don't see an endpoint for generating a full xunit report.

declare function local:run-all() {

  let $all-tests := 
      for $suite-xml in t:list()/t:suite
          let $suite as xs:string* := $suite-xml/@path
          let $tests := ()
          let $run-suite-teardown as xs:boolean := xdmp:get-request-field("runsuiteteardown", "") eq "true"
          let $run-teardown as xs:boolean := xdmp:get-request-field("runteardown", "") eq "true"
          return
              let $result := t:run-suite($suite, $tests, $run-suite-teardown, $run-teardown)
              return local:format-junit($result)
    return (
    xdmp:set-response-content-type("application/xml"),
    <test-suites errors="{fn:sum($all-tests/xs:integer(@errors))}" failures="{fn:sum($all-tests/xs:integer(@failures))}" hostname="{($all-tests/@hostname)[1]}" tests="{fn:sum($all-tests/xs:integer(@tests))}" time="{fn:sum($all-tests/xs:decimal(@time))}">
        {
        $all-tests
        }
    </test-suites>
    )
};

If that function is added then a full xunit report can be created by invoking: hostname:port/test/default.xqy?func=run-all

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants