Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: Vitest does not work with workflows #7414

Open
cah4a opened this issue Dec 2, 2024 · 0 comments
Open

🐛 BUG: Vitest does not work with workflows #7414

cah4a opened this issue Dec 2, 2024 · 0 comments
Labels
bug Something that isn't working vitest Relating to the Workers Vitest integration workflows

Comments

@cah4a
Copy link

cah4a commented Dec 2, 2024

Which Cloudflare product(s) does this pertain to?

Miniflare, Other

What version(s) of the tool(s) are you using?

0.5.32 [@cloudflare/vitest-pool-workers], 3.91.0 [wrangler]

What version of Node are you using?

22.9.0

What operating system and version are you using?

MacOs Ventura

Describe the Bug

Observed behavior

Vitests doesn't run if wrangler toml contains workflows and following error occurs:

Worker "workflows:webhook-workflow"'s binding "USER_WORKFLOW" refers to service "core:user:vitest-pool-workers-runner-" with a named entrypoint "WebhookWorkflow", but "core:user:vitest-pool-workers-runner-" has no such named entrypoint.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Errors ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
 ❯ #assembleAndUpdateConfig node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:9983:13
 ❯ process.processTicksAndRejections node:internal/process/task_queues:105:5
 ❯ Mutex.runWith node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:3632:16
 ❯ #waitForReady node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:10040:5
 ❯ getProjectMiniflare node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs:1430:5
 ❯ Object.runTests node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs:1683:20
 ❯ executeTests node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js:9330:5
 ❯ node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js:14935:9

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_RUNTIME_FAILURE' }
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Test Files  no tests
      Tests  no tests
     Errors  1 error
   Start at  21:04:10
   Duration  140ms (transform 0ms, setup 0ms, collect 0ms, tests 0ms, environment 0ms, prepare 0ms)


 FAIL  Tests failed. Watching for file changes...
       press h to show help, press q to quit
Cancelling test run. Press CTRL+c again to exit forcefully.

[vpw:dbg] Shutting down runtimes...
error during close MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.
    at #assembleAndUpdateConfig (/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:9983:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async Mutex.runWith (/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:3632:16)
    at async #waitForReady (/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js:10040:5)
    at async Promise.all (index 0)
    at async getProjectMiniflare (file:///Users/cah4a/work/unknown-project/node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs:1430:5)
    at async Object.runTests (file:///Users/cah4a/work/unknown-project/node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs:1683:20)
    at async Promise.all (index 5)
    at async executeTests (file:///Users/cah4a/work/unknown-project/node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js:9330:5)
    at async file:///Users/cah4a/work/unknown-project/node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js:14935:9 {
  code: 'ERR_RUNTIME_FAILURE',
  cause: undefined,
  type: 'Unhandled Error',
  stacks: [
    {
      method: '#assembleAndUpdateConfig',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js',
      line: 9983,
      column: 13
    },
    {
      method: 'process.processTicksAndRejections',
      file: '/Users/cah4a/work/unknown-project/node:internal/process/task_queues',
      line: 105,
      column: 5
    },
    {
      method: 'Mutex.runWith',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js',
      line: 3632,
      column: 16
    },
    {
      method: '#waitForReady',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/miniflare@3.20241106.1/node_modules/miniflare/dist/src/index.js',
      line: 10040,
      column: 5
    },
    {
      method: 'getProjectMiniflare',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs',
      line: 1430,
      column: 5
    },
    {
      method: 'Object.runTests',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/@cloudflare+vitest-pool-workers@0.5.32_@cloudflare+workers-types@4.20241127.0_@vitest+runner@_hwo7pvv77thpfn5lwl6xtnhhae/node_modules/@cloudflare/vitest-pool-workers/dist/pool/index.mjs',
      line: 1683,
      column: 20
    },
    {
      method: 'executeTests',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js',
      line: 9330,
      column: 5
    },
    {
      method: '',
      file: '/Users/cah4a/work/unknown-project/node_modules/.pnpm/vitest@2.0.5_@types+node@22.10.1/node_modules/vitest/dist/chunks/cli-api.OKfd3qJ0.js',
      line: 14935,
      column: 9
    }
  ]
}

Expected behavior

Vitests does run if wrangler toml contains workflows.

Steps to reproduce

  1. Generate empty project using pnpm create cloudflare@latest
  2. Add workflow as described on the guide
  3. pnpm vitest
  4. Observe error

Please provide a link to a minimal reproduction

https://github.com/cah4a/cloudflare-workers-workflows-vitest

Please provide any relevant error logs

No response

@cah4a cah4a added the bug Something that isn't working label Dec 2, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Dec 2, 2024
@emily-shen emily-shen added workflows vitest Relating to the Workers Vitest integration labels Dec 2, 2024
@emily-shen emily-shen changed the title 🐛 BUG: Cloudflare Workflows: MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start 🐛 BUG: Vitest does not work with workflows Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working vitest Relating to the Workers Vitest integration workflows
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants