diff --git a/tests/earl-report.js b/tests/earl-report.js index d969e0d8..79b8c940 100644 --- a/tests/earl-report.js +++ b/tests/earl-report.js @@ -6,6 +6,52 @@ * Copyright (c) 2011-2022 Digital Bazaar, Inc. All rights reserved. */ +/* eslint-disable quote-props */ +const _benchmarkContext = { + 'jldb': 'http://json-ld.org/benchmarks/vocab#', + 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', + 'xsd': 'http://www.w3.org/2001/XMLSchema#', + + // environment description + 'jldb:Environment': {'@type': '@id'}, + + // per environment + // label + // ex: 'Setup 1' (for reports) + 'jldb:label': {'@type': 'xsd:string'}, + // architecture type + // ex: x86 + 'jldb:arch': {'@type': 'xsd:string'}, + // cpu model description (may show multiple cpus) + // ex: 'Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz' + 'jldb:cpu': {'@type': 'xsd:string'}, + // count of cpus, may not be uniform, just informative + 'jldb:cpuCount': {'@type': 'xsd:integer'}, + // platform name + // ex: linux + 'jldb:platform': {'@type': 'xsd:string'}, + // runtime name + // ex: Node.js, Chromium, Ruby + 'jldb:runtime': {'@type': 'xsd:string'}, + // runtime version + // ex: v14.19.0 + 'jldb:runtimeVersion': {'@type': 'xsd:string'}, + // arbitrary comment + 'jldb:comment': 'rdfs:comment', + + // benchmark result + 'jldb:BenchmarkResult': {'@type': '@id'}, + + // use in earl:Assertion, type jldb:BenchmarkResult + 'jldb:result': {'@type': '@id'}, + + // per BenchmarkResult + 'jldb:environment': {'@type': '@id'}, + 'jldb:hz': {'@type': 'xsd:float'}, + 'jldb:rme': {'@type': 'xsd:float'} +}; +/* eslint-enable quote-props */ + /** * EARL Reporter */ @@ -154,50 +200,4 @@ class EarlReport { } } -/* eslint-disable quote-props */ -const _benchmarkContext = { - 'jldb': 'http://json-ld.org/benchmarks/vocab#', - 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', - 'xsd': 'http://www.w3.org/2001/XMLSchema#', - - // environment description - 'jldb:Environment': {'@type': '@id'}, - - // per environment - // label - // ex: 'Setup 1' (for reports) - 'jldb:label': {'@type': 'xsd:string'}, - // architecture type - // ex: x86 - 'jldb:arch': {'@type': 'xsd:string'}, - // cpu model description (may show multiple cpus) - // ex: 'Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz' - 'jldb:cpu': {'@type': 'xsd:string'}, - // count of cpus, may not be uniform, just informative - 'jldb:cpuCount': {'@type': 'xsd:integer'}, - // platform name - // ex: linux - 'jldb:platform': {'@type': 'xsd:string'}, - // runtime name - // ex: Node.js, Chromium, Ruby - 'jldb:runtime': {'@type': 'xsd:string'}, - // runtime version - // ex: v14.19.0 - 'jldb:runtimeVersion': {'@type': 'xsd:string'}, - // arbitrary comment - 'jldb:comment': 'rdfs:comment', - - // benchmark result - 'jldb:BenchmarkResult': {'@type': '@id'}, - - // use in earl:Assertion, type jldb:BenchmarkResult - 'jldb:result': {'@type': '@id'}, - - // per BenchmarkResult - 'jldb:environment': {'@type': '@id'}, - 'jldb:hz': {'@type': 'xsd:float'}, - 'jldb:rme': {'@type': 'xsd:float'} -}; -/* eslint-enable quote-props */ - module.exports = EarlReport; diff --git a/tests/test.js b/tests/test.js index 0d910bee..4f2449a1 100644 --- a/tests/test.js +++ b/tests/test.js @@ -580,10 +580,12 @@ async function addTest(manifest, test, tests) { test.manifest = manifest; const description = test_id + ' ' + (test.purpose || test.name); + /* // build test options for omit checks const testInfo = TEST_TYPES[getJsonLdTestType(test)]; const params = testInfo.params.map(param => param(test)); const testOptions = params[1]; + */ // number of parallel jobs for benchmarks const jobTests = benchmarkOptions.enabled ? benchmarkOptions.jobs : [1]; @@ -594,7 +596,7 @@ async function addTest(manifest, test, tests) { title: description + ` (jobs=${jobs})`, f: makeFn({ test, - run: ({test, testInfo, params}) => { + run: ({/*test, */testInfo, params}) => { // skip Promise.all if(jobs === 1 && fast1) { return jsonld[testInfo.fn](...params); @@ -699,10 +701,11 @@ function makeFn({ } // skip based on description regex + /* if(testInfo.skip && testInfo.skip.descriptionRegex) { testInfo.skip.descriptionRegex.forEach(function(re) { if(re.test(description)) { - if(options.verboseSkip) { + if(verboseSkip) { console.log('Skipping test due to description:', { id: test['@id'], name: test.name, @@ -713,6 +716,7 @@ function makeFn({ } }); } + */ // Make expandContext absolute to the manifest if(test.hasOwnProperty('option') && test.option.expandContext) {