From 844cd6f0964e89c9d3b0f798aebddfac477b57af Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Fri, 10 Nov 2023 14:10:56 +0000 Subject: [PATCH] fix(integ-runner): update workflow error message is inaccurate (#27924) The previously printed command doesn't actual work. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/integ-runner/README.md | 10 ++++++---- .../integ-runner/lib/runner/integ-test-runner.ts | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/@aws-cdk/integ-runner/README.md b/packages/@aws-cdk/integ-runner/README.md index 0d3b989d31cb1..bc0401ea7d2dc 100644 --- a/packages/@aws-cdk/integ-runner/README.md +++ b/packages/@aws-cdk/integ-runner/README.md @@ -16,7 +16,6 @@ - ## Overview This tool has been created to be used initially by this repo (aws/aws-cdk). Long term the goal is @@ -38,12 +37,15 @@ integ-runner [ARGS] [TEST...] This will look for all files that match the naming convention of `/integ.*.js$/`. Each of these files will be expected to be a self contained CDK app. The runner will execute the following for each file (app): -1. Check if a snapshot file exists (i.e. `/*.snapshot$/`) -2. If the snapshot does not exist - 2a. Synth the integ app which will produce the `integ.json` file +1. Check if snapshot files exist (i.e. `*.snapshot/**`) +2. If the snapshot does not exist\ + a) Synth the integ app which will produce the `integ.json` file 3. Read the `integ.json` file which contains instructions on what the runner should do. 4. Execute instructions +All snapshot files (i.e. `*.snapshot/**`) must be checked-in to version control. +If not, changes cannot be compared across systems. + ### Options - `--update-on-failed` (default=`false`) diff --git a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts index 0722d4cc8449b..5f71ab392f895 100644 --- a/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts +++ b/packages/@aws-cdk/integ-runner/lib/runner/integ-test-runner.ts @@ -141,8 +141,9 @@ export class IntegTestRunner extends IntegRunner { }); } catch (e) { logger.warning('%s\n%s', - `Could not checkout snapshot directory ${this.snapshotDir} using these commands: `, - `git merge-base HEAD ${baseBranch} && git checkout {merge-base} -- ${relativeSnapshotDir}`, + `Could not checkout snapshot directory '${this.snapshotDir}'. Please verify the following command completes correctly:`, + `git checkout $(git merge-base HEAD ${baseBranch}) -- ${relativeSnapshotDir}`, + '', ); logger.warning('error: %s', e); }