Skip to content

Commit

Permalink
Fix lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlehn committed May 19, 2023
1 parent 26246d3 commit f4c61b6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 48 deletions.
92 changes: 46 additions & 46 deletions tests/earl-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
8 changes: 6 additions & 2 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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);
Expand Down Expand Up @@ -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,
Expand All @@ -713,6 +716,7 @@ function makeFn({
}
});
}
*/

// Make expandContext absolute to the manifest
if(test.hasOwnProperty('option') && test.option.expandContext) {
Expand Down

0 comments on commit f4c61b6

Please sign in to comment.