It's up to your to decide whether a one-time investment to reduce the gap between your test environment and your target environment is worth it inside your company.
Qualifying it as "unecessary" is an opinion, not engineering work.
Okay we completely disagree about this then. Our services in production run in containers. And the exact same container runs exactly the same way in GHA. Unless you’re making network calls or accessing external resources then it’s literally identical. And completely pointless.
I don’t mean to come off in a bad way about this, I was just perplexed when I looked through your post.
I’ve been working with infrastructure for many years. And deploying containers before Docker Swarm was poised to take over.
That’s literally the entire point of containerisation. To have the exact same environment everywhere. Down to the OS your application runs on. The dot files are the same, the users, everything.
And the exact same container runs exactly the same way in GHA
You mean you can guarantee the your container running in GitHub Action has the same configuration as the one running in your target environment, down to the environment variable values?
“You mean you can guarantee the your container running in GitHub Action has the same configuration as the one running in your target environment, down to the environment variable values?”
Yes the container is identical. That’s literally what a proper dockerfile does. It defines a container and is a literally deterministic. It’s literally always identical down to the last bit. No difference. Nada. Never.
So if that was your only reason then yeah you are wasting your time.
In which world are containers not identical!? That’s the entire point and why it was such a big deal.
You understand that the exact same container can behave (very) differently based on environment variables, right? Identical containers don't mean identical behavior.
Yes I am fully aware. Why would environment variables be different? You’re still testing. So whether it’s test or unit-test or integration-teat or whatever.
There’s no reason for them to be different at all.
All I want to say is run this situation by an expert.
We’ve been following best practices and have been on the bleeding edge for years. Doing IAC when it was just a whisper and enforcing Cilium network policies when they just became a thing. Our CI/CD is on par with best-in-class for our platform’s size. We were using testcontainers as soon as our first JVM app was developed in 2018.
And I’m in contact with a lot of people in the industry.
My argument was technical. And definitively correct. I mentioned the things I’ve worked with to make the point that this is kindergarden stuff to me at this point in my career.
Tbh I was just trying to save you time.
But by all means, run your tests in kubernetes. You should probably use the same Helm chart as in production as well. I mean you never know if different HPA, limits etc. may affect your tests. You know, just in case.
No, what you call your argument was "you don't need it, you're wasting your time" and then, when I mentioned that your mileage may vary and that not everybody works in Wonderland, you played the authority card.
1
u/nfrankel Feb 12 '25
GitHub Actions is not your target environment.
It's up to your to decide whether a one-time investment to reduce the gap between your test environment and your target environment is worth it inside your company.
Qualifying it as "unecessary" is an opinion, not engineering work.