Skip to content

Commit 309ad0e

Browse files
committed
fix(web): explicitly provide commit ref for spawned tests to make sure it's in sync with publish
1 parent 2fe02f5 commit 309ad0e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/publish-compass-web.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
EVG_API_KEY: ${{ secrets.EVERGREEN_SERVICE_USER_API_KEY }}
6767
COMPASS_E2E_ATLAS_CLOUD_ENVIRONMENT: ${{ inputs.publish_environment }}
6868
COMPASS_WEB_E2E_TEST_EVERGREEN_PATCH_DESCRIPTION: 'Test compass-web against Atlas ${{ inputs.publish_environment }} env before release (GHA: https://github.com/mongodb-js/compass/actions/runs/${{ github.run_id }})'
69+
COMPASS_WEB_RELEASE_COMMIT: ${{ inputs.dangerously_override_commit_hash }}
6970
run: |
7071
npm run --workspace @mongodb-js/compass-web test-e2e-atlas
7172

packages/compass-web/scripts/spawn-e2e-with-atlas-cloud.mts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ const {
1313
EVG_UI_SERVER = 'https://evergreen.mongodb.com',
1414
} = process.env;
1515

16+
const RELEASE_COMMIT =
17+
process.env.COMPASS_WEB_RELEASE_COMMIT ||
18+
spawnSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).stdout.trim();
19+
1620
if (!EVG_USER || !EVG_API_KEY) {
1721
throw new Error('Evergreen credentials missing');
1822
}
@@ -74,7 +78,7 @@ function spawnEvergreenSync(
7478
// specifically with the `user` commands, so we override the HOME to
7579
// make sure that our config is picked up from the "default" dir
7680
// correctly for all cases
77-
HOME: CLI_DIR,
81+
// HOME: CLI_DIR,
7882
...extraOptions?.env,
7983
},
8084
}
@@ -152,7 +156,8 @@ const patchInfoStr = spawnEvergreenSync([
152156
`Test compass-web with Atlas Cloud against ${ATLAS_CLOUD_ENV} environment`,
153157
'--param',
154158
`compass_web_publish_environment=${ATLAS_CLOUD_ENV}`,
155-
'--uncommitted',
159+
'--ref',
160+
RELEASE_COMMIT,
156161
'--json',
157162
'--finalize',
158163
]).stdout;

0 commit comments

Comments
 (0)