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

feat: support skipping cache and storage clear #1675

Merged
merged 3 commits into from
Feb 10, 2017
Merged

Conversation

patrickhulce
Copy link
Collaborator

fixes #1664

@@ -65,6 +65,7 @@ const cliFlags = yargs
'port'
], 'Configuration:')
.describe({
'disable-cache-clearing': 'Disable clearing of cache and storage before the run',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

other name ideas welcome, cache is more specific than what actually happens but is probably more familiar/understandable to users than a generic storage

Copy link
Contributor

Choose a reason for hiding this comment

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

disable-storage-reset comes to mind. I actually think being more generic than "cache" is good for the reasons you mention. It applies to all forms of storage on the origin.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do

});
});

it('does not clear the network cache and origin storage when flag is set', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

...when disable-storage-reset flag is set

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

@@ -65,6 +65,7 @@ const cliFlags = yargs
'port'
], 'Configuration:')
.describe({
'disable-storage-reset': 'Disable clearing of cache and storage before the run',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "Disable clearing the browser cache and other storage APIs before a run"

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

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.

LGTM2

@@ -91,13 +91,14 @@ class GatherRunner {

static setupDriver(driver, options) {
log.log('status', 'Initializing…');
const resetStorage = !(options.flags && options.flags.disableStorageReset);
Copy link
Member

Choose a reason for hiding this comment

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

is options.flags ever not defined here? If so, the options.flags.blockedUrlPatterns line below is in trouble

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh yeah it probably always is, just was jumping around to other places where that wasn't true. i'll update

calledDisableNetworkCache: false,
calledClearStorage: false,
};
const createCheck = variable => () => {
Copy link
Member

Choose a reason for hiding this comment

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

it would be nice to replace fake-driver with a nice interface around something like this :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

or we could use sinon :)

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I'd be fine with that too.

Honestly I hate these tests involving the driver. Rely too much on knowledge of internal implementation instead of externally observable behavior. If we're going to assume the driver calls made and the order they're made in, I'd rather we just setup a debugger protocol record/replay system :)

@brendankenny brendankenny merged commit 50b9943 into master Feb 10, 2017
@brendankenny brendankenny deleted the cache_warm branch February 10, 2017 22:53
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.

WPT compat: support cache warm run
3 participants