You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Berenguer Blasi (Jira)" <ji...@apache.org> on 2021/05/05 10:36:00 UTC

[jira] [Commented] (CASSANDRA-16655) cassandra-cqlsh-tests.sh should return different return codes on circle vs jenkins

    [ https://issues.apache.org/jira/browse/CASSANDRA-16655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17339577#comment-17339577 ] 

Berenguer Blasi commented on CASSANDRA-16655:
---------------------------------------------

The current sh returns the error code upon a test failure and circle command presence
{noformat}
+ command -v circleci
+ exit 1
{noformat}

It returns '0' if the command is not found. I used a mock command for testing purposes
{noformat}
+ command -v circleci2
+ exit 0
{noformat}

> cassandra-cqlsh-tests.sh should return different return codes on circle vs jenkins
> ----------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16655
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16655
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CI
>            Reporter: Berenguer Blasi
>            Priority: Urgent
>             Fix For: 3.0.x, 3.11.x, 4.0-rc, 4.x
>
>
> Recent jenkins runs appear broken (red) bc of a cqlsh test failure. That reports the whole run as broken instead of that specific step with failures and an unstable (yellow) run.
> It appears the reason may be [this|https://github.com/apache/cassandra/blame/trunk/pylib/cassandra-cqlsh-tests.sh#L146] change. At that time that was necessary to make circle fail that step. Otherwise cqlsh failures would be ignored and that step rendered green regarless making it useless. But it has been found now this makes jenkins report the whole run red upon a cqlsh test failure.
> The solution seems to be to return different codes depending on whether we're on jenkins or circle. [~mck] has suggested sthg along these lines:
> {code}
> # circleci wants non-zero exit to report failures, jenkins wants zero exit for a unstable status
> [[ command -v circleci >/dev/null 2>&1 ]] && exit ${RETURN}
> exit 0
> {code}
> Procedure:
> - Fix the sh script
> - Break a cqlsh test
> - Test the test gets reported as a failure in circle
> - Test the test gets reported as a failure in jenkins and that the run and step are yellow (not red)
> - Fix the test
> - Both circle and jenkins report green for that step



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org