Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
testRunner.js391 linesDownload Raw Back to runner
1"use strict";2var __create = Object.create;3var __defProp = Object.defineProperty;4var __getOwnPropDesc = Object.getOwnPropertyDescriptor;5var __getOwnPropNames = Object.getOwnPropertyNames;6var __getProtoOf = Object.getPrototypeOf;7var __hasOwnProp = Object.prototype.hasOwnProperty;8var __export = (target, all) => {9  for (var name in all)10    __defProp(target, name, { get: all[name], enumerable: true });11};12var __copyProps = (to, from, except, desc) => {13  if (from && typeof from === "object" || typeof from === "function") {14    for (let key of __getOwnPropNames(from))15      if (!__hasOwnProp.call(to, key) && key !== except)16        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });17  }18  return to;19};20var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(21  // If the importer is in node compatibility mode or this is not an ESM22  // file that has been converted to a CommonJS file using a Babel-23  // compatible transform (i.e. "__esModule" has not been set), then set24  // "default" to the CommonJS "module.exports" for node compatibility.25  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,26  mod27));28var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);29var testRunner_exports = {};30__export(testRunner_exports, {31  TestRunner: () => TestRunner,32  TestRunnerEvent: () => TestRunnerEvent,33  runAllTestsWithConfig: () => runAllTestsWithConfig34});35module.exports = __toCommonJS(testRunner_exports);36var import_events = __toESM(require("events"));37var import_fs = __toESM(require("fs"));38var import_path = __toESM(require("path"));39var import_server = require("playwright-core/lib/server");40var import_utils = require("playwright-core/lib/utils");41var import_configLoader = require("../common/configLoader");42var import_fsWatcher = require("../fsWatcher");43var import_teleReceiver = require("../isomorphic/teleReceiver");44var import_gitCommitInfoPlugin = require("../plugins/gitCommitInfoPlugin");45var import_webServerPlugin = require("../plugins/webServerPlugin");46var import_base = require("../reporters/base");47var import_internalReporter = require("../reporters/internalReporter");48var import_compilationCache = require("../transform/compilationCache");49var import_util = require("../util");50var import_reporters = require("./reporters");51var import_tasks = require("./tasks");52var import_lastRun = require("./lastRun");53const TestRunnerEvent = {54  TestFilesChanged: "testFilesChanged"55};56class TestRunner extends import_events.default {57  constructor(configLocation, configCLIOverrides) {58    super();59    this._watchedProjectDirs = /* @__PURE__ */ new Set();60    this._ignoredProjectOutputs = /* @__PURE__ */ new Set();61    this._watchedTestDependencies = /* @__PURE__ */ new Set();62    this._queue = Promise.resolve();63    this._watchTestDirs = false;64    this._populateDependenciesOnList = false;65    this.configLocation = configLocation;66    this._configCLIOverrides = configCLIOverrides;67    this._watcher = new import_fsWatcher.Watcher((events) => {68      const collector = /* @__PURE__ */ new Set();69      events.forEach((f) => (0, import_compilationCache.collectAffectedTestFiles)(f.file, collector));70      this.emit(TestRunnerEvent.TestFilesChanged, [...collector]);71    });72  }73  async initialize(params) {74    (0, import_utils.setPlaywrightTestProcessEnv)();75    this._watchTestDirs = !!params.watchTestDirs;76    this._populateDependenciesOnList = !!params.populateDependenciesOnList;77  }78  resizeTerminal(params) {79    process.stdout.columns = params.cols;80    process.stdout.rows = params.rows;81    process.stderr.columns = params.cols;82    process.stderr.rows = params.rows;83  }84  hasSomeBrowsers() {85    for (const browserName of ["chromium", "webkit", "firefox"]) {86      try {87        import_server.registry.findExecutable(browserName).executablePathOrDie("javascript");88        return true;89      } catch {90      }91    }92    return false;93  }94  async installBrowsers() {95    const executables = import_server.registry.defaultExecutables();96    await import_server.registry.install(executables, false);97  }98  async loadConfig() {99    const { config, error } = await this._loadConfig(this._configCLIOverrides);100    if (config)101      return config;102    throw new Error("Failed to load config: " + (error ? error.message : "Unknown error"));103  }104  async runGlobalSetup(userReporters) {105    await this.runGlobalTeardown();106    const reporter = new import_internalReporter.InternalReporter(userReporters);107    const config = await this._loadConfigOrReportError(reporter, this._configCLIOverrides);108    if (!config)109      return { status: "failed" };110    const { status, cleanup } = await (0, import_tasks.runTasksDeferCleanup)(new import_tasks.TestRun(config, reporter), [111      ...(0, import_tasks.createGlobalSetupTasks)(config)112    ]);113    if (status !== "passed")114      await cleanup();115    else116      this._globalSetup = { cleanup };117    return { status };118  }119  async runGlobalTeardown() {120    const globalSetup = this._globalSetup;121    const status = await globalSetup?.cleanup();122    this._globalSetup = void 0;123    return { status };124  }125  async startDevServer(userReporter, mode) {126    await this.stopDevServer();127    const reporter = new import_internalReporter.InternalReporter([userReporter]);128    const config = await this._loadConfigOrReportError(reporter);129    if (!config)130      return { status: "failed" };131    const { status, cleanup } = await (0, import_tasks.runTasksDeferCleanup)(new import_tasks.TestRun(config, reporter), [132      ...(0, import_tasks.createPluginSetupTasks)(config),133      (0, import_tasks.createLoadTask)(mode, { failOnLoadErrors: true, filterOnly: false }),134      (0, import_tasks.createStartDevServerTask)()135    ]);136    if (status !== "passed")137      await cleanup();138    else139      this._devServer = { cleanup };140    return { status };141  }142  async stopDevServer() {143    const devServer = this._devServer;144    const status = await devServer?.cleanup();145    this._devServer = void 0;146    return { status };147  }148  async clearCache(userReporter) {149    const reporter = new import_internalReporter.InternalReporter(userReporter ? [userReporter] : []);150    const config = await this._loadConfigOrReportError(reporter);151    if (!config)152      return { status: "failed" };153    const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), [154      ...(0, import_tasks.createPluginSetupTasks)(config),155      (0, import_tasks.createClearCacheTask)(config)156    ]);157    return { status };158  }159  async listFiles(userReporter, projects) {160    const reporter = new import_internalReporter.InternalReporter([userReporter]);161    const config = await this._loadConfigOrReportError(reporter);162    if (!config)163      return { status: "failed" };164    config.cliProjectFilter = projects?.length ? projects : void 0;165    const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), [166      (0, import_tasks.createListFilesTask)(),167      (0, import_tasks.createReportBeginTask)()168    ]);169    return { status };170  }171  async listTests(userReporter, params) {172    let result;173    this._queue = this._queue.then(async () => {174      const { config, status } = await this._innerListTests(userReporter, params);175      if (config)176        await this._updateWatchedDirs(config);177      result = { status };178    }).catch(printInternalError);179    await this._queue;180    return result;181  }182  async _innerListTests(userReporter, params) {183    const overrides = {184      ...this._configCLIOverrides,185      repeatEach: 1,186      retries: 0187    };188    const reporter = new import_internalReporter.InternalReporter([userReporter]);189    const config = await this._loadConfigOrReportError(reporter, overrides);190    if (!config)191      return { status: "failed" };192    config.cliArgs = params.locations || [];193    config.cliGrep = params.grep;194    config.cliGrepInvert = params.grepInvert;195    config.cliProjectFilter = params.projects?.length ? params.projects : void 0;196    config.cliListOnly = true;197    const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), [198      (0, import_tasks.createLoadTask)("out-of-process", { failOnLoadErrors: false, filterOnly: false, populateDependencies: this._populateDependenciesOnList }),199      (0, import_tasks.createReportBeginTask)()200    ]);201    return { config, status };202  }203  async _updateWatchedDirs(config) {204    this._watchedProjectDirs = /* @__PURE__ */ new Set();205    this._ignoredProjectOutputs = /* @__PURE__ */ new Set();206    for (const p of config.projects) {207      this._watchedProjectDirs.add(p.project.testDir);208      this._ignoredProjectOutputs.add(p.project.outputDir);209    }210    const result = await resolveCtDirs(config);211    if (result) {212      this._watchedProjectDirs.add(result.templateDir);213      this._ignoredProjectOutputs.add(result.outDir);214    }215    if (this._watchTestDirs)216      await this._updateWatcher(false);217  }218  async _updateWatcher(reportPending) {219    await this._watcher.update([...this._watchedProjectDirs, ...this._watchedTestDependencies], [...this._ignoredProjectOutputs], reportPending);220  }221  async runTests(userReporter, params) {222    let result = { status: "passed" };223    this._queue = this._queue.then(async () => {224      result = await this._innerRunTests(userReporter, params).catch((e) => {225        printInternalError(e);226        return { status: "failed" };227      });228    });229    await this._queue;230    return result;231  }232  async _innerRunTests(userReporter, params) {233    await this.stopTests();234    const overrides = {235      ...this._configCLIOverrides,236      repeatEach: 1,237      retries: 0,238      timeout: params.timeout,239      preserveOutputDir: true,240      reporter: params.reporters ? params.reporters.map((r) => [r]) : void 0,241      use: {242        ...this._configCLIOverrides.use,243        ...params.trace === "on" ? { trace: { mode: "on", sources: false, _live: true } } : {},244        ...params.trace === "off" ? { trace: "off" } : {},245        ...params.video === "on" || params.video === "off" ? { video: params.video } : {},246        ...params.headed !== void 0 ? { headless: !params.headed } : {},247        _optionContextReuseMode: params.reuseContext ? "when-possible" : void 0,248        _optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : void 0249      },250      ...params.updateSnapshots ? { updateSnapshots: params.updateSnapshots } : {},251      ...params.updateSourceMethod ? { updateSourceMethod: params.updateSourceMethod } : {},252      ...params.workers ? { workers: params.workers } : {}253    };254    if (params.trace === "on")255      process.env.PW_LIVE_TRACE_STACKS = "1";256    else257      process.env.PW_LIVE_TRACE_STACKS = void 0;258    const config = await this._loadConfigOrReportError(new import_internalReporter.InternalReporter([userReporter]), overrides);259    if (!config)260      return { status: "failed" };261    config.cliListOnly = false;262    config.cliPassWithNoTests = true;263    config.cliArgs = params.locations || [];264    config.cliGrep = params.grep;265    config.cliGrepInvert = params.grepInvert;266    config.cliProjectFilter = params.projects?.length ? params.projects : void 0;267    config.preOnlyTestFilters = [];268    if (params.testIds) {269      const testIdSet = new Set(params.testIds);270      config.preOnlyTestFilters.push((test) => testIdSet.has(test.id));271    }272    const configReporters = params.disableConfigReporters ? [] : await (0, import_reporters.createReporters)(config, "test", true);273    const reporter = new import_internalReporter.InternalReporter([...configReporters, userReporter]);274    const stop = new import_utils.ManualPromise();275    const tasks = [276      (0, import_tasks.createApplyRebaselinesTask)(),277      (0, import_tasks.createLoadTask)("out-of-process", { filterOnly: true, failOnLoadErrors: !!params.failOnLoadErrors, doNotRunDepsOutsideProjectFilter: params.doNotRunDepsOutsideProjectFilter }),278      ...(0, import_tasks.createRunTestsTasks)(config)279    ];280    const testRun = new import_tasks.TestRun(config, reporter, { pauseOnError: params.pauseOnError, pauseAtEnd: params.pauseAtEnd });281    const run = (0, import_tasks.runTasks)(testRun, tasks, 0, stop).then(async (status) => {282      this._testRun = void 0;283      return status;284    });285    this._testRun = { run, stop };286    return { status: await run };287  }288  async watch(fileNames) {289    this._watchedTestDependencies = /* @__PURE__ */ new Set();290    for (const fileName of fileNames) {291      this._watchedTestDependencies.add(fileName);292      (0, import_compilationCache.dependenciesForTestFile)(fileName).forEach((file) => this._watchedTestDependencies.add(file));293    }294    await this._updateWatcher(true);295  }296  async findRelatedTestFiles(files, userReporter) {297    const errorReporter = (0, import_reporters.createErrorCollectingReporter)(import_base.internalScreen);298    const reporter = new import_internalReporter.InternalReporter(userReporter ? [userReporter, errorReporter] : [errorReporter]);299    const config = await this._loadConfigOrReportError(reporter);300    if (!config)301      return { errors: errorReporter.errors(), testFiles: [] };302    const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), [303      ...(0, import_tasks.createPluginSetupTasks)(config),304      (0, import_tasks.createLoadTask)("out-of-process", { failOnLoadErrors: true, filterOnly: false, populateDependencies: true })305    ]);306    if (status !== "passed")307      return { errors: errorReporter.errors(), testFiles: [] };308    return { testFiles: (0, import_compilationCache.affectedTestFiles)(files) };309  }310  async stopTests() {311    this._testRun?.stop?.resolve();312    await this._testRun?.run;313  }314  async closeGracefully() {315    (0, import_utils.gracefullyProcessExitDoNotHang)(0);316  }317  async stop() {318    await this.runGlobalTeardown();319  }320  async _loadConfig(overrides) {321    try {322      const config = await (0, import_configLoader.loadConfig)(this.configLocation, overrides);323      if (!this._plugins) {324        (0, import_webServerPlugin.webServerPluginsForConfig)(config).forEach((p) => config.plugins.push({ factory: p }));325        (0, import_gitCommitInfoPlugin.addGitCommitInfoPlugin)(config);326        this._plugins = config.plugins || [];327      } else {328        config.plugins.splice(0, config.plugins.length, ...this._plugins);329      }330      return { config };331    } catch (e) {332      return { config: null, error: (0, import_util.serializeError)(e) };333    }334  }335  async _loadConfigOrReportError(reporter, overrides) {336    const { config, error } = await this._loadConfig(overrides);337    if (config)338      return config;339    reporter.onConfigure(import_teleReceiver.baseFullConfig);340    reporter.onError(error);341    await reporter.onEnd({ status: "failed" });342    await reporter.onExit();343    return null;344  }345}346function printInternalError(e) {347  console.error("Internal error:", e);348}349async function resolveCtDirs(config) {350  const use = config.config.projects[0].use;351  const relativeTemplateDir = use.ctTemplateDir || "playwright";352  const templateDir = await import_fs.default.promises.realpath(import_path.default.normalize(import_path.default.join(config.configDir, relativeTemplateDir))).catch(() => void 0);353  if (!templateDir)354    return null;355  const outDir = use.ctCacheDir ? import_path.default.resolve(config.configDir, use.ctCacheDir) : import_path.default.resolve(templateDir, ".cache");356  return {357    outDir,358    templateDir359  };360}361async function runAllTestsWithConfig(config) {362  (0, import_utils.setPlaywrightTestProcessEnv)();363  const listOnly = config.cliListOnly;364  (0, import_gitCommitInfoPlugin.addGitCommitInfoPlugin)(config);365  (0, import_webServerPlugin.webServerPluginsForConfig)(config).forEach((p) => config.plugins.push({ factory: p }));366  const reporters = await (0, import_reporters.createReporters)(config, listOnly ? "list" : "test", false);367  const lastRun = new import_lastRun.LastRunReporter(config);368  if (config.cliLastFailed)369    await lastRun.filterLastFailed();370  const reporter = new import_internalReporter.InternalReporter([...reporters, lastRun]);371  const tasks = listOnly ? [372    (0, import_tasks.createLoadTask)("in-process", { failOnLoadErrors: true, filterOnly: false }),373    (0, import_tasks.createReportBeginTask)()374  ] : [375    (0, import_tasks.createApplyRebaselinesTask)(),376    ...(0, import_tasks.createGlobalSetupTasks)(config),377    (0, import_tasks.createLoadTask)("in-process", { filterOnly: true, failOnLoadErrors: true }),378    ...(0, import_tasks.createRunTestsTasks)(config)379  ];380  const status = await (0, import_tasks.runTasks)(new import_tasks.TestRun(config, reporter), tasks, config.config.globalTimeout);381  await new Promise((resolve) => process.stdout.write("", () => resolve()));382  await new Promise((resolve) => process.stderr.write("", () => resolve()));383  return status;384}385// Annotate the CommonJS export names for ESM import in node:3860 && (module.exports = {387  TestRunner,388  TestRunnerEvent,389  runAllTestsWithConfig390});391 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai