mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-25 08:48:08 +02:00
fix(release): tolerate npm propagation in smoke
This commit is contained in:
parent
ceb578e0f6
commit
8d1837f26e
2 changed files with 73 additions and 3 deletions
|
|
@ -6,6 +6,8 @@ import {
|
|||
buildPublishedPackageNpxCommand,
|
||||
buildPublishedPackageSmokeCommands,
|
||||
isPublishedPackageVersionLabel,
|
||||
isTransientPublishedPackageLookupFailure,
|
||||
publishedPackageSmokePnpmWorkspaceYaml,
|
||||
publishedPackageSpec,
|
||||
readPublishedPackageSmokeConfig,
|
||||
} from './published-package-smoke.mjs';
|
||||
|
|
@ -156,6 +158,33 @@ describe('published package smoke output validation labels', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('published package smoke registry retry classification', () => {
|
||||
it('recognizes npm propagation misses as transient lookup failures', () => {
|
||||
assert.equal(
|
||||
isTransientPublishedPackageLookupFailure({
|
||||
code: 1,
|
||||
stdout: '',
|
||||
stderr: [
|
||||
'npm error code ETARGET',
|
||||
'npm error notarget No matching version found for @kaelio/ktx@0.1.0-rc.4.',
|
||||
].join('\n'),
|
||||
}),
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it('does not retry unrelated command failures', () => {
|
||||
assert.equal(
|
||||
isTransientPublishedPackageLookupFailure({
|
||||
code: 1,
|
||||
stdout: '',
|
||||
stderr: 'npm error code EOTP',
|
||||
}),
|
||||
false,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('published package smoke command construction', () => {
|
||||
const config = {
|
||||
enabled: true,
|
||||
|
|
@ -244,6 +273,13 @@ describe('published package smoke command construction', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('allows native dependency build scripts in clean pnpm smoke installs', () => {
|
||||
assert.equal(
|
||||
publishedPackageSmokePnpmWorkspaceYaml(),
|
||||
['packages:', ' - "."', 'allowBuilds:', ' better-sqlite3: true', ''].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
it('exposes the smoke through the package release script', async () => {
|
||||
const packageJson = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue