@@ -19,6 +19,7 @@ import { HEADER_NAME } from "@trigger.dev/worker";
1919import { RunEngine } from "@internal/run-engine" ;
2020import { trace } from "@opentelemetry/api" ;
2121import { TriggerTaskService } from "~/v3/services/triggerTask.server" ;
22+ import { env } from "~/env.server" ;
2223
2324describe ( "worker" , ( ) => {
2425 const defaultInstanceName = "test_worker" ;
@@ -69,6 +70,7 @@ describe("worker", () => {
6970 headers : {
7071 Authorization : `Bearer ${ token . plaintext } ` ,
7172 [ HEADER_NAME . WORKER_INSTANCE_NAME ] : defaultInstanceName ,
73+ [ HEADER_NAME . WORKER_MANAGED_SECRET ] : env . MANAGED_WORKER_SECRET ,
7274 } ,
7375 } ) ;
7476
@@ -86,6 +88,7 @@ describe("worker", () => {
8688 headers : {
8789 Authorization : `Bearer ${ token . plaintext } ` ,
8890 [ HEADER_NAME . WORKER_INSTANCE_NAME ] : secondInstanceName ,
91+ [ HEADER_NAME . WORKER_MANAGED_SECRET ] : env . MANAGED_WORKER_SECRET ,
8992 } ,
9093 } ) ;
9194 const secondAuth = await tokenService . authenticate ( secondRequest ) ;
@@ -99,7 +102,11 @@ describe("worker", () => {
99102 containerTest ( "dequeue - unmanaged" , async ( { prisma, redisContainer } ) => {
100103 const taskIdentifier = "test-task" ;
101104
102- const authenticatedEnvironment = await setupAuthenticatedEnvironment ( prisma , "PRODUCTION" ) ;
105+ const authenticatedEnvironment = await setupAuthenticatedEnvironment (
106+ prisma ,
107+ "PRODUCTION" ,
108+ "V2"
109+ ) ;
103110
104111 const { deployment } = await setupBackgroundWorker (
105112 prisma ,
@@ -136,7 +143,7 @@ describe("worker", () => {
136143 const tokenService = new WorkerGroupTokenService ( { prisma, engine } ) ;
137144 const authenticatedInstance = await tokenService . authenticate ( request ) ;
138145
139- assert ( authenticatedInstance , "authenticationInstance should be defined" ) ;
146+ assert ( authenticatedInstance , "authenticatedInstance should be defined" ) ;
140147 expect ( authenticatedInstance . type ) . toBe ( WorkerInstanceGroupType . UNMANAGED ) ;
141148 assert (
142149 authenticatedInstance . type === WorkerInstanceGroupType . UNMANAGED ,
0 commit comments