-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Expanded .percy.yml
configuration support
#257
feat: Expanded .percy.yml
configuration support
#257
Conversation
4c34dfa
to
ca52c02
Compare
base-url: /blog/ | ||
snapshot-files: '**/*.html' | ||
ignore-files: '**/*.htm' | ||
agent: | ||
port: 1111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is questionable about if this should be here since it's not really supported properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think we should create a follow up ticket to fix it. I've seen a few folks in support try to use it
@@ -0,0 +1,5 @@ | |||
export const DEFAULT_PORT: number = 5338 // BEES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these had to be explicitly split out because they are imported into PercyAgentClient
.
|
||
const snapshotGlobs = this.configuration['snapshot-files'] | ||
.split(',') | ||
.filter((value) => value !== '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously we were not guarding against ''
values for the snapshot globs, which appear to match everything. This is a bit of a bonus change.
const browser = this.browser = await this.createBrowser() | ||
this.pagePool = await this.createPagePool(() => { | ||
return this.createPage(browser) | ||
}, this.PAGE_POOL_SIZE_MIN, this.PAGE_POOL_SIZE_MAX) | ||
}, this.configuration['page-pool-size-min'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is one of the key bits of this PR. We're now supplying a configurable min/max pool size.
.percy.yml
.percy.yml
configuration support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏁 Nice work here! Just need to remove the left over console.log
and everything looks good to me 😃
base-url: /blog/ | ||
snapshot-files: '**/*.html' | ||
ignore-files: '**/*.htm' | ||
agent: | ||
port: 1111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think we should create a follow up ticket to fix it. I've seen a few folks in support try to use it
…ices they are for. Started to add asset discovery options from the configuration file
65f5352
to
830e174
Compare
# [0.8.0](v0.7.2...v0.8.0) (2019-07-02) ### Features * Expanded `.percy.yml` configuration support ([#257](#257)) ([9538202](9538202))
New configuration options in
.percy.yml
On the surface this PR gives us the ability to now configure these options in the
.percy.yml
file:Configuration handling refactor
Deeper into the PR, you'll find a total refactor of the way we handle configuration in @percy/agent. As we've expanded what you can configure in
.percy.yml
, it's become more important to be able to layer config from various places on top of each other.These configuration layers are setup like this:
.percy.yml
configurationThe
ConfigurationService
can handle input from all of these places and produce one unified configuration for use by other service objects.Page pool size experiment
Now that you can configure
page-pool-size
I ran some experiments to understand the resource differences. The test I ran took 101 snapshots with 3 widths on a very simple todo app page and it sent them up in parallel. Here's the scriptsnapshots.js
I used:and here's the results with different page-pool settings. I ran
time npm run snapshots
.For each page open in the pool, I noticed about ~130mb of RAM was used.
What I observe from this is the following:
@percy/agent
to take up the minimum amount of resources (CPU and memory) and aren't concerned about speed, you should set your min and max pool size to 1.@percy/agent
will quickly scale up to the max pool size if it's needed.