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

feature: allow sites to be disabled through file naming #60

Open
wants to merge 2 commits into
base: live
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ After you make a fast web site, keep it fast by measuring it over time. Read [Us

* Requires Node 12+
* Each file in `_data/sites/*.js` is a category and contains a list of sites for comparison.
* A site file can be disabled by ending its filename with `.disabled.js`.

## Run locally

Expand Down
2 changes: 1 addition & 1 deletion _data/isolatedKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const shortHash = require("short-hash");
const fastglob = require("fast-glob");

module.exports = async function() {
let categories = await fastglob("./_data/sites/*.js", {
let categories = await fastglob("./_data/sites/!(*.disabled)*.js", {
caseSensitiveMatch: false
});

Expand Down
11 changes: 11 additions & 0 deletions _data/sites/sample.disabled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// If you need to disable a site, rename it to end in `.disabled.js`
module.exports = {
name: "Sample disabled test", // optional, falls back to object key
description: "This test will not run",
options: {
frequency: 60 * 23, // (in minutes), 23 hours
},
urls: [
"https://www.speedlify.dev/"
]
};
2 changes: 1 addition & 1 deletion _data/urlsForApi.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fastglob = require("fast-glob");

async function getCategoryToUrlMap() {
let categories = await fastglob("./_data/sites/*.js", {
let categories = await fastglob("./_data/sites/!(*.disabled)*.js", {
caseSensitiveMatch: false
});

Expand Down
2 changes: 1 addition & 1 deletion run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function tryToPreventNetlifyBuildTimeout(dateTestsStarted, numberOfUrls, e
lastRuns = {};
}

let verticals = await fastglob("./_data/sites/*.js", {
let verticals = await fastglob("./_data/sites/!(*.disabled)*.js", {
caseSensitiveMatch: false
});

Expand Down