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

Add tests for qse init command with docker-compose flag. #98

Open
3 tasks
Naganathan05 opened this issue Jan 19, 2025 · 16 comments · May be fixed by #106
Open
3 tasks

Add tests for qse init command with docker-compose flag. #98

Naganathan05 opened this issue Jan 19, 2025 · 16 comments · May be fixed by #106
Assignees
Labels

Comments

@Naganathan05
Copy link
Contributor

Naganathan05 commented Jan 19, 2025

  • Include tests for console logs in terminals when docker-compose flag is enabled.

Note

It should be covering all the edge cases.
Example: For some templates, additional Important Note will be logged. These should be tested as well.

  • Test for docker-compose.yml file creation.
  • Test for Dockerfile creation.
@alguiguilo098
Copy link
Contributor

@gnypit, what's up?
Should I try to resolve this issue?

@Ashrockzzz2003
Copy link
Member

Ashrockzzz2003 commented Jan 22, 2025

@alguiguilo098
Assigned.

@alguiguilo098
Copy link
Contributor

@Ashrockzzz2003 I have problem run qse init -t templete --docker-compose

Image

you can help me resolve it problem ?

@Ashrockzzz2003
Copy link
Member

Ashrockzzz2003 commented Jan 23, 2025

When I run what you've commented qse init -t template --docker-compose I get this.

Image

Can you give me an exact way to reproduce the error. Cos I'm not getting this one.
Please check if you're up to date with main and try this

npm ci
npm link
cd qse-test # assuming you have a qse-test dir
npm link qse
# Then the command

@alguiguilo098
Copy link
Contributor

@Ashrockzzz2003 i replace templete for basic

i run qse init -t basic --dockercompose

@Ashrockzzz2003
Copy link
Member

Ashrockzzz2003 commented Jan 23, 2025

@alguiguilo098

It works fine for me. Try doing what I said earlier. It should work. Tested in Windows, Linux and MacOS. Follow the steps in documentation to properly setup dev env. Probably something went wrong there.

Image

@alguiguilo098
Copy link
Contributor

@Ashrockzzz2003 i tested Linux, which node version ?

Image

@Naganathan05
Copy link
Contributor Author

Naganathan05 commented Jan 23, 2025

@Ashrockzzz2003 i tested Linux, which node version ?

Image

@alguiguilo098

The Node version you're currently using is 17.9.1, which could cause an issue. Please update the Node version to 22.13.1 and try the command again.

@alguiguilo098
Copy link
Contributor

alguiguilo098 commented Jan 24, 2025

@Ashrockzzz2003 what, up ?

Image

Image

I'm having trouble running the command above because the process is waiting for a response to an event. Is there another way to execute the command through a function call with the event responses already established? And would it be too bad not to use exec

@Ashrockzzz2003
Copy link
Member

Ashrockzzz2003 commented Jan 24, 2025

You can simulate input events with @inquirer/testing.
https://www.npmjs.com/package/@inquirer/testing.
Add it as a dev dependency and use.

Workaround

If it's too much then, a new flag can be added to get the input value of cache through a flag. If flag is passed, get and use the value, else treat that as false. (--docker-compose-cache)

This way testing becomes easier and similar to other cases.

@alguiguilo098
Copy link
Contributor

@Ashrockzzz2003 thank you very much

@Ashrockzzz2003
Copy link
Member

@alguiguilo098
Any update?

@alguiguilo098
Copy link
Contributor

@Ashrockzzz2003 I couldn't use https://www.npmjs.com/package/@inquirer/testing. I also couldn't implement the docker-compose-cache flag. I'm having trouble sending input to the --docker-compose command.

@afmireski
Copy link

Hello, @Ashrockzzz2003. I'm a friend of @alguiguilo098, and they told me about this issue. I'd like to give it a try, if possible.

@Ashrockzzz2003
Copy link
Member

Sure
Assigned @afmireski

@afmireski
Copy link

Hello, thanks for this chance @Ashrockzzz2003. I've opened a PR: #106.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

4 participants