Skip to content

Commit

Permalink
fix some testing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 6, 2025
1 parent a6a729b commit b70c35b
Show file tree
Hide file tree
Showing 9 changed files with 544 additions and 66 deletions.
8 changes: 4 additions & 4 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ export async function initializeClients(
// each client can only register once
// and if we want two we can explicitly support it
const clients: ClientInstance[] = [];
const clientTypes = clients.map((c) => c.name);
elizaLogger.log("initializeClients", clientTypes, "for", character.name);
// const clientTypes = clients.map((c) => c.name);
// elizaLogger.log("initializeClients", clientTypes, "for", character.name);

// Start Auto Client if "auto" detected as a configured client
// if (clientTypes.includes(Clients.AUTO)) {
Expand Down Expand Up @@ -1106,8 +1106,8 @@ async function findDatabaseAdapter(runtime: AgentRuntime) {
} else if (adapters.length === 1) {
adapter = adapters[0];
} else {
throw new Error("Multiple database adapters found: " + adapters.map(a => a.name).join(", ") + '. You must have no more than one. Adjust your plugins configuration.');
}
throw new Error("Multiple database adapters found. You must have no more than one. Adjust your plugins configuration.");
}
const adapterInterface = adapter?.init(runtime);
return adapterInterface;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-sqlite/__tests__/sqlite-adapter.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { type UUID } from '@elizaos/core';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { SqliteDatabaseAdapter } from '../src';
import { type UUID, elizaLogger } from '@elizaos/core';
import type Database from 'better-sqlite3';
import { load } from '../src/sqlite_vec';
import { Database } from 'better-sqlite3';

// Mock the elizaLogger
vi.mock('@elizaos/core', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-sqlite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { sqliteTables } from "./sqliteTables.ts";

import Database from "better-sqlite3";

class SqliteDatabaseAdapter
export class SqliteDatabaseAdapter
extends DatabaseAdapter<BetterSqlite3Database>
implements IDatabaseCacheAdapter
{
Expand Down
52 changes: 0 additions & 52 deletions packages/core/__tests__/defaultCharacters.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/__tests__/embedding.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getEmbeddingType,
getEmbeddingZeroVector,
} from "../src/embedding.ts";
import { type IAgentRuntime, ModelProviderName } from "../types.ts";
import { type IAgentRuntime, ModelProviderName } from "../src/types.ts";
import settings from "../src/settings.ts";

// Mock environment-related settings
Expand Down
4 changes: 2 additions & 2 deletions packages/core/__tests__/environment.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, beforeEach, afterEach } from "vitest";
import { validateEnv, validateCharacterConfig } from "../src/environment";
import { Clients, ModelProviderName } from "../src/types";
import { ModelProviderName } from "../src/types";

describe("Environment Configuration", () => {
const originalEnv = process.env;
Expand Down Expand Up @@ -77,7 +77,7 @@ describe("Character Configuration", () => {
postExamples: ["Test post"],
topics: ["topic1"],
adjectives: ["friendly"],
clients: [Clients.DISCORD],
clients: ["discord"],
plugins: ["test-plugin"],
style: {
all: ["style1"],
Expand Down
Loading

0 comments on commit b70c35b

Please sign in to comment.