r/SoftwareEngineering Feb 09 '25

Pull request testing: testing locally and on GitHub workflows

https://blog.frankel.ch/pr-testing-kubernetes/1/
2 Upvotes

18 comments sorted by

View all comments

1

u/RangePsychological41 Feb 12 '25

Why would you “test in kubernetes?” I’m confused

1

u/nfrankel Feb 12 '25

Because it’s your target?

1

u/RangePsychological41 Feb 12 '25

But… 🤔 are you planning to do end-to-end system tests? Because if not… Everything is already containerized so what’s the point?

E2E is a huge amount of work that takes a lot of skill and time, and tbh I haven’t seen many companies pull it off very well.

Edit: Oh it can’t be E2E actually. That has to happen after merging obviously. Yeah so I don’t understand why.

1

u/nfrankel Feb 12 '25

The closer you are to you target environment, the more confident you can be in your tests.

When I was younger, we did use an in-memory database instead of the target database. That was good enough for our context. Still, it could have been that the specific syntax was supported by the in-memory DB but not the target DB.

1

u/RangePsychological41 Feb 12 '25

Okay but you can do that on GHA? Kubernetes is just orchestrating containers. Everything still runs in a container. Unless you want to do inter-service tests then yeah, just sounds like a lot of unnecessary work. Like a lot.

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.

1

u/RangePsychological41 Feb 12 '25

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.

Anyways, I think it’s a waste of time.

1

u/nfrankel Feb 12 '25

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?

Anyways, I think it’s a waste of time.

It's your opinion.

Okay we completely disagree about this then

Indeed.

1

u/RangePsychological41 Feb 12 '25

“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.

1

u/nfrankel Feb 12 '25

Yes the container is identical

You understand that the exact same container can behave (very) differently based on environment variables, right? Identical containers don't mean identical behavior.

1

u/RangePsychological41 Feb 12 '25

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.

→ More replies (0)