Skip to content
Open
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
2 changes: 1 addition & 1 deletion cdk-consumer-test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cdk-consumer-test",
"version": "0.1.0",
"version": "0.0.0",
"bin": {
"cdk-consumer-test": "bin/cdk-consumer-test.js"
},
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "crush-test",
"version": "1.0.0",
"version": "0.0.0",
"description": "Lambda-based load testing service using oha and k6",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "tsc --build tsconfig.json",
"build": "tsc --build tsconfig.json && npm run build -w packages/lambda",
"build:construct": "npm run build -w packages/cdk-construct",
"test": "npm run test --workspaces",
"deploy": "npm run deploy -w packages/cdk",
Expand Down
3 changes: 3 additions & 0 deletions packages/cdk-construct/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/cdk-construct/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ project.compileTask.exec('rm -rf ./lib/lambda');
// Make directory for the Lambda
project.compileTask.exec('mkdir -p ./lib/lambda');

// TODO: esbuild the Lambda
// esbuild the Lambda
project.compileTask.exec('cd ../lambda && npm run build');

// Copy the esbuild output of the Lambda
project.compileTask.exec('cp -R ../lambda/dist ./lib/lambda/');
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cdk",
"version": "1.0.0",
"version": "0.0.0",
"description": "CDK stack for the load testing Lambda function",
"main": "dist/app.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/lambda/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambda",
"version": "1.0.0",
"version": "0.0.0",
"description": "Lambda function for running load tests",
"main": "dist/handler.js",
"scripts": {
Expand Down
8 changes: 7 additions & 1 deletion packages/lambda/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { spawn } from 'child_process';
import { promisify } from 'util';
import * as fs from 'fs';

import pkg from '../package.json';
console.log('Lambda package version:', pkg.version);

interface TestPayload {
tool: 'oha' | 'k6';
args: string[];
Expand Down Expand Up @@ -135,7 +138,10 @@ export const handler: Handler<TestPayload> = async (event) => {
...(event.tool === 'k6' && typeof summaryExportField !== 'undefined' ? { summaryExportField } : {}),
stderr,
exitCode,
request: requestEcho
request: requestEcho,
metadata: {
version: pkg.version
}
};

return {
Expand Down
6 changes: 4 additions & 2 deletions packages/lambda/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"outDir": "dist"
"outDir": "dist",
"resolveJsonModule": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "dist"]
}
}