openshift-docs icon indicating copy to clipboard operation
openshift-docs copied to clipboard

[prow/ci] fix compatibility for testing on macOS

Open jldohmann opened this issue 3 weeks ago • 6 comments

Fixes sed and grep issues on BSD/macOS

before, when testing locally, when grep fails silently, it returns empty strings. these are then interpreted by bash as 0, which in turn alters the git diff range being looked at for vale errors

sed -i was tripping up on certain module names, like backup-etcd.adoc and interpreting them as arguments or something. i just added an empty string

Version(s): main

jldohmann avatar Dec 17 '25 21:12 jldohmann

🤖 Wed Dec 17 23:46:01 - Prow CI generated the docs preview:

https://104106--ocpdocs-pr.netlify.app/

ocpdocs-previewbot avatar Dec 17 '25 21:12 ocpdocs-previewbot

@jldohmann Since this script is only run in a Linux environment (automatically, anyway), would it make more sense to add a Mac-specific version to the dir it's in for when people need to troubleshoot?

Might be somewhat annoying to keep them in sync if we're making a lot of changes, but I'm also nervous about changing anything that doesn't absolutely need changing in these shell scripts at the moment.

Superior usability/error handling/everything could come with a move away from bash.

maxwelldb avatar Dec 17 '25 22:12 maxwelldb

@maxwelldb i mean we could do that, but as we continue to work on this script that doubles the amount of changes and testing that i need to do when investigating locally. are you seeing issues with it on debian?

jldohmann avatar Dec 17 '25 22:12 jldohmann

i mean like are you running in on debian and seeing errors? it should behave the same way

jldohmann avatar Dec 17 '25 22:12 jldohmann

Buuuuuuut, if we want to keep this, could we detect OS? Don't know how brittle that would be

we can do that but it's superfluous imo

jldohmann avatar Dec 17 '25 22:12 jldohmann

@jldohmann: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

openshift-ci[bot] avatar Dec 17 '25 23:12 openshift-ci[bot]