<commit_before>var selftest = require('../selftest.js');
var Sandbox = selftest.Sandbox;
var Run = selftest.Run;
var path = require('path');
var files = require('../files.js');

// This runs an old-style unit test. These are just .js files that
// require() whatever bits of the tool they want to test and have at
// them. They exit with 0 on success or something else on failure, and
// they are very chatty about logging their progress to stdout/stderr.
//
// filename is interpreted relative to tools/selftests/old.
var runOldTest = function (filename) {
  var run = new Run(process.execPath, {
    args: [path.resolve(__dirname, 'old', filename)]
  });
  run.waitSecs(1000);
  run.expectExit(0);
};

selftest.define("watch", ["slow"], function () {
  runOldTest('test-watch.js');
});

selftest.define("bundler-assets", function () {
  runOldTest('test-bundler-assets.js');
});

selftest.define("bundler-options", function () {
  runOldTest('test-bundler-options.js');
});

selftest.define("bundler-npm", ["slow"], function () {
  runOldTest('test-bundler-npm.js');
});

// This last one's is a shell script!
// XXX pardon the hacky glue to make it work with a sandbox

// If we're running from a checkout, run it both in checkout mode and
// in release mode. If we're not running from a checkout, just run it
// against the installed copy.

selftest.define("old cli tests", ["slow"], function () {
  var s = new Sandbox;
  var run = new Run(path.join(__dirname, 'old', 'cli-test.sh'), {
    env: {
      METEOR_TOOL_PATH: s.execPath
    }
  });
  run.waitSecs(1000);
  run.match("PASSED\n");
  run.expectExit(0);
});

selftest.define("old cli tests (warehouse)", ["slow", "checkout"], function () {
  var s = new Sandbox({
    warehouse: {
      v1: { tools: 'tools1', latest: true }
    }
  });

  var run = new Run(path.join(__dirname, 'old', 'cli-test.sh'), {
    env: {
      METEOR_TOOL_PATH: s.execPath,
      METEOR_WAREHOUSE_DIR: s.warehouse
    }
  });
  run.waitSecs(1000);
  run.match("PASSED\n");
  run.expectExit(0);
});
<commit_msg>Add 'net' tag to some 'slow' tags that use npm<commit_after>var selftest = require('../selftest.js');
var Sandbox = selftest.Sandbox;
var Run = selftest.Run;
var path = require('path');
var files = require('../files.js');

// This runs an old-style unit test. These are just .js files that
// require() whatever bits of the tool they want to test and have at
// them. They exit with 0 on success or something else on failure, and
// they are very chatty about logging their progress to stdout/stderr.
//
// filename is interpreted relative to tools/selftests/old.
var runOldTest = function (filename) {
  var run = new Run(process.execPath, {
    args: [path.resolve(__dirname, 'old', filename)]
  });
  run.waitSecs(1000);
  run.expectExit(0);
};

selftest.define("watch", ["slow"], function () {
  runOldTest('test-watch.js');
});

selftest.define("bundler-assets", function () {
  runOldTest('test-bundler-assets.js');
});

selftest.define("bundler-options", function () {
  runOldTest('test-bundler-options.js');
});

selftest.define("bundler-npm", ["slow", "net"], function () {
  runOldTest('test-bundler-npm.js');
});

// This last one's is a shell script!
// XXX pardon the hacky glue to make it work with a sandbox

// If we're running from a checkout, run it both in checkout mode and
// in release mode. If we're not running from a checkout, just run it
// against the installed copy.

selftest.define("old cli tests", ["slow", "net"], function () {
  var s = new Sandbox;
  var run = new Run(path.join(__dirname, 'old', 'cli-test.sh'), {
    env: {
      METEOR_TOOL_PATH: s.execPath
    }
  });
  run.waitSecs(1000);
  run.match("PASSED\n");
  run.expectExit(0);
});

selftest.define("old cli tests (warehouse)", ["slow", "checkout", "net"], function () {
  var s = new Sandbox({
    warehouse: {
      v1: { tools: 'tools1', latest: true }
    }
  });

  var run = new Run(path.join(__dirname, 'old', 'cli-test.sh'), {
    env: {
      METEOR_TOOL_PATH: s.execPath,
      METEOR_WAREHOUSE_DIR: s.warehouse
    }
  });
  run.waitSecs(1000);
  run.match("PASSED\n");
  run.expectExit(0);
});

{'fraction_non_alphanumeric': 0.1629754453538758, 'fraction_numerical': 0.008666345690900338, 'mean_word_length': 3.621802002224694, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2085653', 'n_tokens_mistral': 1447, 'n_tokens_neox': 1402, 'n_words': 408}