Skip to content

Commit e4f70ba

Browse files
committed
Pass version only for "dev"
1 parent bbf9c12 commit e4f70ba

File tree

4 files changed

+12
-36
lines changed

4 files changed

+12
-36
lines changed

.github/workflows/test-installers.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ permissions:
66
on:
77
workflow_dispatch:
88
inputs:
9-
version:
10-
type: string
11-
description: 'Version of the installer to download'
12-
required: true
139
bucket_name:
1410
type: string
1511
description: 'S3 bucket to download installers from'
@@ -18,11 +14,14 @@ on:
1814
type: string
1915
description: 'S3 bucket key prefix to download installers from'
2016
required: true
17+
dev_version:
18+
type: string
19+
description: 'Dev version of the installer to download'
2120
nonce:
2221
type: string
2322
description: 'A random string to track the run from dispatch to watching'
2423

25-
run-name: Test Installers ${{ github.event.inputs.version }} / (nonce = ${{ github.event.inputs.nonce || 'not set' }})
24+
run-name: Test Installers ${{ github.event.inputs.dev_version || github.ref_name }} / (nonce = ${{ github.event.inputs.nonce || 'not set' }})
2625

2726
jobs:
2827
test:
@@ -162,7 +161,7 @@ jobs:
162161
- name: Cache downloads
163162
uses: actions/cache@v4
164163
with:
165-
key: smoke-tests-downloads-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}-${{ matrix.package }}
164+
key: smoke-tests-downloads-${{ inputs.dev_version || github.ref_name }}-${{ runner.os }}-${{ runner.arch }}-${{ matrix.package }}
166165
path: packages/compass-smoke-tests/.downloads
167166
- name: Install dependencies and build packages
168167
run: npm ci
@@ -191,11 +190,14 @@ jobs:
191190
if: matrix.install-update-server
192191
run: npm install --no-save --workspace packages/compass-smoke-tests ./compass-mongodb-com
193192

193+
- name: Expose dev version if set
194+
if: inputs.dev_version
195+
run: echo "DEV_VERSION_IDENTIFIER=${{ inputs.dev_version }}" >> $GITHUB_ENV
196+
194197
- name: Run tests
195198
env:
196199
EVERGREEN_BUCKET_NAME: ${{ inputs.bucket_name }}
197200
EVERGREEN_BUCKET_KEY_PREFIX: ${{ inputs.bucket_key_prefix }}
198-
DEV_VERSION_IDENTIFIER: ${{ inputs.version }}
199201
HADRON_DISTRIBUTION: ${{ matrix.hadron-distribution }}
200202
PLATFORM: ${{ matrix.hadron-platform }}
201203
ARCH: ${{ matrix.arch }}

packages/compass-smoke-tests/src/build-info.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { handler as writeBuildInfo } from 'hadron-build/commands/info';
88

99
import { type PackageKind } from './packages';
1010
import { type SmokeTestsContextWithSandbox } from './context';
11-
import { createSandbox } from './directories';
1211

1312
const debug = createDebug('compass:smoketests:build-info');
1413
const COMPASS_PATH = path.resolve(__dirname, '../../compass');
@@ -264,28 +263,3 @@ export function writeAndReadPackageDetails({
264263
writeBuildInfo(infoArgs);
265264
return readPackageDetails(packageKind, infoArgs.out);
266265
}
267-
268-
export function getCompassVersionFromBuildInfo(): string {
269-
const out = path.resolve(createSandbox(), 'target.json');
270-
// We're hardcoding the platform and arch here because we're only interested in the version
271-
if (typeof process.env.HADRON_DISTRIBUTION !== 'string') {
272-
// TODO: Ideally we would interface directly with the `Target` from the "hadron-build" package so we could pass this directly
273-
process.env.HADRON_DISTRIBUTION = 'compass';
274-
}
275-
writeBuildInfo({
276-
format: 'json',
277-
dir: COMPASS_PATH,
278-
platform: 'linux',
279-
arch: 'x64',
280-
out,
281-
});
282-
const result = readJson(out);
283-
assert(typeof result === 'object', 'Expected hadron to write an object');
284-
assert(
285-
'version' in result,
286-
'Expected hadron to write an object with a version'
287-
);
288-
const { version } = result;
289-
assert(typeof version === 'string', 'Expected version to be a string');
290-
return version;
291-
}

packages/compass-smoke-tests/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ yargs(hideBin(process.argv))
165165
githubPrNumber,
166166
})
167167
: ref,
168-
version: getCompassVersionFromBuildInfo(),
168+
devVersion: process.env.DEV_VERSION_IDENTIFIER,
169169
bucketName,
170170
bucketKeyPrefix,
171171
});

packages/compass-smoke-tests/src/dispatch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ export async function getRefFromGithubPr({
7373
type DispatchOptions = {
7474
githubToken: string;
7575
ref: string;
76-
version: string;
7776
bucketName: string;
7877
bucketKeyPrefix: string;
78+
devVersion?: string;
7979

8080
/**
8181
* Delay in milliseconds to wait between requests when polling while watching the run.
@@ -86,7 +86,7 @@ type DispatchOptions = {
8686
export async function dispatchAndWait({
8787
githubToken,
8888
ref,
89-
version,
89+
devVersion,
9090
bucketName,
9191
bucketKeyPrefix,
9292
watchPollDelayMs = 5000,

0 commit comments

Comments
 (0)