Skip to content

Commit

Permalink
s/traceName/passName
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny committed Aug 25, 2016
1 parent 4ef3c98 commit f300f67
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lighthouse-core/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ function validatePasses(passes, audits, rootPath) {
return;
}

const passName = pass.traceName || Audit.DEFAULT_PASS;
const passName = pass.passName || Audit.DEFAULT_PASS;
if (usedNames.has(passName)) {
log.warn('config', `passes[${index}] may overwrite trace or network ` +
`data of earlier pass without a unique traceName (repeated name: ${passName}.`);
`data of earlier pass without a unique passName (repeated name: ${passName}.`);
}
usedNames.add(passName);
});
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/gather/gather-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class GatherRunner {
});
}, pass);

// Resolve on tracing data using traceName from config.
// Resolve on tracing data using passName from config.
return pass.then(_ => loadData);
}

Expand Down Expand Up @@ -227,7 +227,7 @@ class GatherRunner {
.then(passData => {
// If requested by config, merge trace and network data for this
// pass into tracingData.
const passName = config.traceName || Audit.DEFAULT_PASS;
const passName = config.passName || Audit.DEFAULT_PASS;
config.trace && (tracingData.traces[passName] = passData.trace);
config.network && (tracingData.networkRecords[passName] = passData.networkRecords);

Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/lib/asset-saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ function saveArtifacts(artifacts, filename) {
}

function prepareAssets(options, artifacts) {
const traceData = Object.keys(artifacts.traces).map(traceName => {
const filteredTrace = Object.assign({}, artifacts.traces[traceName]);
const traceData = Object.keys(artifacts.traces).map(passName => {
const filteredTrace = Object.assign({}, artifacts.traces[passName]);
filteredTrace.traceEvents = filterForSize(filteredTrace.traceEvents);
return filteredTrace;
});
Expand Down
8 changes: 4 additions & 4 deletions lighthouse-core/test/config/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ describe('Config', () => {
assert.equal(defaultConfig.audits.length, config.audits.length);
});

it('warns when a traceName is used twice', () => {
it('warns when a passName is used twice', () => {
const unlikelyPassName = 'unlikelyPassName';
const configJson = {
passes: [{
network: true,
traceName: unlikelyPassName,
passName: unlikelyPassName,
gatherers: []
}, {
network: true,
traceName: unlikelyPassName,
passName: unlikelyPassName,
gatherers: []
}],
audits: []
Expand All @@ -68,7 +68,7 @@ describe('Config', () => {
});
});

it('warns when traced twice with no traceNames', () => {
it('warns when traced twice with no passNames specified', () => {
const configJson = {
passes: [{
network: true,
Expand Down
12 changes: 6 additions & 6 deletions lighthouse-core/test/gather/gather-runner-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ describe('GatherRunner', function() {
const passes = [{
network: true,
trace: true,
traceName: 'firstPass',
passName: 'firstPass',
loadPage: true,
gatherers: [
t1
]
}, {
loadPage: true,
traceName: 'secondPass',
passName: 'secondPass',
gatherers: [
t2
]
Expand All @@ -286,13 +286,13 @@ describe('GatherRunner', function() {
const passes = [{
network: true,
trace: true,
traceName: 'firstPass',
passName: 'firstPass',
loadPage: true,
gatherers: [new TestGatherer()]
}, {
network: true,
trace: true,
traceName: 'secondPass',
passName: 'secondPass',
loadPage: true,
gatherers: [new TestGatherer()]
}];
Expand All @@ -315,7 +315,7 @@ describe('GatherRunner', function() {
const passes = [{
network: true,
trace: true,
traceName: 'firstPass',
passName: 'firstPass',
loadPage: true,
gatherers: [
t1
Expand Down Expand Up @@ -365,7 +365,7 @@ describe('GatherRunner', function() {
const passes = [{
network: true,
trace: true,
traceName: 'firstPass',
passName: 'firstPass',
loadPage: true,
gatherers: [new TestGatherer()]
}];
Expand Down

0 comments on commit f300f67

Please sign in to comment.