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

Make METEOR_WATCH_PRIORITIZE_CHANGED opt-out instead of opt-in. #8866

Merged
merged 1 commit into from
Jul 10, 2017
Merged
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
11 changes: 8 additions & 3 deletions tools/fs/safe-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ if (process.platform === "win32") {
WATCHER_ENABLED = false;
}

var PRIORITIZE_CHANGED =
process.env.METEOR_WATCH_PRIORITIZE_CHANGED &&
JSON.parse(process.env.METEOR_WATCH_PRIORITIZE_CHANGED);
// Default to prioritizing changed files, but disable that behavior (and
// thus prioritize all files equally) if METEOR_WATCH_PRIORITIZE_CHANGED
// is explicitly set to a string that parses to a falsy value.
var PRIORITIZE_CHANGED = true;
if (process.env.METEOR_WATCH_PRIORITIZE_CHANGED &&
! JSON.parse(process.env.METEOR_WATCH_PRIORITIZE_CHANGED)) {
PRIORITIZE_CHANGED = false;
}

var DEFAULT_POLLING_INTERVAL =
~~process.env.METEOR_WATCH_POLLING_INTERVAL_MS || 5000;
Expand Down
3 changes: 3 additions & 0 deletions tools/tests/compiler-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function startRun(sandbox) {
// Tests the actual cache logic used by coffeescript.
selftest.define("compiler plugin caching - coffee", () => {
var s = new Sandbox({ fakeMongo: true });
s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

s.createApp("myapp", "caching-coffee");
s.cd("myapp");
Expand Down Expand Up @@ -91,6 +92,7 @@ selftest.define("compiler plugin caching - coffee", () => {

selftest.define("compiler plugin caching - " + packageName, () => {
var s = new Sandbox({ fakeMongo: true });
s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

s.createApp("myapp", "caching-" + packageName);
s.cd("myapp");
Expand Down Expand Up @@ -278,6 +280,7 @@ selftest.define("compiler plugin caching - local plugin", function () {
// Test error on duplicate compiler plugins.
selftest.define("compiler plugins - duplicate extension", () => {
const s = new Sandbox({ fakeMongo: true });
s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

s.createApp("myapp", "duplicate-compiler-extensions");
s.cd("myapp");
Expand Down
2 changes: 2 additions & 0 deletions tools/tests/cordova-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ selftest.define("change cordova plugins", ["cordova"], function () {
var s = new Sandbox();
var run;

s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

// Starting a run
s.createApp("myapp", "package-tests");
s.cd("myapp");
Expand Down
2 changes: 2 additions & 0 deletions tools/tests/hot-code-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ selftest.define("css hot code push", function (options) {
clients: options.clients
});

s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

s.createApp("myapp", "css-injection-test");
s.cd("myapp");
s.testWithAllClients(function (run) {
Expand Down
2 changes: 2 additions & 0 deletions tools/tests/package-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ selftest.define("change packages during hot code push", [], function () {
var s = new Sandbox();
var run;

s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

// Starting a run
s.createApp("myapp", "package-tests");
s.cd("myapp");
Expand Down
3 changes: 3 additions & 0 deletions tools/tests/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ selftest.define("run", function () {
var s = new Sandbox({ fakeMongo: true });
var run;

s.set("METEOR_WATCH_PRIORITIZE_CHANGED", "false");

// Starting a run
s.createApp("myapp", "standard-app");
s.cd("myapp");
Expand Down Expand Up @@ -287,6 +289,7 @@ selftest.define("update during run", ["checkout", 'custom-warehouse'], function
run.tellMongo(MONGO_LISTENING);
run.waitSecs(2);
run.match('localhost:3000');
run.waitSecs(10);
s.write('.meteor/release', DEFAULT_RELEASE_TRACK + '@v2');
s.write('empty.js', '');
run.waitSecs(2);
Expand Down