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

Support for Multiple Tests #10

Open
JordanForeman opened this issue Aug 11, 2014 · 3 comments
Open

Support for Multiple Tests #10

JordanForeman opened this issue Aug 11, 2014 · 3 comments

Comments

@JordanForeman
Copy link
Contributor

My particular use case involves running several tests for various types of pages as opposed to testing a single url. I'm not sure what the best way to implement this would be, but I'm envisioning something like:

perfbudget: {
    default: {
        options: {
            url: 'http://google.com',
            key: 'YOUR_KEY_HERE',
            paths: [
                '/',
                '/category',
                '/category/item'
            ]
        }
    }
}

Where the plugin would iterate over the paths provided, append them to the base URL, and kick off a test for each of the full URLs created.

Paths would be an optional parameter, and when not specified the plugin would default to the current behavior.

@tkadlec
Copy link
Owner

tkadlec commented Sep 23, 2014

Hmmm...yeah, I follow you. Shouldn't take too much work to pull it off.

@kevindixon
Copy link

As a suggestion, rather than an array of paths, have additional objects per-URL with the ability over-ride any of the settings - I say this because there a frequently cases where the performance budget is different per-page (for instance, little used pages, or particularly rich pages).
So, for instance:

{
    "default": {
        "options": {
            "key": "XXXXXXXXXXXXXXXXXXXXX",
            "location": "Dulles:Chrome",
            "timeout": 180,
            "connectivity": "Cable",
            "runs": 1,
            "budget": {
                "render": 5000,
                "loadTime": 7000,
                "visualComplete": 7000,
                "bytesIn": 1000000,
                "requests": 68,
                "SpeedIndex": 4800
            }
        }
    },
    "home": {
        "options": {
            "url": "http://www.google.com",
            "budget": {
                "bytesIn": 1600000
            }
        }
    },
    "home-analytics": {
        "options": {
            "url": "http://www.google.com/analytics/",
            "timeout": 60,
            "connectivity": "DSL"
        }
    }
}

This is much the same as grunt-yslow uses (https://github.com/andyshora/grunt-yslow) and it works well there.

@kevindixon
Copy link

As a temporary workaround, multi-perfbudget-grunt allows multiple tests to be run in a single command.

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

No branches or pull requests

3 participants