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

tests(smokehouse): index for static server. print address #9541

Merged
merged 6 commits into from
Aug 13, 2019

Conversation

connorjclark
Copy link
Collaborator

Minor enhancement.

image

@@ -79,7 +79,7 @@ module.exports = [
{resourceType: 'font', requestCount: 2, size: '80000±1000'},
{resourceType: 'script', requestCount: 3, size: '55000±1000'},
{resourceType: 'image', requestCount: 2, size: '28000±1000'},
{resourceType: 'document', requestCount: 1, size: '2100±100'},
{resourceType: 'document', requestCount: 1, size: '2200±100'},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

went up b/c content-type header is now added for html docs

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh right that's easy to forget that header cost is included in these

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

surprised it took us this long to do this, what a waste of memorizing these paths! 😆

@@ -79,6 +90,8 @@ function requestHandler(request, response) {
headers['Content-Type'] = 'image/webp';
} else if (filePath.endsWith('.json')) {
headers['Content-Type'] = 'application/json';
} else if (filePath.endsWith('.html') || filePath === '/') {
headers['Content-Type'] = 'text/html';
Copy link
Collaborator

Choose a reason for hiding this comment

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

this feels 100% unrelated to the index part, right?

why cause conflicts for yourself in #9542 :)

lighthouse-cli/test/fixtures/static-server.js Show resolved Hide resolved
lighthouse-cli/test/fixtures/static-server.js Show resolved Hide resolved
const fixturePaths = glob.sync('**/*.html', {cwd: __dirname});
const html = `
<h1>Smoke test fixtures</h1>
${fixturePaths.map(p => `<a href=${p}>${p}</a>`).join('<br>')}
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this work on windows, like are the paths returned by glob different?

do we care if it doesn't? probably not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤷‍♂

lighthouse-cli/test/fixtures/static-server.js Show resolved Hide resolved
serverForOnline.listen(onlinePort, 'localhost');
serverForOffline.listen(offlinePort, 'localhost');
console.log(`online: listening on http://localhost:${onlinePort}`);
console.log(`offline: listening on http://localhost:${offlinePort}`);
Copy link
Member

Choose a reason for hiding this comment

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

there's really nothing offline or online about these, it's just how we use them for one(?) of the smoke tests (we also use them for same- and different-origin in other tests), but I'm not sure it matters what we call them :)

@vercel vercel bot temporarily deployed to staging August 12, 2019 22:56 Inactive
Co-Authored-By: Patrick Hulce <patrick.hulce@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants