Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BSD sed and older bash in test rule. #112

Merged

Conversation

porridge
Copy link
Member

@porridge porridge commented Nov 9, 2021

BSD sed (as shipped with MacOS) does not support + nor \+ in regular expressions.
However it does support \{1,\} which does the same thing and is also supported by GNU sed.

Moreover, bash 3.2 (as shipped with MacOS) does not seem to support source <(...), it seems to just do nothing.
Using plain eval seems to do the trick though.

Symptom of the former issue is:

source <(setup-envtest use -p env v0.22.1) && go test -race -covermode atomic -coverprofile cover.out ./...
version be a valid version, or simply 'latest' or 'latest-on-disk': unable to parse "v0.22.1" as a version stringshould be X.Y.Z, where Z may be '*','x', or left off entirely to denote a wildcard, optionally prefixed by ~|<|<=, and optionallyfollowed by ! (latest remote version)

And of the latter:

      unable to start control plane itself: failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory

(even though the binaries are fetched by setup-envtest)

Fixes: #117

BSD sed (as shipped with MacOS) does not support `+` nor `\+` in regular expressions.
However it does support `\{1,\}` which does the same thing and is also supported by GNU sed.

Moreover, bash 3.2 (as shipped with MacOS) does not seem to support `source <(...)`, it seems to just do nothing.
Using plain eval seems to do the trick though.
@porridge
Copy link
Member Author

porridge commented Nov 9, 2021

/assign @fabianvf

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1439360561

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 61.977%

Totals Coverage Status
Change from base Build 1413779466: 0.0%
Covered Lines: 1674
Relevant Lines: 2701

💛 - Coveralls

Copy link
Member

@fabianvf fabianvf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

This is working for me on Fedora as well

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2021
Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infra lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make test does not work on MacOS
4 participants