Skip to content

Commit

Permalink
Import test-version-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalideshpandemsft committed Nov 1, 2024
1 parent 99fc851 commit 081460f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"test": "npm run test:realsvc",
"test:coverage": "c8 npm test",
"test:realsvc": "npm run test:realsvc:tinylicious",
"test:realsvc:azure": "cross-env FLUID_CLIENT=azure npm run test:realsvc:azure:run -- --driver r11s --r11sEndpointName frs",
"test:realsvc:azure": "cross-env FLUID_CLIENT=azure npm run test:realsvc:azure:run -- --driver=r11s --r11sEndpointName=frs",
"test:realsvc:azure:run": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit --timeout 20000 --config src/test/.mocharc.cjs",
"test:realsvc:run": "mocha lib/test --config src/test/.mocharc.cjs",
"test:realsvc:tinylicious": "start-server-and-test start:tinylicious:test 7071 test:realsvc:tinylicious:run",
"test:realsvc:tinylicious:report": "npm run test:realsvc:tinylicious",
"test:realsvc:tinylicious:run": "npm run test:realsvc:azure:run -- --driver t9s",
"test:realsvc:tinylicious:run": "npm run test:realsvc:azure:run -- --driver=t9s",
"test:realsvc:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:realsvc"
},
"c8": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@
"use strict";

const packageDir = `${__dirname}/../..`;
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
const getFluidTestMochaConfig = require("@fluid-private/test-version-utils/mocharc-common");
const config = getFluidTestMochaConfig(packageDir);

const args = process.argv.slice(2);
// const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");

function getFluidTestVariant() {
const driverIndex = args.indexOf("--driver");
const endpointIndex = args.indexOf("--r11sEndpointName");
// const args = process.argv.slice(2);

const testDriver = driverIndex !== -1 ? args[driverIndex + 1] : "";
const endpointName = endpointIndex !== -1 ? args[endpointIndex + 1] : "";
// function getFluidTestVariant() {
// const driverIndex = args.indexOf("--driver");
// const endpointIndex = args.indexOf("--r11sEndpointName");

return `${testDriver}-${endpointName}`;
}
// const testDriver = driverIndex !== -1 ? args[driverIndex + 1] : "";
// const endpointName = endpointIndex !== -1 ? args[endpointIndex + 1] : "";

function getFluidTestMocha(packageDir, additionalRequiredModules = []) {
const testVariant = getFluidTestVariant();
process.env.FLUID_TEST_VARIANT = testVariant;
// return `${testDriver}-${endpointName}`;
// }

return getFluidTestMochaConfig(packageDir, additionalRequiredModules, testVariant);
}
// function getFluidTestMocha(packageDir, additionalRequiredModules = []) {
// const testVariant = getFluidTestVariant();
// process.env.FLUID_TEST_VARIANT = testVariant;

module.exports = getFluidTestMocha(packageDir);
// return getFluidTestMochaConfig(packageDir, additionalRequiredModules, testVariant);
// }

// module.exports = getFluidTestMocha(packageDir);

module.exports = config;
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"format:prettier": "prettier --write . --cache --ignore-path ../../../../.prettierignore",
"lint": "fluid-build . --task lint",
"lint:fix": "fluid-build . --task eslint:fix --task format",
"test": "npm run test:realsvc:odsp:run -- --driver odsp --odspEndpointName odsp",
"test": "npm run test:realsvc:odsp:run",
"test:coverage": "c8 npm test",
"test:realsvc:odsp": "cross-env npm run test:realsvc:odsp:run",
"test:realsvc:odsp": "cross-env npm run test:realsvc:odsp:run -- --driver=odsp --odspEndpointName=odsp",
"test:realsvc:odsp:run": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit --timeout 20000 --config src/test/.mocharc.cjs",
"test:realsvc:run": "mocha --recursive \"lib/test/**/*.spec.*js\"",
"test:realsvc:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:realsvc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@
"use strict";

const packageDir = __dirname;
const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");
const getFluidTestMochaConfig = require("@fluid-private/test-version-utils/mocharc-common");
const config = getFluidTestMochaConfig(packageDir);

const args = process.argv.slice(2);
// const getFluidTestMochaConfig = require("@fluid-internal/mocha-test-setup/mocharc-common");

function getFluidTestVariant() {
const driverIndex = args.indexOf("--driver");
const endpointIndex = args.indexOf("--odspEndpointName");
// const args = process.argv.slice(2);

const testDriver = driverIndex !== -1 ? args[driverIndex + 1] : "";
const endpointName = endpointIndex !== -1 ? args[endpointIndex + 1] : "";
// function getFluidTestVariant() {
// const driverIndex = args.indexOf("--driver");
// const endpointIndex = args.indexOf("--odspEndpointName");

return `${testDriver}-${endpointName}`;
}
// const testDriver = driverIndex !== -1 ? args[driverIndex + 1] : "";
// const endpointName = endpointIndex !== -1 ? args[endpointIndex + 1] : "";

function getFluidTestMocha(packageDir, additionalRequiredModules = []) {
const testVariant = getFluidTestVariant();
process.env.FLUID_TEST_VARIANT = testVariant;
// return `${testDriver}-${endpointName}`;
// }

return getFluidTestMochaConfig(packageDir, additionalRequiredModules, testVariant);
}
// function getFluidTestMocha(packageDir, additionalRequiredModules = []) {
// const testVariant = getFluidTestVariant();
// process.env.FLUID_TEST_VARIANT = testVariant;

module.exports = getFluidTestMocha(packageDir);
// return getFluidTestMochaConfig(packageDir, additionalRequiredModules, testVariant);
// }

// module.exports = getFluidTestMocha(packageDir);

module.exports = config;

0 comments on commit 081460f

Please sign in to comment.