Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: save perf trace to S3 on failure #2051

Merged
merged 4 commits into from
Apr 25, 2017
Merged

ci: save perf trace to S3 on failure #2051

merged 4 commits into from
Apr 25, 2017

Conversation

patrickhulce
Copy link
Collaborator

saves perf trace to an S3 bucket (GCS isn't supported by travis-artifacts)

.travis.yml Outdated
- npm run lint
- npm run unit
- npm run closure
- npm run smoke
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this formatting was all done by travis on travis encrypt --add I can remove if we care

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for reverting where it's unchanged. We just used git blame on .travis.yml in filing #2048 :)

Copy link
Member

@paulirish paulirish Apr 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah ++ on not adjusting whitespace in this PR.
(the last commit didn't revert it fwiw)


edit: all good!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(the last commit didn't revert it fwiw)

yeah the noisiness referred to not uploading traces that failed unrelated to screenshots failures not the travis noise fix until the next PR :)

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

@@ -244,7 +254,8 @@ const cli = yargs
.help('help')
.describe({
'config-path': 'The path to the config JSON file',
'expectations-path': 'The path to the expected audit results file'
'expectations-path': 'The path to the expected audit results file',
'save-assets-to': 'The path to save the assets to',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'save-assets-path'? description could be "Saves run assets to this path" or something to be clear that it's not saved usually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -89,6 +95,10 @@ function runLighthouse(url, configPath) {
process.exit(runResults.status);
}

if (saveAssetsPath) {
return require(resolveLocalOrCwd(saveAssetsPath));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing because of the output-path magic. Add a comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

.travis.yml Outdated
- npm run lint
- npm run unit
- npm run closure
- npm run smoke
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote for reverting where it's unchanged. We just used git blame on .travis.yml in filing #2048 :)

- node_modules
- chrome-linux
- lighthouse-extension/node_modules
- lighthouse-viewer/node_modules
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brendankenny this I'm keeping because it's actually misaligned :P

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add us to the bucket? :)

.travis.yml Outdated
- npm run lint
- npm run unit
- npm run closure
- npm run smoke
Copy link
Member

@paulirish paulirish Apr 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah ++ on not adjusting whitespace in this PR.
(the last commit didn't revert it fwiw)


edit: all good!

@@ -259,7 +270,7 @@ let passingCount = 0;
let failingCount = 0;
expectations.forEach(expected => {
console.log(`Checking '${expected.initialUrl}'...`);
const results = runLighthouse(expected.initialUrl, configPath);
const results = runLighthouse(expected.initialUrl, configPath, cli['save-assets-to']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cli.saveAssetsTo isn't it?

Copy link
Collaborator Author

@patrickhulce patrickhulce Apr 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be both now that the bug is fixed but we were using the kebab case versions above

.travis.yml Outdated
- npm run coveralls
- npm run coveralls
after_failure:
- grep 'No screenshots' perf.json && travis-artifacts upload --path perf-0.trace.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. smokehouse runs a bunch of sites, thus making a number of traces, right? why does it look like we're only uploading a single json file?
  2. i presume this isn't actually overwriting the one file in the bucket with this name? what does it look like in the bucket?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paulirish perf smokehouse run is the only one that actually exercises an audit that needs screenshots, travis-artifacts creates a directory for every job and sticks it in there

@patrickhulce
Copy link
Collaborator Author

can you add us to the bucket? :)

fo sho, send me your AWS emails or user IDs

@patrickhulce
Copy link
Collaborator Author

our first artifact :)

@patrickhulce
Copy link
Collaborator Author

PTAL :)

@patrickhulce
Copy link
Collaborator Author

@brendankenny any more objections?

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last suggestion and LGTM 👍


npm run -s smokehouse -- --config-path=$config --expectations-path=$expectations
if [[ "$CI" = true ]]; then
save_assets="--save-assets-path=perf.json"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here and in .travis.yml why this is being done. e.g. "Save assets so that traces of test failures can be examined" or something

@patrickhulce patrickhulce merged commit 4f598c5 into master Apr 25, 2017
@patrickhulce patrickhulce deleted the travis_artifacts branch April 25, 2017 23:47
paulirish pushed a commit that referenced this pull request Apr 26, 2017
* test: save perf trace to S3 on failure

* test: fix tests and reduce noisiness

* feedback

* add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants