Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ functions:
set -e
{
source .evergreen/setup-env.sh
npm run evergreen-release bump
npm run check-ci
}
test:
Expand Down
1 change: 1 addition & 0 deletions .evergreen/compile-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ elif [ -n "$MONGOSH_SHARED_OPENSSL" ]; then
fi

export PUPPETEER_SKIP_DOWNLOAD="true"
npm run evergreen-release bump
npm run evergreen-release compile
dist/mongosh --version
dist/mongosh --build-info
Expand Down
1 change: 1 addition & 0 deletions .evergreen/evergreen.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ functions:
set -e
{
source .evergreen/setup-env.sh
npm run evergreen-release bump
npm run check-ci
}
test:
Expand Down
19 changes: 9 additions & 10 deletions packages/build/src/npm-packages/bump.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ describe('npm-packages bump', function () {
});

describe('bumpMongoshReleasePackages', function () {
it('throws if version is not set', async function () {
try {
await bumpMongoshReleasePackages('');
expect.fail('did not error');
} catch (error) {
expect(error).instanceOf(Error);
expect((error as Error).message).equals(
'version not specified during mongosh bump'
);
}
it('warns and does not run if version is not set', async function () {
const consoleWarnSpy = sinon.spy(console, 'warn');
await bumpMongoshReleasePackages('');
expect(consoleWarnSpy).calledOnceWith(
'mongosh: Release version not specified. Skipping mongosh bump.'
);
expect(fsReadFile).not.called;
expect(fsWriteFile).not.called;
consoleWarnSpy.restore();
});
});

Expand Down
5 changes: 4 additions & 1 deletion packages/build/src/npm-packages/bump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export async function bumpMongoshReleasePackages(
version: string
): Promise<void> {
if (!version) {
throw new Error('version not specified during mongosh bump');
console.warn(
'mongosh: Release version not specified. Skipping mongosh bump.'
);
return;
}

console.info(`mongosh: Bumping mongosh release packages to ${version}`);
Expand Down
Loading