No Compromises · Joel Clermont and Aaron Saray
Have you ever fixed a failing test by adding a variable to phpunit.xml and moved on, not thinking twice about whether that was actually the right call? In the latest episode of the No Compromises podcast, we discuss a real pull request disagreement about where environment variables belong and why it actually matters. We draw an important distinction between credentials and workflow configuration in your env file, and why that difference should determine exactly what goes into phpunit.xml and what stays out. We also get into why zeroing out API keys and hostnames in your test environment is not optional, and how a small oversight in one PR can quietly expose your tests to real third-party services. (00:00) - A real PR disagreement about phpunit.xml (01:07) - Credentials vs workflow config in your env file (03:17) - Why Aaron is glad his tests failed (04:49) - How to properly isolate third-party test keys (07:25) - Silly bit Come talk through decisions like these with developers who care in the No Compromises community.
0:00JoelWelcome to No Compromises. A peek into the mind of two old web devs who have seen some things. This is Joel.
0:08AaronAnd this is Aaron.
0:16JoelAaron, thanks for joining me here. I would like to discuss a recent PR in public and just have a chance to debate it a little bit more.
0:24Because I seem to recall in a code review, I think I was reviewing your pull request, and I didn't really care. Like I didn't think, "Oh, this is terrible."
0:33But I'm like, "Why did you do this?" And I made an offhand comment, and you're like, "Yeah, I disagree." I'm like, "You know what?
0:37That'll be a good podcast topic." So here we are.
0:40AaronOkay.
0:41JoelSo the scenario to set up what I had observed in the PR that I was commenting on was that you had added a bunch of values to our phpunit.xml file.
0:53And these were keys that are also specified in the .env.example file, right? And so, it doesn't matter what they're for,
1:01but they're for talking to an external service.
1:03AaronYeah. Well, and before you go on too far, let's make sure when we say it doesn't matter what they're for.
1:07The .env locally is filled up of two different things, right? The .env file. It's filled up of workflow control and credentials.
1:16JoelOkay.
1:17AaronSo workflow control, I mean, things like is this enabled or is it not enabled?
1:20JoelOh, sure.