@@ -346,113 +346,6 @@ describe("wrangler deploy with containers", () => {
346346 expect ( std . warn ) . toMatchInlineSnapshot ( `""` ) ;
347347 } ) ;
348348
349- it ( "resolve the dockerfile based on the non-redirected userConfigPath rather than the actual config path" , async ( ) => {
350- vi . stubEnv ( "WRANGLER_DOCKER_BIN" , "/usr/bin/docker" ) ;
351- mockGetVersion ( "Galaxy-Class" ) ;
352-
353- vi . mocked ( spawn )
354- . mockImplementationOnce ( mockDockerInfo ( ) )
355- . mockImplementationOnce (
356- mockDockerBuild (
357- "my-container" ,
358- "Galaxy" ,
359- "FROM scratch" ,
360- // note that the cwd for the test is not the same as the cwd that the wrangler command is running in
361- // fortunately we are using an absolute path
362- process . cwd ( )
363- )
364- )
365- . mockImplementationOnce ( mockDockerImageInspect ( "my-container" , "Galaxy" ) )
366- . mockImplementationOnce ( mockDockerLogin ( "mockpassword" ) )
367- . mockImplementationOnce (
368- mockDockerManifestInspect ( "some-account-id/my-container" , true )
369- )
370- . mockImplementationOnce (
371- mockDockerTag ( "my-container" , "some-account-id/my-container" , "Galaxy" )
372- )
373- . mockImplementationOnce (
374- mockDockerPush ( "some-account-id/my-container" , "Galaxy" )
375- )
376- . mockImplementationOnce (
377- mockDockerImageDelete ( "some-account-id/my-container" , "Galaxy" )
378- ) ;
379-
380- mockContainersAccount ( ) ;
381-
382- const wranglerConfig = {
383- main : "index.js" ,
384- durable_objects : {
385- bindings : [
386- {
387- name : "EXAMPLE_DO_BINDING" ,
388- class_name : "ExampleDurableObject" ,
389- } ,
390- ] ,
391- } ,
392- containers : [
393- {
394- name : "my-container" ,
395- max_instances : 10 ,
396- class_name : "ExampleDurableObject" ,
397- image : "./Dockerfile" ,
398- } ,
399- ] ,
400- migrations : [ { tag : "v1" , new_sqlite_classes : [ "ExampleDurableObject" ] } ] ,
401- } ;
402- // user wrangler config
403- writeWranglerConfig ( wranglerConfig , "./wrangler.json" ) ;
404- // set up redirected config
405- fs . mkdirSync ( ".wrangler/deploy" , { recursive : true } ) ;
406- fs . writeFileSync (
407- ".wrangler/deploy/config.json" ,
408- JSON . stringify ( { configPath : "./wrangler.json" } )
409- ) ;
410- writeWranglerConfig (
411- { ...wranglerConfig , main : "../../index.js" } ,
412- ".wrangler/deploy/wrangler.json"
413- ) ;
414- // dockerfile is in the root of the project
415- fs . writeFileSync ( "Dockerfile" , "FROM scratch" ) ;
416- mockGetApplications ( [ ] ) ;
417-
418- mockGenerateImageRegistryCredentials ( ) ;
419-
420- mockCreateApplication ( {
421- name : "my-container" ,
422- max_instances : 10 ,
423- durable_objects : { namespace_id : "1" } ,
424- configuration : {
425- image :
426- getCloudflareContainerRegistry ( ) +
427- "/some-account-id/my-container:Galaxy" ,
428- } ,
429- } ) ;
430-
431- await runWrangler ( "deploy" ) ;
432- expect ( std . info ) . toMatchInlineSnapshot ( `
433- "Using redirected Wrangler configuration.
434- - Configuration being used: \\".wrangler/deploy/wrangler.json\\"
435- - Original user's configuration: \\"wrangler.json\\"
436- - Deploy configuration file: \\".wrangler/deploy/config.json\\""
437- ` ) ;
438- expect ( std . out ) . toMatchInlineSnapshot ( `
439- "Total Upload: xx KiB / gzip: xx KiB
440- Worker Startup Time: 100 ms
441- Your Worker has access to the following bindings:
442- Binding Resource
443- env.EXAMPLE_DO_BINDING (ExampleDurableObject) Durable Object
444-
445- Uploaded test-name (TIMINGS)
446- Building image my-container:Galaxy
447- Image does not exist remotely, pushing: registry.cloudflare.com/some-account-id/my-container:Galaxy
448- Deployed test-name triggers (TIMINGS)
449- https://test-name.test-sub-domain.workers.dev
450- Current Version ID: Galaxy-Class"
451- ` ) ;
452-
453- expect ( std . err ) . toMatchInlineSnapshot ( `""` ) ;
454- expect ( std . warn ) . toMatchInlineSnapshot ( `""` ) ;
455- } ) ;
456349 it ( "should support deploying a worker with multiple containers" , async ( ) => {
457350 mockGetVersion (
458351 "Galaxy-Class" ,
0 commit comments