oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.41k stars 2.78k forks source link

Implement junit test reporter #15205

Closed Jarred-Sumner closed 1 week ago

Jarred-Sumner commented 1 week ago

What does this PR do?

Fixes https://github.com/oven-sh/bun/issues/8019

The biggest issue with this is the lack of stdout/stderr duplicated to the test output.

Example XML:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="bun test" tests="11" assertions="9" failures="4" skipped="2" time="0.029948">
  <testsuite name="test-2.test.js" tests="4" assertions="4" failures="2" skipped="0" time="0" hostname="Jarreds-MacBook-Pro.local">
    <properties>
      <property name="ci" value="https://ci.example.com/123" />
      <property name="commit" value="1234567890" />
    </properties>
    <testcase name="should pass inside nested describe" classname="nested describe" time="0.000907" file="test-2.test.js" assertions="1" />
    <testcase name="should fail inside nested describe" classname="nested describe" time="0.000810375" file="test-2.test.js" assertions="1">
      <failure type="AssertionError" />
    </testcase>
    <testcase name="should pass" classname="" time="0.000162875" file="test-2.test.js" assertions="1" />
    <testcase name="failing test" classname="" time="0.0007653330000000001" file="test-2.test.js" assertions="1">
      <failure type="AssertionError" />
    </testcase>
  </testsuite>
  <testsuite name="passing.test.js" tests="7" assertions="5" failures="2" skipped="2" time="0" hostname="Jarreds-MacBook-Pro.local">
    <properties>
      <property name="ci" value="https://ci.example.com/123" />
      <property name="commit" value="1234567890" />
    </properties>
    <testcase name="should pass inside nested describe" classname="nested describe" time="0.000137458" file="passing.test.js" assertions="1" />
    <testcase name="should fail inside nested describe" classname="nested describe" time="0.000604333" file="passing.test.js" assertions="1">
      <failure type="AssertionError" />
    </testcase>
    <testcase name="should pass" classname="" time="0.000173166" file="passing.test.js" assertions="1" />
    <testcase name="second test" classname="" time="0.000580875" file="passing.test.js" assertions="1" />
    <testcase name="failing test" classname="" time="0.0007428749999999999" file="passing.test.js" assertions="1">
      <failure type="AssertionError" />
    </testcase>
    <testcase name="skipped test" classname="" time="0" file="passing.test.js" assertions="0">
      <skipped />
    </testcase>
    <testcase name="todo test" classname="" time="0" file="passing.test.js" assertions="0">
      <skipped message="TODO" />
    </testcase>
  </testsuite>
</testsuites>

How did you verify your code works?

Tests

robobun commented 1 week ago

:x: @dylan-conway, your commit 79a2fb510f9c8748c63ba88dad848b40d216c526 has 12 failures in #6359:

  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/cli/run/require-cache.test.ts - 1 failing on 🪟 2019 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64
  • test/js/bun/http/serve.test.ts - segmentation fault on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/bun/ffi/cc.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 aarch64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64
  • test/cli/install/bun-link.test.ts - 4 failing on 🐧 3.20 x64-baseline
  • test/js/web/websocket/websocket.test.js - 1 failing on 🍎 14 aarch64
  • test/js/third_party/postgres/postgres.test.ts - 1 failing on 🍎 13 aarch64
  • test/js/node/test/parallel/http2-pipe.test.js - code 1 on 🍎 13 aarch64
  • test/js/web/fetch/fetch.tls.test.ts - 1 failing on 🍎 13 aarch64