-
Hi, I've been switching over to Docker and also familiarizing myself with TDD as well as a CI/CD setup, but I'm a bit unsure as to how to approach this, and have some questions about this process. I've been trying to get a test-setup working on my development environment, but I seem to keep running into issues, so I was wondering if I might have the wrong approach, so I thought it might be a good idea to ask how others prefer to integrate testing into the process. Since the Read-Me says this repository is CI ready, I assume you must have some kind of workflow thought out as to how this is implemented optimally/preferably? Some concrete questions:
I would love to learn how to do this properly, so any pointers are greatly appreciated, not just from the repository's maintainers, but from the wider community as well. As a side note: I do have some experience with writing tests, and have also been able to get testing frameworks functional using my IDE, it's mostly the integration with Docker and the CI/CD part that I'm having some issues with / uncertainties about. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @antiftw , I've recently discovered that this template is CI ready! and not so hard to use. So here's my answer to your questions:
# config/packages/doctrine.yaml
# ....
when@test:
doctrine:
dbal:
# "TEST_TOKEN" is typically set by ParaTest
dbname_suffix: '_test%env(default::TEST_TOKEN)%' When you install the symfony test pack all should be installed and work just fine to use the CI with phpUnit (you sould uncomment the if: false statement in .github/workflows/ci.yaml according to your usage doctrin / php unit
Hope this help |
Beta Was this translation helpful? Give feedback.
-
Hi @tdumalin, Thank you very much for the detailed answer!
Again, thanks a lot, you've been very helpful, and I think I now know what I will have to look into to proceed. Kind regards, |
Beta Was this translation helpful? Give feedback.
Hello @antiftw ,
I've recently discovered that this template is CI ready! and not so hard to use.
I'll let the CD part for another time.
So here's my answer to your questions:
I'd highly recommend to create and run your tests on your local machine while developing (using the TDD is up to you and doesn't change any thing on the CI configuration). The CI runs the same tests as your local machine does but it's purpose is to verify that when you push to the main branch, every thing works as it should be and you didn't break anything since the previous comit
With the template you can re-use your development container, check the "Build Docker images" in .github/workflows/ci.yaml under with.…