BAT test don't detect unbound vars

Hi All,
I’m currently working on a plugin and I’ve found that the BAT test don’t detect unbound variable issues. Meaning, I have all my tests passing, in multiple scenarios, but later when the real build runs one of those scenarios it fails with an “Unbound Var” error which I cannot reproduce on my tests.

Is there any particular setting I need to add or enable to make that happen? My tests and lib files all have the set -u in them.

Thanks in advance.

I’d love to be able to share my plugin with you all but it’s still on a private repo, sorry :/

Hi @smoreno-allurion !

We’re taking a look at this for you an will get back to you as soon as possible.

Thank you! :slight_smile:

Hello again @smoreno-allurion !

Just confirming, you are talking about this? GitHub - buildkite-plugins/buildkite-plugin-tester: 🔨 A base Docker image for testing Buildkite plugins

If so, would you be able to check if there’s a script that you’re running that may have an unbound variable? It’s possible it’s not BATS but the script itself. If you maybe remove the variable definition and run the build, check to see what happens?

Would you also be able to send a link to the failing build to so we can take a closer look?

Thanks a bunch!! :slight_smile:

Thanks, misteriously enough, it started to work. Don’t know if it was a base image change or something else, but I’m getting the unbound errors on my tests now (without any changes from my side).