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

Command line paramater to specify test command #499

Open
fdietze opened this issue Mar 8, 2024 · 6 comments
Open

Command line paramater to specify test command #499

fdietze opened this issue Mar 8, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@fdietze
Copy link

fdietze commented Mar 8, 2024

Thanks for creating aider!

Using it for the first time, I was missing a way to specify a test command. A test command would run automatically after every change and trigger a feedback loop until the exit code becomes 0.

I would use that for all kinds of testing and type checking.

@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue. You can use the in-chat /test command to launch a test loop like you describe.

So you might do:

/test pytest some_tests.py

It will run them and feed the errors back to the LLM until the tests all pass and return exit code 0.

You can use control-R or the up-arrow to quickly pull up that same /test command again later in the chat.

@fdietze fdietze changed the title Comman line paramater to specify test command Command line paramater to specify test command Mar 9, 2024
@fdietze
Copy link
Author

fdietze commented Mar 9, 2024

Thanks. I'm aware of /test already. But since it's always the same tests which need to run for a project (especially type checks), I thought this could be set up to run automatically by specifying a command once.

@paul-gauthier
Copy link
Owner

Would it help if you could configure a test command, and then doing /test without any args would run that configured command?

@paul-gauthier paul-gauthier added the question Further information is requested label Mar 11, 2024
@fdietze
Copy link
Author

fdietze commented Mar 12, 2024

That would run the tests after the changes have already been commited, right? I thought it would be nicer to only have commits for changes, which have passed the test command.

@paul-gauthier
Copy link
Owner

In general, I'm not prioritizing making a "tidy" or "perfect" git commit history. The priority is using git to make sure it's easy to undo/revert/inspect the history of changes made by the AI. If a clean commit history is important to you, you can always use git rebase to tidy things up.

@fdietze
Copy link
Author

fdietze commented Mar 27, 2024

Ok, I see, that makes sense. Then I like your suggestion of configuring a test command which you can invoke using /test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants