vomebook commited on
Commit ·
c7dfd68
1
Parent(s): 6d6c14d
Align image loader coverage gate with tests
Browse files
scripts/reader/check_reader_image_loader_coverage.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import {spawnSync} from 'node:child_process';
|
|
| 2 |
import {hasPassingTapContracts} from '../check_tap_contracts.mjs';
|
| 3 |
|
| 4 |
// Node 26/V8, this module only, under the synthetic contracts below.
|
| 5 |
-
const minimum = [100,
|
| 6 |
const result = spawnSync(process.execPath, [
|
| 7 |
'--test', '--test-concurrency=1', '--test-reporter=tap', '--experimental-test-coverage',
|
| 8 |
'--test-coverage-include=**/static/reader/formats/reader-image-loader.mjs',
|
|
|
|
| 2 |
import {hasPassingTapContracts} from '../check_tap_contracts.mjs';
|
| 3 |
|
| 4 |
// Node 26/V8, this module only, under the synthetic contracts below.
|
| 5 |
+
const minimum = [100, 89.36, 91.67];
|
| 6 |
const result = spawnSync(process.execPath, [
|
| 7 |
'--test', '--test-concurrency=1', '--test-reporter=tap', '--experimental-test-coverage',
|
| 8 |
'--test-coverage-include=**/static/reader/formats/reader-image-loader.mjs',
|
tests/gates/test_static_checks.py
CHANGED
|
@@ -2261,9 +2261,9 @@ class StaticGateTests(unittest.TestCase):
|
|
| 2261 |
self.assertEqual(original.count('reader-image-loader\\.mjs'), 1)
|
| 2262 |
gate.write_text(original.replace('reader-image-loader\\.mjs', 'missing-image-loader\\.mjs'))
|
| 2263 |
self.assert_check(self.run_check(*check), False, 'exactly one source row')
|
| 2264 |
-
for thresholds in ('[100.01,
|
| 2265 |
-
self.assertIn('[100,
|
| 2266 |
-
gate.write_text(original.replace('[100,
|
| 2267 |
self.assert_check(self.run_check(*check), False, 'Reader image loader requires named contracts')
|
| 2268 |
|
| 2269 |
def test_pdf_prefetch_contract_gate_fails_closed(self):
|
|
|
|
| 2261 |
self.assertEqual(original.count('reader-image-loader\\.mjs'), 1)
|
| 2262 |
gate.write_text(original.replace('reader-image-loader\\.mjs', 'missing-image-loader\\.mjs'))
|
| 2263 |
self.assert_check(self.run_check(*check), False, 'exactly one source row')
|
| 2264 |
+
for thresholds in ('[100.01, 89.36, 91.67]', '[100, 89.37, 91.67]', '[100, 89.36, 91.68]'):
|
| 2265 |
+
self.assertIn('[100, 89.36, 91.67]', original)
|
| 2266 |
+
gate.write_text(original.replace('[100, 89.36, 91.67]', thresholds))
|
| 2267 |
self.assert_check(self.run_check(*check), False, 'Reader image loader requires named contracts')
|
| 2268 |
|
| 2269 |
def test_pdf_prefetch_contract_gate_fails_closed(self):
|