Skip to content

test_runner: improve coverage source map diagnostics - #53

Draft
trivikr wants to merge 1 commit into
mainfrom
test-runner-coverage-source-map
Draft

test_runner: improve coverage source map diagnostics#53
trivikr wants to merge 1 commit into
mainfrom
test-runner-coverage-source-map

Conversation

@trivikr

@trivikr trivikr commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Refs: https://github.com/nodejs/reliability/issues?q=sort%3Aupdated-desc%20is%3Aissue%20state%3Aopen%20%22test-runner-coverage-source-map%22

Example
not ok 3925 parallel/test-runner-coverage-source-map
  ---
  duration_ms: 1652.14700
  severity: fail
  exitcode: 1
  stack: |-
    Test failure: 'should work with source maps'
    Location: test/parallel/test-runner-coverage-source-map.js:32:9
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(report))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:51:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Promise.all (index 0)
        at async Suite.run (node:internal/test_runner/test:1869:7)
        at async startSubtestAfterBootstrap (node:internal/test_runner/harness:387:3) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'should only work with --enable-source-maps'
    Location: test/parallel/test-runner-coverage-source-map.js:55:9
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(report))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:72:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'should ignore erased TypeScript import type lines'
    Location: test/parallel/test-runner-coverage-source-map.js:76:9
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(report))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:97:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'properly accounts for line endings in source maps'
    Location: test/parallel/test-runner-coverage-source-map.js:101:9
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(report))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:122:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'should throw when a source map is missing a source file'
    Location: test/parallel/test-runner-coverage-source-map.js:126:9
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(error))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:133:14)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'should throw when a source map is not valid JSON'
    Location: test/parallel/test-runner-coverage-source-map.js:141:11
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(error))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:146:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }
    
    Test failure: 'should throw when a source map does not exist'
    Location: test/parallel/test-runner-coverage-source-map.js:141:11
    AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:
    
      t.assert.ok(spawned.stdout.includes(error))
    
        at TestContext.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/test/parallel/test-runner-coverage-source-map.js:146:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
        at async Test.run (node:internal/test_runner/test:1389:7)
        at async Suite.processPendingSubtests (node:internal/test_runner/test:960:7) {
      generatedMessage: true,
      code: 'ERR_ASSERTION',
      actual: false,
      expected: true,
      operator: '==',
      diff: 'simple'
    }

Run spawned test runner children without inherited forced color.
Include the actual child stdout when expected coverage output is
missing.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant