mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-10 08:05:14 +02:00
test: verify bundled python runtime wheel
This commit is contained in:
parent
93c14577da
commit
4a24596879
2 changed files with 18 additions and 7 deletions
|
|
@ -42,6 +42,8 @@ const CONNECTOR_PACKAGE_NAMES = NPM_ARTIFACT_PACKAGES
|
|||
.map((packageInfo) => packageInfo.name)
|
||||
.filter((packageName) => packageName.startsWith('@ktx/connector-'));
|
||||
|
||||
const NPM_ARTIFACT_BUILD_ORDER = ['@ktx/llm', '@ktx/context', ...CONNECTOR_PACKAGE_NAMES, '@ktx/cli'];
|
||||
|
||||
const ordersSource = {
|
||||
name: 'orders',
|
||||
table: 'public.orders',
|
||||
|
|
@ -91,11 +93,18 @@ export function packageArtifactLayout(rootDir = scriptRootDir()) {
|
|||
}
|
||||
|
||||
export function buildArtifactCommands(layout) {
|
||||
const npmBuildCommands = NPM_ARTIFACT_PACKAGES.map((packageInfo) => ({
|
||||
command: 'pnpm',
|
||||
args: ['--filter', packageInfo.name, 'run', 'build'],
|
||||
cwd: layout.rootDir,
|
||||
}));
|
||||
const packagesByName = new Map(NPM_ARTIFACT_PACKAGES.map((packageInfo) => [packageInfo.name, packageInfo]));
|
||||
const npmBuildCommands = NPM_ARTIFACT_BUILD_ORDER.map((packageName) => {
|
||||
const packageInfo = packagesByName.get(packageName);
|
||||
if (!packageInfo) {
|
||||
throw new Error(`Unknown npm artifact build package: ${packageName}`);
|
||||
}
|
||||
return {
|
||||
command: 'pnpm',
|
||||
args: ['--filter', packageInfo.name, 'run', 'build'],
|
||||
cwd: layout.rootDir,
|
||||
};
|
||||
});
|
||||
const npmPackCommands = NPM_ARTIFACT_PACKAGES.map((packageInfo) => ({
|
||||
command: 'pnpm',
|
||||
args: ['--filter', packageInfo.name, 'pack', '--out', layout.npmTarballs[packageInfo.name]],
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ const CONNECTOR_PACKAGE_NAMES = [
|
|||
'@ktx/connector-sqlserver',
|
||||
];
|
||||
|
||||
const NPM_BUILD_PACKAGE_ORDER = ['@ktx/llm', '@ktx/context', ...CONNECTOR_PACKAGE_NAMES, '@ktx/cli'];
|
||||
|
||||
function packageRootForName(packageName) {
|
||||
return `packages/${packageName.replace('@ktx/', '')}`;
|
||||
}
|
||||
|
|
@ -127,13 +129,13 @@ describe('packageArtifactLayout', () => {
|
|||
});
|
||||
|
||||
describe('buildArtifactCommands', () => {
|
||||
it('builds all TypeScript packages before packing npm artifacts and builds both Python packages', () => {
|
||||
it('builds TypeScript packages in dependency order before packing npm artifacts and builds Python packages', () => {
|
||||
const layout = packageArtifactLayout('/repo/ktx');
|
||||
const commands = buildArtifactCommands(layout);
|
||||
|
||||
assert.deepEqual(
|
||||
commands.slice(0, NPM_ARTIFACT_PACKAGES.length).map((command) => [command.command, command.args]),
|
||||
NPM_ARTIFACT_PACKAGES.map((packageInfo) => ['pnpm', ['--filter', packageInfo.name, 'run', 'build']]),
|
||||
NPM_BUILD_PACKAGE_ORDER.map((packageName) => ['pnpm', ['--filter', packageName, 'run', 'build']]),
|
||||
);
|
||||
assert.deepEqual(
|
||||
commands
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue