File tree Expand file tree Collapse file tree 9 files changed +1138
-1081
lines changed
internal-packages/run-engine/src/engine/db Expand file tree Collapse file tree 9 files changed +1138
-1081
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export async function getWorkerDeploymentFromWorker(
193193 prisma : PrismaClientOrTransaction ,
194194 workerId : string
195195) : Promise < WorkerDeploymentWithWorkerTasks | null > {
196- const worker = await prisma . backgroundWorker . findUnique ( {
196+ const worker = await prisma . backgroundWorker . findFirst ( {
197197 where : {
198198 id : workerId ,
199199 } ,
@@ -264,6 +264,7 @@ export async function getWorkerFromCurrentlyPromotedDeployment(
264264 prisma : PrismaClientOrTransaction ,
265265 environmentId : string
266266) : Promise < WorkerDeploymentWithWorkerTasks | null > {
267+ // TODO: fixme
267268 const promotion = await prisma . workerDeploymentPromotion . findUnique ( {
268269 where : {
269270 environmentId_label : {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { TaskRunProcess } from "../src/executions/taskRunProcess.js";
88import { createTestHttpServer } from "@epic-web/test-server/http" ;
99import { TestCase , TestCaseRun } from "./fixtures.js" ;
1010import { access } from "node:fs/promises" ;
11+ import { MachinePreset } from "@trigger.dev/core/v3" ;
1112
1213export type PackageManager = "npm" | "pnpm" | "yarn" ;
1314
@@ -295,6 +296,13 @@ export async function executeTestCaseRun({
295296 } ,
296297 } ) ;
297298
299+ const machine = {
300+ name : "small-1x" ,
301+ cpu : 1 ,
302+ memory : 256 ,
303+ centsPerMs : 0.0000001 ,
304+ } satisfies MachinePreset ;
305+
298306 try {
299307 const taskRunProcess = new TaskRunProcess ( {
300308 workerManifest : workerManifest ! ,
@@ -314,12 +322,7 @@ export async function executeTestCaseRun({
314322 version : "1.0.0" ,
315323 contentHash,
316324 } ,
317- machine : {
318- name : "small-1x" ,
319- cpu : 1 ,
320- memory : 256 ,
321- centsPerMs : 0.0000001 ,
322- } ,
325+ machineResources : machine ,
323326 } ) . initialize ( ) ;
324327
325328 const result = await taskRunProcess . execute ( {
@@ -372,12 +375,7 @@ export async function executeTestCaseRun({
372375 ref : "main" ,
373376 name : "test" ,
374377 } ,
375- machine : {
376- name : "small-1x" ,
377- cpu : 1 ,
378- memory : 256 ,
379- centsPerMs : 0.0000001 ,
380- } ,
378+ machine,
381379 } ,
382380 } ,
383381 messageId : "run_1234" ,
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ export class DevRunController {
619619 version : this . opts . worker . serverWorker ?. version ,
620620 engine : "V2" ,
621621 } ,
622- machine : execution . machine ,
622+ machineResources : execution . machine ,
623623 } ) . initialize ( ) ;
624624
625625 logger . debug ( "executing task run process" , {
You can’t perform that action at this time.
0 commit comments