Skip to content

Fix broken test and report CI failing correctly #207

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

toshipp
Copy link
Contributor

@toshipp toshipp commented Jan 7, 2021

Because the script hack/go.sh ci-checks does not report its failure by the exit code, we can not notice a CI failure.
This fixes the issue and also fixes found broken tests.

Signed-off-by: Toshikuni Fukaya [email protected]

@satoru-takeuchi
Copy link

LGTM

@toshipp
Copy link
Contributor Author

toshipp commented Jan 27, 2021

Could someone review this?

@satoru-takeuchi
Copy link

Could some one take a look at this PR? It's a small PR and we can't detect some CI failures without applying it.

@guymguym
Copy link
Collaborator

guymguym commented Mar 6, 2021

@jeffvance @copejon ?

@@ -86,8 +90,9 @@ linters(){
ci-checks(){
echo "-------- beginning preflight checks"
lint
test
build
test || RET=$?
Copy link
Collaborator

Choose a reason for hiding this comment

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

perhaps safer to define local RET=0 in all those functions instead of setting a global var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, It is preferable. I'll fix them

)
return $?
Copy link
Collaborator

@jeffvance jeffvance Mar 8, 2021

Choose a reason for hiding this comment

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

It looks like the goal here is to try to build every pkg, even when 1 or more fails. But the err returned is for the last failure only. Perhaps we should fail on the 1st build error, or return a list of error strings of a format like: "$p: $?". What do you think?

Same comment for test() below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is to report the build status to CI.
If use fail-fast manner, it is sufficient for the purpose, however, it breaks current behavior which tries to build all packages.
I don't want to change the behavior because some tools may depend on such behavior.
And I personally prefer that all build error is reported.

For 2nd suggestion, it is not effective, IMO.
The script already does echo for package names, and Go also reports which package fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants