Skip to content
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
8 changes: 6 additions & 2 deletions packages/dds/sequence/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@
},
"fluidBuild": {
"tasks": {
"build:test": [
"build:test:cjs": [
"...",
"@fluidframework/merge-tree#build:test"
"@fluidframework/merge-tree#build:test:cjs"
],
"build:test:esm": [
"...",
"@fluidframework/merge-tree#build:test:esm"
]
}
},
Expand Down
3 changes: 3 additions & 0 deletions packages/test/local-server-stress-tests/.mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");

const config = getFluidTestMochaConfig(__dirname);
config.spec = "lib/test/**/*.spec.*js";
// Explicit exit is used to cut off any dangling GC / summarizer workloads.
config.exit = true;
module.exports = config;
2 changes: 1 addition & 1 deletion packages/test/local-server-stress-tests/eslint.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const config: Linter.Config[] = [
languageOptions: {
parserOptions: {
projectService: false,
project: ["./src/tsconfig.json"],
project: ["./src/test/tsconfig.json"],
},
},
},
Expand Down
34 changes: 18 additions & 16 deletions packages/test/local-server-stress-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"type": "commonjs",
"type": "module",
"scripts": {
"build": "fluid-build . --task build",
"build:compile": "fluid-build . --task compile",
"build:test": "tsc --project ./src/tsconfig.json",
"build:test": "npm run build:test:esm",
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
"check:biome": "biome check .",
"check:format": "npm run check:biome",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" nyc",
Expand All @@ -28,7 +29,8 @@
"lint:fix": "fluid-build . --task eslint:fix --task format",
"test": "npm run test:mocha",
"test:coverage": "c8 npm test",
"test:mocha": "mocha \"lib/test/**/*.spec.*js\" --exit",
"test:mocha": "npm run test:mocha:esm",
"test:mocha:esm": "mocha",
Comment thread
MarioJGMsoft marked this conversation as resolved.
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
},
"c8": {
Expand Down Expand Up @@ -107,19 +109,19 @@
},
"fluidBuild": {
"tasks": {
"build:test": [
"^tsc",
"^api-extractor:commonjs",
"@fluidframework/id-compressor#build:test",
"@fluidframework/sequence#build:test",
"@fluidframework/map#build:test",
"@fluidframework/matrix#build:test",
"@fluidframework/tree#build:test",
"@fluidframework/task-manager#build:test",
"@fluidframework/legacy-dds#build:test",
"@fluidframework/ordered-collection#build:test",
"@fluidframework/counter#build:test",
"@fluidframework/register-collection#build:test"
"build:test:esm": [
"^build:esnext",
"^api-extractor:esnext",
"@fluidframework/id-compressor#build:test:esm",
"@fluidframework/sequence#build:test:esm",
"@fluidframework/map#build:test:esm",
"@fluidframework/matrix#build:test:esm",
"@fluidframework/tree#build:test:esm",
"@fluidframework/task-manager#build:test:esm",
"@fluidframework/legacy-dds#build:test:esm",
"@fluidframework/ordered-collection#build:test:esm",
"@fluidframework/counter#build:test:esm",
"@fluidframework/register-collection#build:test:esm"
]
}
},
Expand Down
15 changes: 0 additions & 15 deletions packages/test/local-server-stress-tests/src/dirname.cts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import * as path from "node:path";
import { fileURLToPath } from "node:url";

import {
type AsyncGenerator,
Expand All @@ -24,13 +25,12 @@ import {
loadAllHandles,
type DDSModelOp,
type OrderSequentially,
} from "./ddsOperations";
import { _dirname } from "./dirname.cjs";
} from "./ddsOperations.js";
import {
createWeightedAsyncGeneratorWithDynamicWeights,
type DynamicAsyncWeights,
} from "./dynamicWeightGenerator.js";
import type { LocalServerStressState } from "./localServerStressHarness";
import type { LocalServerStressState } from "./localServerStressHarness.js";
import type { StressDataObjectOperations } from "./stressDataObject.js";

export type StressOperations = StressDataObjectOperations | DDSModelOp | OrderSequentially;
Expand Down Expand Up @@ -246,9 +246,14 @@ export function makeGenerator<T extends BaseOperation>(
return op;
};
}
export const saveFailures = { directory: path.join(_dirname, "../src/test/results") };
export const saveSuccesses = { directory: path.join(_dirname, "../src/test/results") };
export const saveFluidOps = { directory: path.join(_dirname, "../src/test/results") };

const srcResultsPath = path.join(
path.dirname(fileURLToPath(import.meta.url)),
"../../src/test/results",
);
export const saveFailures = { directory: srcResultsPath };
export const saveSuccesses = { directory: srcResultsPath };
export const saveFluidOps = { directory: srcResultsPath };

export const ddsModelMinimizers: MinimizationTransform<BaseOperation>[] = [
...ddsModelMap.entries(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { assert } from "@fluidframework/core-utils/internal";

import type { Client } from "./localServerStressHarness";
import type { Client } from "./localServerStressHarness.js";

export const validateAllDataStoresSaved = async (...clients: Client[]): Promise<void> => {
for (const client of clients) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {
reducer,
saveFailures,
type StressOperations,
} from "../baseModel.js";
import { validateAllDataStoresSaved } from "../dataStoreOperations.js";
import { validateConsistencyOfAllDDS } from "../ddsOperations";
} from "./baseModel.js";
import { validateAllDataStoresSaved } from "./dataStoreOperations.js";
import { validateConsistencyOfAllDDS } from "./ddsOperations.js";
import {
createLocalServerStressSuite,
LocalServerStressModel,
} from "../localServerStressHarness";
} from "./localServerStressHarness.js";

describe("Local Server Stress", () => {
const model: LocalServerStressModel<StressOperations> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../../../../common/build/build-common/tsconfig.test.node16.json",
"extends": "../../../../../common/build/build-common/tsconfig.test.node16.json",
"compilerOptions": {
"rootDir": "./",
"outDir": "../lib",
"outDir": "../../lib/test",
"types": ["mocha", "node"],
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false,
Expand Down
1 change: 1 addition & 0 deletions packages/test/local-server-tests/.mocharc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");

const config = getFluidTestMochaConfig(__dirname);
config.spec = "lib/test/**/*.spec.*js";
// TODO: figure out why this package needs the --exit flag, tests might not be cleaning up correctly after themselves
// AB#7856
config.exit = true;
Expand Down
14 changes: 8 additions & 6 deletions packages/test/local-server-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
"license": "MIT",
"author": "Microsoft and contributors",
"sideEffects": false,
"type": "commonjs",
"type": "module",
"scripts": {
"build": "fluid-build . --task build",
"build:compile": "fluid-build . --task compile",
"build:test": "tsc --project ./src/test/tsconfig.json",
"build:test": "npm run build:test:esm",
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
"check:biome": "biome check .",
"check:format": "npm run check:biome",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" nyc",
Expand All @@ -28,7 +29,8 @@
"lint:fix": "fluid-build . --task eslint:fix --task format",
"test": "npm run test:mocha",
"test:coverage": "c8 npm test",
"test:mocha": "mocha \"lib/test/**/*.spec.*js\"",
"test:mocha": "npm run test:mocha:esm",
"test:mocha:esm": "mocha",
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha"
},
"c8": {
Expand Down Expand Up @@ -100,9 +102,9 @@
},
"fluidBuild": {
"tasks": {
"build:test": [
"^tsc",
"^api-extractor:commonjs"
"build:test:esm": [
"^build:esnext",
"^api-extractor:esnext"
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
type TestFluidObject,
} from "@fluidframework/test-utils/internal";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

const toComparableArray = (map: ISharedMap): [string, unknown][] =>
[...map.entries()].map(([key, value]) => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "@fluidframework/server-local-server";
import type { ITestFluidObject } from "@fluidframework/test-utils/internal";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

function createDSFWithOutOfBandCreate({
deltaConnectionServer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
type ITestFluidObject,
} from "@fluidframework/test-utils/internal";

import { createLoader } from "../utils";
import { createLoader } from "./utils.js";

/**
* Creates a non-root data object and validates that it is not visible from the root of the container.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
type TestFluidObject,
} from "@fluidframework/test-utils/internal";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

const toComparableArray = (dir: ISharedMap): [string, unknown][] =>
[...dir.entries()].map(([key, value]) => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
getRequiredPendingLocalState,
} from "@fluidframework/test-utils/internal";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

describe("PendingLocalStateStore End-to-End Tests", () => {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/test/local-server-tests/src/test/readonly.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { SharedMap, ISharedMap } from "@fluidframework/map/internal";
import type { IFluidDataStoreFactory } from "@fluidframework/runtime-definitions/internal";
import { LocalDeltaConnectionServer } from "@fluidframework/server-local-server";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

const mapFactory = SharedMap.getFactory();
const sharedObjectRegistry = new Map<string, IChannelFactory>([[mapFactory.type, mapFactory]]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import type { SharedObject } from "@fluidframework/shared-object-base/internal";
import { LoggingError, wrapError } from "@fluidframework/telemetry-utils/internal";
import sinon from "sinon";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

/**
* A DataObject implementation that is used to test Staging Mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
import { isFluidHandle } from "@fluidframework/runtime-utils/internal";
import { LocalDeltaConnectionServer } from "@fluidframework/server-local-server";

import { createLoader } from "../utils.js";
import { createLoader } from "./utils.js";

const mapFactory = SharedMap.getFactory();
const sharedObjectRegistry = new Map<string, IChannelFactory>([[mapFactory.type, mapFactory]]);
Expand Down
4 changes: 2 additions & 2 deletions packages/test/local-server-tests/src/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "../../../../../common/build/build-common/tsconfig.test.node16.json",
"compilerOptions": {
"rootDir": "../",
"outDir": "../../lib",
"rootDir": "./",
"outDir": "../../lib/test",
"types": ["mocha"],
"noUncheckedIndexedAccess": false,
"exactOptionalPropertyTypes": false,
Expand Down
Loading