Skip to content

Commit a65fc41

Browse files
authored
Merge branch 'main' into preserveOnDelete
2 parents f470690 + cc75ded commit a65fc41

File tree

85 files changed

+42092
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+42092
-129
lines changed

.github/workflows/request-cli-integ-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
persist-credentials: false
2020
- name: Find changed cli files
2121
id: changed-cli-files
22-
uses: tj-actions/changed-files@c65cd883420fd2eb864698a825fc4162dd94482c
22+
uses: tj-actions/changed-files@40853de9f8ce2d6cfdc73c1b96f14e22ba44aec4
2323
with:
2424
base_sha: ${{ github.event.pull_request.base.sha }}
2525
files_yaml: |

packages/@aws-cdk-testing/cli-integ/lib/package-sources/repo-source.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,14 @@ const YARN_MONOREPO_CACHE: Record<string, any> = {};
7575
*
7676
* Cached in YARN_MONOREPO_CACHE.
7777
*/
78-
async function findYarnPackages(root: string): Promise<Record<string, string>> {
78+
export async function findYarnPackages(root: string): Promise<Record<string, string>> {
7979
if (!(root in YARN_MONOREPO_CACHE)) {
80-
const output: YarnWorkspacesOutput = JSON.parse(await shell(['yarn', 'workspaces', '--silent', 'info'], {
80+
const outputDataString: string = JSON.parse(await shell(['yarn', 'workspaces', '--json', 'info'], {
8181
captureStderr: false,
8282
cwd: root,
8383
show: 'error',
84-
}));
84+
})).data;
85+
const output: YarnWorkspacesOutput = JSON.parse(outputDataString);
8586

8687
const ret: Record<string, string> = {};
8788
for (const [k, v] of Object.entries(output)) {
@@ -96,7 +97,7 @@ async function findYarnPackages(root: string): Promise<Record<string, string>> {
9697
* Find the root directory of the repo from the current directory
9798
*/
9899
export async function autoFindRoot() {
99-
const found = await findUp('release.json');
100+
const found = findUp('release.json');
100101
if (!found) {
101102
throw new Error(`Could not determine repository root: 'release.json' not found from ${process.cwd()}`);
102103
}

packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as os from 'os';
44
import * as path from 'path';
55
import { outputFromStack, AwsClients } from './aws';
66
import { TestContext } from './integ-test';
7+
import { findYarnPackages } from './package-sources/repo-source';
78
import { IPackageSource } from './package-sources/source';
89
import { packageSourceInSubprocess } from './package-sources/subprocess';
910
import { RESOURCES_DIR } from './resources';
@@ -612,6 +613,17 @@ function defined<A>(x: A): x is NonNullable<A> {
612613
* for Node's dependency lookup mechanism).
613614
*/
614615
export async function installNpmPackages(fixture: TestFixture, packages: Record<string, string>) {
616+
if (process.env.REPO_ROOT) {
617+
const monoRepo = await findYarnPackages(process.env.REPO_ROOT);
618+
619+
// Replace the install target with the physical location of this package
620+
for (const key of Object.keys(packages)) {
621+
if (key in monoRepo) {
622+
packages[key] = monoRepo[key];
623+
}
624+
}
625+
}
626+
615627
fs.writeFileSync(path.join(fixture.integTestDir, 'package.json'), JSON.stringify({
616628
name: 'cdk-integ-tests',
617629
private: true,

packages/@aws-cdk-testing/framework-integ/test/aws-codebuild/test/integ.project-macos-fleet.js.snapshot/MacOsProjectIntegTestDefaultTestDeployAssertB425ECC4.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)