Skip to content

Commit

Permalink
feat: handle TypeScript in BOM
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy committed Dec 16, 2024
1 parent 309aeb3 commit 570e184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 0 additions & 4 deletions packages/artillery/lib/artillery-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ async function createGlobalObject(opts) {
global.artillery._workerThreadSend =
global.artillery._workerThreadSend || null;

// TODO: Refactor these special fields away
global.artillery.__util = global.artillery.__util || {};
global.artillery.__util.parseScript = parseScript;
global.artillery.__util.readScript = readScript;
global.artillery.__createReporter = require('./console-reporter');

global.artillery._exitCode = 0;
Expand Down
14 changes: 12 additions & 2 deletions packages/artillery/lib/platform/aws-ecs/legacy/bom.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const BUILTIN_ENGINES = require('./plugins').getOfficialEngines();
const Table = require('cli-table3');

const { resolveConfigTemplates } = require('../../../../util');

const prepareTestExecutionPlan = require('../../../../lib/util/prepare-test-execution-plan');

// NOTE: Code below presumes that all paths are absolute

//Tests in Fargate run on ubuntu, which uses posix paths
Expand All @@ -28,8 +31,15 @@ function createBOM(absoluteScriptPath, extraFiles, opts, callback) {
A.waterfall(
[
A.constant(absoluteScriptPath),
global.artillery.__util.readScript,
global.artillery.__util.parseScript,
async function (scriptPath) {
const scriptData = await prepareTestExecutionPlan(
[scriptPath],
opts.flags,
[]
);
scriptData.config.processor = scriptPath;
return scriptData;
},
(scriptData, next) => {
return next(null, {
opts: {
Expand Down

0 comments on commit 570e184

Please sign in to comment.