Skip to content

Commit 326c2c1

Browse files
committed
add cdn_only
... still runs these tests on rev-proxy, for now
1 parent e8fa364 commit 326c2c1

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ The `tests` member is an array of objects, with the following members:
4141
- `optimal` - This test is to see if the cache behaves optimally.
4242
- `check` - This test is gathering information about cache behaviour.
4343
- `requests` - a list of request objects (see below).
44-
- `browser_only` - if `true`, will not run on non-browser caches. Default `false`.
44+
- `browser_only` - if `true`, will only run on browser caches. Default `false`.
45+
- `cdn_only` - if `true`, will only run on CDN caches. Default `false`.
4546
- `browser_skip` - if `true, will not run on browser caches. Default `false`.
4647
- `depends_on` - a list of test IDs that, when one fails, indicates that this test's results are not useful. Currently limited to test IDs in the same suite. Optional.
4748
- `spec_anchors` - An array of strings that represent anchors in the HTTP Caching specification related to this test. Optional.

client/runner.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export function runTests (tests, myFetch, browserCache, base, chunkSize = 50) {
1212
testSet.tests.forEach(test => {
1313
if (test.id === undefined) throw new Error('Missing test id')
1414
if (test.browser_only === true && !config.useBrowserCache === true) return
15+
if (test.cdn_only === true && config.useBrowserCache === true) return
16+
// note: still runs cdn tests on rev-proxy
1517
if (test.browser_skip === true && config.useBrowserCache === true) return
1618
testArray.push(test)
1719
})

lib/display.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export function renderTestResults (testSuites, testResults, testUUIDs, target, u
3939
let passed = 0
4040
testSuite.tests.forEach(test => {
4141
if (test.browser_only === true && !useBrowserCache === true) return
42+
if (test.cdn_only === true && useBrowserCache === true) return
4243
if (test.browser_skip === true && useBrowserCache === true) return
4344
test.suiteName = testSuite.name
4445
const testElement = resultList.appendChild(document.createElement('li'))

lib/testsuite-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,11 @@
364364
}
365365
},
366366
"browser_only": {
367-
"description": "Whether the test will skip non-browsers",
367+
"description": "Whether the test will only run on browsers",
368+
"type": "boolean"
369+
},
370+
"cdn_only": {
371+
"description": "Whether the test will only run on CDN caches",
368372
"type": "boolean"
369373
},
370374
"browser_skip": {

lib/tpl/explain-test.liquid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Test ID: `{{ test.id }}`
88
{%- else -%}This is a conformance test
99
{%- endcase -%}
1010
{%- if test.browser_only %} run on browsers only{% endif -%}
11+
{%- if test.cdn_only %} run on CDN caches only{% endif -%}
1112
{%- if test.browser_skip %} not run on browsers{% endif -%}
1213
.
1314

0 commit comments

Comments
 (0)