Amazon Q is not outputting code anymore with /dev feature

0

I've been trying to get it to implement a simple unit test to my typescript codebase with the /dev option. it get stuck at:

Summarizing the changes made to implement tests for options.tsx

until it timesout. I tried changing the prompt (initially it was creating tests for multiple pages now just for a single file) but still timesout.

it's been like this for about 24 hours now. Is anything ongoing with amazon q? I tried the usual re-login and restart intellij but didn't help.


full sample history:

Summary of changes

I'll help you implement tests for options.tsx. First, I'll explore the repository structure to understand the codebase better.

Now I'll examine the package.json file to understand the project dependencies and scripts.

Now I'll examine the options.tsx file to understand what we need to test.

Let's check the DEVELOPMENT.md file to understand the development workflow and any testing guidelines.

Let's check if there's any existing test setup in the project.

Let's check the tsconfig.json file to understand the TypeScript configuration.

Now I'll check if there's any existing test directory or files in the project.

Based on my exploration, I need to set up a testing environment for the project. I'll now update the package.json to add necessary testing dependencies.

Now I'll create a Jest configuration file to set up the testing environment.

Now I'll create a Jest setup file to configure the testing environment with React Testing Library.

Now I'll create a test directory structure and write tests for options.tsx.

I'll create the tests directory and then write the test file for options.tsx.

Now I'll install the dependencies and run the tests to verify they work.

I am now running pnpm install command.

Now I'll run the tests to verify they work correctly.

I am now running pnpm test command.

I need to fix the Jest setup file to use CommonJS syntax instead of ES modules.

Let's run the tests again to see if they pass now.

I am now running pnpm test command.

I need to update the Jest configuration to properly handle TypeScript and ESM syntax.

Let's create a custom tsconfig for Jest to avoid conflicts with the project's TypeScript configuration.

Now I'll update the Jest configuration to use the custom tsconfig for tests.

Let's run the tests again to see if they pass with our updated configuration.

I am now running pnpm test command.

Great! The tests are now passing. Let's create a README file for the tests to document our testing approach.

Let's update the package.json to add a test coverage script.

Let's run the test coverage to see our current coverage for options.tsx.

I am now running pnpm test --coverage command.

Great! We have 100% test coverage for options.tsx. Let's summarize what we've done.

Summarizing the changes made to implement tests for options.tsx

I have a pro user license for now

  • I have started to experience the same. Any luck getting around the issue?

  • Yes, I had to delete the devfile to make it provide answers again.

asked 15 days ago93 views
1 Answer
-1

It sounds like you're experiencing an issue with Amazon Q's /dev feature, specifically related to code generation and testing. This could be due to a few factors:

  1. Devfile configuration: By default, Amazon Q does not automatically test the code it presents. To enable Amazon Q to test its code, you need to provide it with a devfile. This devfile describes the development environment and the commands that can be run. If you haven't set up a devfile, or if there's an issue with your devfile, it could cause the behavior you're seeing.

  2. Testing environment limitations: The sandbox in which Amazon Q runs its dev environment has limited resources (2 vCPUs and 4 GB of memory). If your project is complex or requires more resources, it might cause timeouts.

  3. Command execution time: The commands in your devfile must complete within five minutes. If any command takes longer, it could lead to timeouts.

  4. IDE settings: There's a setting in your IDE that allows Amazon Q to run code and test commands. If this setting is turned off, it could prevent Amazon Q from properly executing the /dev command.

To troubleshoot:

  1. Check if you have a properly configured devfile in the root of your project.
  2. Ensure your IDE settings allow Amazon Q to run code and test commands.
  3. Try simplifying your test request to see if it's a complexity issue.
  4. If the problem persists, you might want to disable the feature that allows Amazon Q to test its code suggestions and manually test the code it generates.

If none of these steps resolve the issue and it's been ongoing for 24 hours, it could potentially be a service issue. In that case, you may want to contact AWS support for further assistance.
Sources
Disabling Amazon Q from testing its code suggestions - Amazon Q Developer
Testing code suggestions generated by the Amazon Q '/dev' command - Amazon Q Developer
Configuring a devfile in Amazon Q - Amazon Q Developer
Enhancing Code Generation with Real-Time Execution in Amazon Q Developer | AWS DevOps & Developer Productivity Blog

profile picture
answered 15 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions