@backstage/cli-module-test-jest 0.1.0 → 0.1.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @backstage/cli-module-test-jest
|
|
2
2
|
|
|
3
|
+
## 0.1.1-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2e5c5f8: Bumped `glob` dependency from v7/v8/v11 to v13 to address security vulnerabilities in older versions. Bumped `rollup` from v4.27 to v4.59+ to fix a high severity path traversal vulnerability (GHSA-mw96-cpmx-2vgc).
|
|
8
|
+
- 6cc4811: Minor error message update
|
|
9
|
+
|
|
10
|
+
## 0.1.1-next.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @backstage/cli-common@0.2.1-next.0
|
|
16
|
+
- @backstage/cli-node@0.3.1-next.0
|
|
17
|
+
|
|
3
18
|
## 0.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/config/jest.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
const fs = require('fs-extra');
|
|
18
18
|
const path = require('node:path');
|
|
19
19
|
const crypto = require('node:crypto');
|
|
20
|
-
const glob = require('
|
|
20
|
+
const { glob } = require('glob');
|
|
21
21
|
const { version } = require('../package.json');
|
|
22
22
|
const paths = require('@backstage/cli-common').findPaths(process.cwd());
|
|
23
23
|
const {
|
|
@@ -367,7 +367,9 @@ async function getRootConfig() {
|
|
|
367
367
|
// workspace and load those in as separate jest projects instead.
|
|
368
368
|
const projectPaths = await Promise.all(
|
|
369
369
|
workspacePatterns.map(pattern =>
|
|
370
|
-
glob(path.join(paths.targetRoot, pattern)
|
|
370
|
+
glob(path.join(paths.targetRoot, pattern), {
|
|
371
|
+
windowsPathsNoEscape: true,
|
|
372
|
+
}),
|
|
371
373
|
),
|
|
372
374
|
).then(_ => _.flat());
|
|
373
375
|
|
|
@@ -200,14 +200,14 @@ var test = async ({ args, info }) => {
|
|
|
200
200
|
if (opts.successCache) {
|
|
201
201
|
if (parsedArgs.length > 0) {
|
|
202
202
|
throw new Error(
|
|
203
|
-
`The --
|
|
203
|
+
`The --success-cache flag can not be combined with the following arguments: ${parsedArgs.join(
|
|
204
204
|
", "
|
|
205
205
|
)}`
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
208
|
if (args.includes("--shard")) {
|
|
209
209
|
throw new Error(
|
|
210
|
-
`The --
|
|
210
|
+
`The --success-cache flag can not be combined with the --shard flag`
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
213
|
const cache = cliNode.SuccessCache.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.cjs.js","sources":["../../../src/commands/repo/test.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport os from 'node:os';\nimport crypto from 'node:crypto';\nimport { cli } from 'cleye';\nimport yargs from 'yargs';\n// 'jest-cli' is included with jest and should be kept in sync with the installed jest version\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { run as runJest, yargsOptions as jestYargsOptions } from 'jest-cli';\nimport { relative as relativePath } from 'node:path';\nimport { Lockfile, PackageGraph, SuccessCache } from '@backstage/cli-node';\n\nimport {\n findOwnPaths,\n runCheck,\n runOutput,\n targetPaths,\n isChildPath,\n} from '@backstage/cli-common';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\ntype JestProject = {\n displayName: string;\n rootDir: string;\n};\n\ninterface TestGlobal extends Global {\n __backstageCli_jestSuccessCache?: {\n filterConfigs(\n projectConfigs: JestProject[],\n globalConfig: unknown,\n ): Promise<JestProject[]>;\n reportResults(results: {\n testResults: Array<{\n displayName?: { name: string };\n numFailingTests: number;\n testFilePath: string;\n testExecError: {\n message: string;\n stack: string;\n };\n failureMessage: string;\n }>;\n }): Promise<void>;\n };\n __backstageCli_watchProjectFilter?: {\n filter(projectConfigs: JestProject[]): Promise<JestProject[]>;\n };\n}\n\n/**\n * Use git to get the HEAD tree hashes of each package in the project.\n */\nasync function readPackageTreeHashes(graph: PackageGraph) {\n const pkgs = Array.from(graph.values()).map(pkg => ({\n ...pkg,\n path: relativePath(targetPaths.rootDir, pkg.dir),\n }));\n const output = await runOutput([\n 'git',\n 'ls-tree',\n '--format=%(objectname)=%(path)',\n 'HEAD',\n '--',\n ...pkgs.map(pkg => pkg.path),\n ]);\n\n const map = new Map(\n output\n .trim()\n .split(/\\r?\\n/)\n .map(line => {\n const [itemSha, ...itemPathParts] = line.split('=');\n const itemPath = itemPathParts.join('=');\n const pkg = pkgs.find(p => p.path === itemPath);\n if (!pkg) {\n throw new Error(\n `Unexpectedly missing tree sha entry for path ${itemPath}`,\n );\n }\n return [pkg.packageJson.name, itemSha];\n }),\n );\n\n return (pkgName: string) => {\n const sha = map.get(pkgName);\n if (!sha) {\n throw new Error(`Tree sha not found for ${pkgName}`);\n }\n return sha;\n };\n}\n\nexport function createFlagFinder(args: string[]) {\n const flags = new Set<string>();\n\n for (const arg of args) {\n if (arg.startsWith('--no-')) {\n flags.add(`--${arg.slice('--no-'.length)}`);\n } else if (arg.startsWith('--')) {\n flags.add(arg.split('=')[0]);\n } else if (arg.startsWith('-')) {\n const shortFlags = arg.slice(1).split('');\n for (const shortFlag of shortFlags) {\n flags.add(`-${shortFlag}`);\n }\n }\n }\n\n return (...findFlags: string[]) => {\n for (const flag of findFlags) {\n if (flags.has(flag)) {\n return true;\n }\n }\n return false;\n };\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const testGlobal = global as TestGlobal;\n\n for (const flag of ['successCache', 'successCacheDir', 'jestHelp']) {\n if (args.some(a => a === `--${flag}` || a.startsWith(`--${flag}=`))) {\n process.stderr.write(\n `DEPRECATION WARNING: --${flag} is deprecated, use the kebab-case form instead\\n`,\n );\n }\n }\n\n // Parse Backstage-specific flags; unknown flags and arguments are left in\n // args so they can be forwarded to Jest.\n const { flags: opts } = cli(\n {\n help: info,\n booleanFlagNegation: true,\n flags: {\n since: {\n type: String,\n description:\n 'Only include test packages changed since the specified ref',\n },\n successCache: {\n type: Boolean,\n description: 'Cache and skip tests for unchanged packages',\n },\n successCacheDir: {\n type: String,\n description: 'Directory for the success cache',\n },\n jestHelp: {\n type: Boolean,\n description: \"Show Jest's own help output\",\n },\n },\n ignoreArgv: type => type === 'unknown-flag' || type === 'argument',\n },\n undefined,\n args,\n );\n\n const hasFlags = createFlagFinder(args);\n const sinceRef = opts.since || undefined;\n\n // Parse the args to ensure that no file filters are provided, in which case we refuse to run\n const { _: parsedArgs } = await yargs(args).options(jestYargsOptions).argv;\n\n // Only include our config if caller isn't passing their own config\n if (!hasFlags('-c', '--config')) {\n /* eslint-disable-next-line no-restricted-syntax */\n args.push('--config', findOwnPaths(__dirname).resolve('config/jest.js'));\n }\n\n if (!hasFlags('--passWithNoTests')) {\n args.push('--passWithNoTests');\n }\n\n // Run in watch mode unless in CI, coverage mode, or running all tests\n let isSingleWatchMode = args.includes('--watch');\n if (\n !sinceRef &&\n !process.env.CI &&\n !hasFlags('--coverage', '--watch', '--watchAll')\n ) {\n const isGitRepo = () =>\n runCheck(['git', 'rev-parse', '--is-inside-work-tree']);\n const isMercurialRepo = () => runCheck(['hg', '--cwd', '.', 'root']);\n\n if ((await isGitRepo()) || (await isMercurialRepo())) {\n isSingleWatchMode = true;\n args.push('--watch');\n } else {\n args.push('--watchAll');\n }\n }\n\n // Due to our monorepo Jest project setup watch mode can be quite slow as it\n // will always scan all projects for matches. This is an optimization where if\n // the only provides filter paths from the repo root as args, we filter the\n // projects to only run tests for those.\n //\n // This does mean you're not able to edit the watch filters during the watch\n // session to point outside of the selected packages, but we consider that a\n // worthwhile tradeoff, and you can always avoid providing paths upfront.\n if (isSingleWatchMode && parsedArgs.length > 0) {\n testGlobal.__backstageCli_watchProjectFilter = {\n async filter(projectConfigs) {\n const selectedProjects = [];\n const usedArgs = new Set();\n\n for (const project of projectConfigs) {\n for (const arg of parsedArgs) {\n if (isChildPath(project.rootDir, String(arg))) {\n selectedProjects.push(project);\n usedArgs.add(arg);\n }\n }\n }\n\n // If we didn't end up using all args in the filtering we need to bail\n // and let Jest do the full filtering instead.\n if (usedArgs.size !== parsedArgs.length) {\n return projectConfigs;\n }\n\n return selectedProjects;\n },\n };\n }\n\n // When running tests from the repo root in large repos you can easily hit the heap limit.\n // This is because Jest workers leak a lot of memory, and the workaround is to limit worker memory.\n // We set a default memory limit, but if an explicit one is supplied it will be used instead\n if (!hasFlags('--workerIdleMemoryLimit')) {\n args.push('--workerIdleMemoryLimit=1000M');\n }\n\n // In order for the above worker memory limit to work we need to make sure the worker\n // count is set to at least 2, as the tests will otherwise run in-band.\n // Depending on the mode tests are run with the default count is either cpus-1, or cpus/2.\n // This means that if we've got at 4 or more cores we'll always get at least 2 workers, but\n // otherwise we need to set the worker count explicitly unless already done.\n if (\n os.cpus().length <= 3 &&\n !hasFlags('-i', '--runInBand', '-w', '--maxWorkers')\n ) {\n args.push('--maxWorkers=2');\n }\n\n let packageGraph: PackageGraph | undefined;\n async function getPackageGraph() {\n if (packageGraph) {\n return packageGraph;\n }\n const packages = await PackageGraph.listTargetPackages();\n packageGraph = PackageGraph.fromPackages(packages);\n return packageGraph;\n }\n\n let selectedProjects: string[] | undefined = undefined;\n if (sinceRef && !hasFlags('--selectProjects')) {\n const graph = await getPackageGraph();\n const changedPackages = await graph.listChangedPackages({\n ref: sinceRef,\n analyzeLockfile: true,\n });\n\n selectedProjects = Array.from(\n graph.collectPackageNames(\n changedPackages.map(pkg => pkg.name),\n pkg => pkg.allLocalDependents.keys(),\n ),\n );\n\n if (selectedProjects.length === 0) {\n console.log(`No packages changed since ${opts.since}`);\n return;\n }\n\n args.push('--selectProjects', ...selectedProjects);\n }\n\n // This is the only thing that is not implemented by jest.run(), so we do it here instead\n // https://github.com/facebook/jest/blob/cd8828f7bbec6e55b4df5e41e853a5133c4a3ee1/packages/jest-cli/bin/jest.js#L12\n if (!process.env.NODE_ENV) {\n (process.env as any).NODE_ENV = 'test';\n }\n\n // This is to have a consistent timezone for when running tests that involve checking\n // the formatting of date/times.\n // https://stackoverflow.com/questions/56261381/how-do-i-set-a-timezone-in-my-jest-config\n if (!process.env.TZ) {\n process.env.TZ = 'UTC';\n }\n\n // Unless the user explicitly toggles node-snapshot, default to provide --no-node-snapshot to reduce number of steps to run scaffolder\n // on Node LTS.\n if (!process.env.NODE_OPTIONS?.includes('--node-snapshot')) {\n process.env.NODE_OPTIONS = `${\n process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ''\n }--no-node-snapshot`;\n }\n\n if (opts.jestHelp) {\n args.push('--help');\n }\n\n // This code path is enabled by the --successCache flag, which is specific to\n // the `repo test` command in the Backstage CLI.\n if (opts.successCache) {\n // Refuse to run if file filters are provided\n if (parsedArgs.length > 0) {\n throw new Error(\n `The --successCache flag can not be combined with the following arguments: ${parsedArgs.join(\n ', ',\n )}`,\n );\n }\n // Likewise, it's not possible to combine sharding and the success cache\n if (args.includes('--shard')) {\n throw new Error(\n `The --successCache flag can not be combined with the --shard flag`,\n );\n }\n\n const cache = SuccessCache.create({\n name: 'test',\n basePath: opts.successCacheDir,\n });\n const graph = await getPackageGraph();\n\n // Shared state for the bridge\n const projectHashes = new Map<string, string>();\n const outputSuccessCache = new Array<string>();\n\n // Set up a bridge with the @backstage/cli/config/jest configuration file. These methods\n // are picked up by the config script itself, as well as the custom result processor.\n testGlobal.__backstageCli_jestSuccessCache = {\n // This is called by `config/jest.js` after the project configs have been gathered\n async filterConfigs(projectConfigs, globalRootConfig) {\n const cacheEntries = await cache.read();\n const lockfile = await Lockfile.load(\n targetPaths.resolveRoot('yarn.lock'),\n );\n const getPackageTreeHash = await readPackageTreeHashes(graph);\n\n // Base hash shared by all projects\n const baseHash = crypto.createHash('sha1');\n baseHash.update('v1'); // The version of this implementation\n baseHash.update('\\0');\n baseHash.update(process.version); // Node.js version\n baseHash.update('\\0');\n baseHash.update(\n SuccessCache.trimPaths(JSON.stringify(globalRootConfig)),\n ); // Variable global jest config\n const baseSha = baseHash.digest('hex');\n\n return projectConfigs.filter(project => {\n const packageName = project.displayName;\n const pkg = graph.get(packageName);\n if (!pkg) {\n throw new Error(\n `Package ${packageName} not found in package graph`,\n );\n }\n\n const hash = crypto.createHash('sha1');\n\n hash.update(baseSha); // Global base hash\n\n const packageTreeSha = getPackageTreeHash(packageName);\n hash.update(packageTreeSha); // Hash for target package contents\n\n for (const [depName, depPkg] of pkg.allLocalDependencies) {\n const depHash = getPackageTreeHash(depPkg.name);\n hash.update(`${depName}:${depHash}`); // Hash for each local monorepo dependency contents\n }\n\n // The project ID is a hash of the transform configuration, which helps\n // us bust the cache when any changes are made to the transform implementation.\n hash.update(SuccessCache.trimPaths(JSON.stringify(project)));\n hash.update(lockfile.getDependencyTreeHash(packageName));\n\n const sha = hash.digest('hex');\n\n projectHashes.set(packageName, sha);\n\n if (cacheEntries.has(sha)) {\n if (!selectedProjects || selectedProjects.includes(packageName)) {\n console.log(`Skipped ${packageName} due to cache hit`);\n }\n outputSuccessCache.push(sha);\n return undefined;\n }\n\n return project;\n });\n },\n // This is called by `config/jestCacheResultProcess.cjs` after all tests have run\n async reportResults(results) {\n const successful = new Set<string>();\n const failed = new Set<string>();\n\n for (const testResult of results.testResults) {\n for (const [pkgName, pkg] of graph) {\n if (isChildPath(pkg.dir, testResult.testFilePath)) {\n if (\n testResult.testExecError ||\n testResult.failureMessage ||\n testResult.numFailingTests > 0\n ) {\n failed.add(pkgName);\n successful.delete(pkgName);\n } else if (!failed.has(pkgName)) {\n successful.add(pkgName);\n }\n break;\n }\n }\n }\n\n for (const pkgName of successful) {\n const sha = projectHashes.get(pkgName);\n if (sha) {\n outputSuccessCache.push(sha);\n }\n }\n\n await cache.write(outputSuccessCache);\n },\n };\n }\n\n await runJest(args);\n};\n"],"names":["relativePath","targetPaths","runOutput","cli","yargs","jestYargsOptions","findOwnPaths","runCheck","selectedProjects","isChildPath","os","PackageGraph","SuccessCache","Lockfile","crypto","runJest"],"mappings":";;;;;;;;;;;;;;;;;;;AAmEA,eAAe,sBAAsB,KAAA,EAAqB;AACxD,EAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA,CAAE,IAAI,CAAA,GAAA,MAAQ;AAAA,IAClD,GAAG,GAAA;AAAA,IACH,IAAA,EAAMA,kBAAA,CAAaC,qBAAA,CAAY,OAAA,EAAS,IAAI,GAAG;AAAA,GACjD,CAAE,CAAA;AACF,EAAA,MAAM,MAAA,GAAS,MAAMC,mBAAA,CAAU;AAAA,IAC7B,KAAA;AAAA,IACA,SAAA;AAAA,IACA,gCAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAG,IAAA,CAAK,GAAA,CAAI,CAAA,GAAA,KAAO,IAAI,IAAI;AAAA,GAC5B,CAAA;AAED,EAAA,MAAM,MAAM,IAAI,GAAA;AAAA,IACd,OACG,IAAA,EAAK,CACL,MAAM,OAAO,CAAA,CACb,IAAI,CAAA,IAAA,KAAQ;AACX,MAAA,MAAM,CAAC,OAAA,EAAS,GAAG,aAAa,CAAA,GAAI,IAAA,CAAK,MAAM,GAAG,CAAA;AAClD,MAAA,MAAM,QAAA,GAAW,aAAA,CAAc,IAAA,CAAK,GAAG,CAAA;AACvC,MAAA,MAAM,MAAM,IAAA,CAAK,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,QAAQ,CAAA;AAC9C,MAAA,IAAI,CAAC,GAAA,EAAK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CAAC,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA,EAAG;AAC/B,gBAAA,UAAA,CAAW,IAAI,OAAO,CAAA;AAAA,cACxB;AACA,cAAA;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAEA,QAAA,KAAA,MAAW,WAAW,UAAA,EAAY;AAChC,UAAA,MAAM,GAAA,GAAM,aAAA,CAAc,GAAA,CAAI,OAAO,CAAA;AACrC,UAAA,IAAI,GAAA,EAAK;AACP,YAAA,kBAAA,CAAmB,KAAK,GAAG,CAAA;AAAA,UAC7B;AAAA,QACF;AAEA,QAAA,MAAM,KAAA,CAAM,MAAM,kBAAkB,CAAA;AAAA,MACtC;AAAA,KACF;AAAA,EACF;AAEA,EAAA,MAAMM,YAAQ,IAAI,CAAA;AACpB,CAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"test.cjs.js","sources":["../../../src/commands/repo/test.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport os from 'node:os';\nimport crypto from 'node:crypto';\nimport { cli } from 'cleye';\nimport yargs from 'yargs';\n// 'jest-cli' is included with jest and should be kept in sync with the installed jest version\n// eslint-disable-next-line @backstage/no-undeclared-imports\nimport { run as runJest, yargsOptions as jestYargsOptions } from 'jest-cli';\nimport { relative as relativePath } from 'node:path';\nimport { Lockfile, PackageGraph, SuccessCache } from '@backstage/cli-node';\n\nimport {\n findOwnPaths,\n runCheck,\n runOutput,\n targetPaths,\n isChildPath,\n} from '@backstage/cli-common';\nimport type { CliCommandContext } from '@backstage/cli-node';\n\ntype JestProject = {\n displayName: string;\n rootDir: string;\n};\n\ninterface TestGlobal extends Global {\n __backstageCli_jestSuccessCache?: {\n filterConfigs(\n projectConfigs: JestProject[],\n globalConfig: unknown,\n ): Promise<JestProject[]>;\n reportResults(results: {\n testResults: Array<{\n displayName?: { name: string };\n numFailingTests: number;\n testFilePath: string;\n testExecError: {\n message: string;\n stack: string;\n };\n failureMessage: string;\n }>;\n }): Promise<void>;\n };\n __backstageCli_watchProjectFilter?: {\n filter(projectConfigs: JestProject[]): Promise<JestProject[]>;\n };\n}\n\n/**\n * Use git to get the HEAD tree hashes of each package in the project.\n */\nasync function readPackageTreeHashes(graph: PackageGraph) {\n const pkgs = Array.from(graph.values()).map(pkg => ({\n ...pkg,\n path: relativePath(targetPaths.rootDir, pkg.dir),\n }));\n const output = await runOutput([\n 'git',\n 'ls-tree',\n '--format=%(objectname)=%(path)',\n 'HEAD',\n '--',\n ...pkgs.map(pkg => pkg.path),\n ]);\n\n const map = new Map(\n output\n .trim()\n .split(/\\r?\\n/)\n .map(line => {\n const [itemSha, ...itemPathParts] = line.split('=');\n const itemPath = itemPathParts.join('=');\n const pkg = pkgs.find(p => p.path === itemPath);\n if (!pkg) {\n throw new Error(\n `Unexpectedly missing tree sha entry for path ${itemPath}`,\n );\n }\n return [pkg.packageJson.name, itemSha];\n }),\n );\n\n return (pkgName: string) => {\n const sha = map.get(pkgName);\n if (!sha) {\n throw new Error(`Tree sha not found for ${pkgName}`);\n }\n return sha;\n };\n}\n\nexport function createFlagFinder(args: string[]) {\n const flags = new Set<string>();\n\n for (const arg of args) {\n if (arg.startsWith('--no-')) {\n flags.add(`--${arg.slice('--no-'.length)}`);\n } else if (arg.startsWith('--')) {\n flags.add(arg.split('=')[0]);\n } else if (arg.startsWith('-')) {\n const shortFlags = arg.slice(1).split('');\n for (const shortFlag of shortFlags) {\n flags.add(`-${shortFlag}`);\n }\n }\n }\n\n return (...findFlags: string[]) => {\n for (const flag of findFlags) {\n if (flags.has(flag)) {\n return true;\n }\n }\n return false;\n };\n}\n\nexport default async ({ args, info }: CliCommandContext) => {\n const testGlobal = global as TestGlobal;\n\n for (const flag of ['successCache', 'successCacheDir', 'jestHelp']) {\n if (args.some(a => a === `--${flag}` || a.startsWith(`--${flag}=`))) {\n process.stderr.write(\n `DEPRECATION WARNING: --${flag} is deprecated, use the kebab-case form instead\\n`,\n );\n }\n }\n\n // Parse Backstage-specific flags; unknown flags and arguments are left in\n // args so they can be forwarded to Jest.\n const { flags: opts } = cli(\n {\n help: info,\n booleanFlagNegation: true,\n flags: {\n since: {\n type: String,\n description:\n 'Only include test packages changed since the specified ref',\n },\n successCache: {\n type: Boolean,\n description: 'Cache and skip tests for unchanged packages',\n },\n successCacheDir: {\n type: String,\n description: 'Directory for the success cache',\n },\n jestHelp: {\n type: Boolean,\n description: \"Show Jest's own help output\",\n },\n },\n ignoreArgv: type => type === 'unknown-flag' || type === 'argument',\n },\n undefined,\n args,\n );\n\n const hasFlags = createFlagFinder(args);\n const sinceRef = opts.since || undefined;\n\n // Parse the args to ensure that no file filters are provided, in which case we refuse to run\n const { _: parsedArgs } = await yargs(args).options(jestYargsOptions).argv;\n\n // Only include our config if caller isn't passing their own config\n if (!hasFlags('-c', '--config')) {\n /* eslint-disable-next-line no-restricted-syntax */\n args.push('--config', findOwnPaths(__dirname).resolve('config/jest.js'));\n }\n\n if (!hasFlags('--passWithNoTests')) {\n args.push('--passWithNoTests');\n }\n\n // Run in watch mode unless in CI, coverage mode, or running all tests\n let isSingleWatchMode = args.includes('--watch');\n if (\n !sinceRef &&\n !process.env.CI &&\n !hasFlags('--coverage', '--watch', '--watchAll')\n ) {\n const isGitRepo = () =>\n runCheck(['git', 'rev-parse', '--is-inside-work-tree']);\n const isMercurialRepo = () => runCheck(['hg', '--cwd', '.', 'root']);\n\n if ((await isGitRepo()) || (await isMercurialRepo())) {\n isSingleWatchMode = true;\n args.push('--watch');\n } else {\n args.push('--watchAll');\n }\n }\n\n // Due to our monorepo Jest project setup watch mode can be quite slow as it\n // will always scan all projects for matches. This is an optimization where if\n // the only provides filter paths from the repo root as args, we filter the\n // projects to only run tests for those.\n //\n // This does mean you're not able to edit the watch filters during the watch\n // session to point outside of the selected packages, but we consider that a\n // worthwhile tradeoff, and you can always avoid providing paths upfront.\n if (isSingleWatchMode && parsedArgs.length > 0) {\n testGlobal.__backstageCli_watchProjectFilter = {\n async filter(projectConfigs) {\n const selectedProjects = [];\n const usedArgs = new Set();\n\n for (const project of projectConfigs) {\n for (const arg of parsedArgs) {\n if (isChildPath(project.rootDir, String(arg))) {\n selectedProjects.push(project);\n usedArgs.add(arg);\n }\n }\n }\n\n // If we didn't end up using all args in the filtering we need to bail\n // and let Jest do the full filtering instead.\n if (usedArgs.size !== parsedArgs.length) {\n return projectConfigs;\n }\n\n return selectedProjects;\n },\n };\n }\n\n // When running tests from the repo root in large repos you can easily hit the heap limit.\n // This is because Jest workers leak a lot of memory, and the workaround is to limit worker memory.\n // We set a default memory limit, but if an explicit one is supplied it will be used instead\n if (!hasFlags('--workerIdleMemoryLimit')) {\n args.push('--workerIdleMemoryLimit=1000M');\n }\n\n // In order for the above worker memory limit to work we need to make sure the worker\n // count is set to at least 2, as the tests will otherwise run in-band.\n // Depending on the mode tests are run with the default count is either cpus-1, or cpus/2.\n // This means that if we've got at 4 or more cores we'll always get at least 2 workers, but\n // otherwise we need to set the worker count explicitly unless already done.\n if (\n os.cpus().length <= 3 &&\n !hasFlags('-i', '--runInBand', '-w', '--maxWorkers')\n ) {\n args.push('--maxWorkers=2');\n }\n\n let packageGraph: PackageGraph | undefined;\n async function getPackageGraph() {\n if (packageGraph) {\n return packageGraph;\n }\n const packages = await PackageGraph.listTargetPackages();\n packageGraph = PackageGraph.fromPackages(packages);\n return packageGraph;\n }\n\n let selectedProjects: string[] | undefined = undefined;\n if (sinceRef && !hasFlags('--selectProjects')) {\n const graph = await getPackageGraph();\n const changedPackages = await graph.listChangedPackages({\n ref: sinceRef,\n analyzeLockfile: true,\n });\n\n selectedProjects = Array.from(\n graph.collectPackageNames(\n changedPackages.map(pkg => pkg.name),\n pkg => pkg.allLocalDependents.keys(),\n ),\n );\n\n if (selectedProjects.length === 0) {\n console.log(`No packages changed since ${opts.since}`);\n return;\n }\n\n args.push('--selectProjects', ...selectedProjects);\n }\n\n // This is the only thing that is not implemented by jest.run(), so we do it here instead\n // https://github.com/facebook/jest/blob/cd8828f7bbec6e55b4df5e41e853a5133c4a3ee1/packages/jest-cli/bin/jest.js#L12\n if (!process.env.NODE_ENV) {\n (process.env as any).NODE_ENV = 'test';\n }\n\n // This is to have a consistent timezone for when running tests that involve checking\n // the formatting of date/times.\n // https://stackoverflow.com/questions/56261381/how-do-i-set-a-timezone-in-my-jest-config\n if (!process.env.TZ) {\n process.env.TZ = 'UTC';\n }\n\n // Unless the user explicitly toggles node-snapshot, default to provide --no-node-snapshot to reduce number of steps to run scaffolder\n // on Node LTS.\n if (!process.env.NODE_OPTIONS?.includes('--node-snapshot')) {\n process.env.NODE_OPTIONS = `${\n process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ''\n }--no-node-snapshot`;\n }\n\n if (opts.jestHelp) {\n args.push('--help');\n }\n\n // This code path is enabled by the --success-cache flag, which is specific to\n // the `repo test` command in the Backstage CLI.\n if (opts.successCache) {\n // Refuse to run if file filters are provided\n if (parsedArgs.length > 0) {\n throw new Error(\n `The --success-cache flag can not be combined with the following arguments: ${parsedArgs.join(\n ', ',\n )}`,\n );\n }\n // Likewise, it's not possible to combine sharding and the success cache\n if (args.includes('--shard')) {\n throw new Error(\n `The --success-cache flag can not be combined with the --shard flag`,\n );\n }\n\n const cache = SuccessCache.create({\n name: 'test',\n basePath: opts.successCacheDir,\n });\n const graph = await getPackageGraph();\n\n // Shared state for the bridge\n const projectHashes = new Map<string, string>();\n const outputSuccessCache = new Array<string>();\n\n // Set up a bridge with the @backstage/cli/config/jest configuration file. These methods\n // are picked up by the config script itself, as well as the custom result processor.\n testGlobal.__backstageCli_jestSuccessCache = {\n // This is called by `config/jest.js` after the project configs have been gathered\n async filterConfigs(projectConfigs, globalRootConfig) {\n const cacheEntries = await cache.read();\n const lockfile = await Lockfile.load(\n targetPaths.resolveRoot('yarn.lock'),\n );\n const getPackageTreeHash = await readPackageTreeHashes(graph);\n\n // Base hash shared by all projects\n const baseHash = crypto.createHash('sha1');\n baseHash.update('v1'); // The version of this implementation\n baseHash.update('\\0');\n baseHash.update(process.version); // Node.js version\n baseHash.update('\\0');\n baseHash.update(\n SuccessCache.trimPaths(JSON.stringify(globalRootConfig)),\n ); // Variable global jest config\n const baseSha = baseHash.digest('hex');\n\n return projectConfigs.filter(project => {\n const packageName = project.displayName;\n const pkg = graph.get(packageName);\n if (!pkg) {\n throw new Error(\n `Package ${packageName} not found in package graph`,\n );\n }\n\n const hash = crypto.createHash('sha1');\n\n hash.update(baseSha); // Global base hash\n\n const packageTreeSha = getPackageTreeHash(packageName);\n hash.update(packageTreeSha); // Hash for target package contents\n\n for (const [depName, depPkg] of pkg.allLocalDependencies) {\n const depHash = getPackageTreeHash(depPkg.name);\n hash.update(`${depName}:${depHash}`); // Hash for each local monorepo dependency contents\n }\n\n // The project ID is a hash of the transform configuration, which helps\n // us bust the cache when any changes are made to the transform implementation.\n hash.update(SuccessCache.trimPaths(JSON.stringify(project)));\n hash.update(lockfile.getDependencyTreeHash(packageName));\n\n const sha = hash.digest('hex');\n\n projectHashes.set(packageName, sha);\n\n if (cacheEntries.has(sha)) {\n if (!selectedProjects || selectedProjects.includes(packageName)) {\n console.log(`Skipped ${packageName} due to cache hit`);\n }\n outputSuccessCache.push(sha);\n return undefined;\n }\n\n return project;\n });\n },\n // This is called by `config/jestCacheResultProcess.cjs` after all tests have run\n async reportResults(results) {\n const successful = new Set<string>();\n const failed = new Set<string>();\n\n for (const testResult of results.testResults) {\n for (const [pkgName, pkg] of graph) {\n if (isChildPath(pkg.dir, testResult.testFilePath)) {\n if (\n testResult.testExecError ||\n testResult.failureMessage ||\n testResult.numFailingTests > 0\n ) {\n failed.add(pkgName);\n successful.delete(pkgName);\n } else if (!failed.has(pkgName)) {\n successful.add(pkgName);\n }\n break;\n }\n }\n }\n\n for (const pkgName of successful) {\n const sha = projectHashes.get(pkgName);\n if (sha) {\n outputSuccessCache.push(sha);\n }\n }\n\n await cache.write(outputSuccessCache);\n },\n };\n }\n\n await runJest(args);\n};\n"],"names":["relativePath","targetPaths","runOutput","cli","yargs","jestYargsOptions","findOwnPaths","runCheck","selectedProjects","isChildPath","os","PackageGraph","SuccessCache","Lockfile","crypto","runJest"],"mappings":";;;;;;;;;;;;;;;;;;;AAmEA,eAAe,sBAAsB,KAAA,EAAqB;AACxD,EAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA,CAAE,IAAI,CAAA,GAAA,MAAQ;AAAA,IAClD,GAAG,GAAA;AAAA,IACH,IAAA,EAAMA,kBAAA,CAAaC,qBAAA,CAAY,OAAA,EAAS,IAAI,GAAG;AAAA,GACjD,CAAE,CAAA;AACF,EAAA,MAAM,MAAA,GAAS,MAAMC,mBAAA,CAAU;AAAA,IAC7B,KAAA;AAAA,IACA,SAAA;AAAA,IACA,gCAAA;AAAA,IACA,MAAA;AAAA,IACA,IAAA;AAAA,IACA,GAAG,IAAA,CAAK,GAAA,CAAI,CAAA,GAAA,KAAO,IAAI,IAAI;AAAA,GAC5B,CAAA;AAED,EAAA,MAAM,MAAM,IAAI,GAAA;AAAA,IACd,OACG,IAAA,EAAK,CACL,MAAM,OAAO,CAAA,CACb,IAAI,CAAA,IAAA,KAAQ;AACX,MAAA,MAAM,CAAC,OAAA,EAAS,GAAG,aAAa,CAAA,GAAI,IAAA,CAAK,MAAM,GAAG,CAAA;AAClD,MAAA,MAAM,QAAA,GAAW,aAAA,CAAc,IAAA,CAAK,GAAG,CAAA;AACvC,MAAA,MAAM,MAAM,IAAA,CAAK,IAAA,CAAK,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,QAAQ,CAAA;AAC9C,MAAA,IAAI,CAAC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MAAA,IAAW,CAAC,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA,EAAG;AAC/B,gBAAA,UAAA,CAAW,IAAI,OAAO,CAAA;AAAA,cACxB;AACA,cAAA;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAEA,QAAA,KAAA,MAAW,WAAW,UAAA,EAAY;AAChC,UAAA,MAAM,GAAA,GAAM,aAAA,CAAc,GAAA,CAAI,OAAO,CAAA;AACrC,UAAA,IAAI,GAAA,EAAK;AACP,YAAA,kBAAA,CAAmB,KAAK,GAAG,CAAA;AAAA,UAC7B;AAAA,QACF;AAEA,QAAA,MAAM,KAAA,CAAM,MAAM,kBAAkB,CAAA;AAAA,MACtC;AAAA,KACF;AAAA,EACF;AAEA,EAAA,MAAMM,YAAQ,IAAI,CAAA;AACpB,CAAA;;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var name = "@backstage/cli-module-test-jest";
|
|
6
|
-
var version = "0.1.
|
|
6
|
+
var version = "0.1.1-next.1";
|
|
7
7
|
var description = "CLI module for Backstage CLI";
|
|
8
8
|
var backstage = {
|
|
9
9
|
role: "cli-module"
|
|
@@ -43,7 +43,7 @@ var dependencies = {
|
|
|
43
43
|
cleye: "^2.3.0",
|
|
44
44
|
"cross-fetch": "^4.0.0",
|
|
45
45
|
"fs-extra": "^11.2.0",
|
|
46
|
-
glob: "^
|
|
46
|
+
glob: "^13.0.0",
|
|
47
47
|
"jest-css-modules": "^2.1.0",
|
|
48
48
|
sucrase: "^3.20.2",
|
|
49
49
|
yargs: "^16.2.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/cli-module-test-jest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1-next.1",
|
|
4
4
|
"description": "CLI module for Backstage CLI",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli-module"
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"test": "backstage-cli package test"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@backstage/cli-common": "
|
|
37
|
-
"@backstage/cli-node": "
|
|
36
|
+
"@backstage/cli-common": "0.2.1-next.0",
|
|
37
|
+
"@backstage/cli-node": "0.3.1-next.0",
|
|
38
38
|
"@swc/core": "^1.15.6",
|
|
39
39
|
"@swc/jest": "^0.2.39",
|
|
40
40
|
"cleye": "^2.3.0",
|
|
41
41
|
"cross-fetch": "^4.0.0",
|
|
42
42
|
"fs-extra": "^11.2.0",
|
|
43
|
-
"glob": "^
|
|
43
|
+
"glob": "^13.0.0",
|
|
44
44
|
"jest-css-modules": "^2.1.0",
|
|
45
45
|
"sucrase": "^3.20.2",
|
|
46
46
|
"yargs": "^16.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@backstage/cli": "
|
|
49
|
+
"@backstage/cli": "0.36.1-next.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@jest/environment-jsdom-abstract": "^30.0.0",
|