Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

[meta] fail make test on error #1386

Merged
merged 1 commit into from
Oct 7, 2021
Merged

[meta] fail make test on error #1386

merged 1 commit into from
Oct 7, 2021

Conversation

jmlrt
Copy link
Member

@jmlrt jmlrt commented Oct 7, 2021

This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix #1385

This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix elastic#1385
@jmlrt jmlrt added the meta label Oct 7, 2021
@jmlrt jmlrt requested a review from a team October 7, 2021 16:09
@jmlrt jmlrt marked this pull request as ready for review October 7, 2021 16:09
@jmlrt
Copy link
Member Author

jmlrt commented Oct 7, 2021

CI tests are expected to fail because of #1375

@jmlrt
Copy link
Member Author

jmlrt commented Oct 7, 2021

Reproduced with a test Makefile:

  • This is successful despite ls $TEST_VAR is failing:
$ make -f test.mk
for i in $(seq 1 5); do \
                if [ -z "$TEST_VAR" ]; then \
                        sleep 1; \
                        echo "waiting"; \
                        TEST_VAR=toto; \
                else \
                        echo "Testing: $TEST_VAR" && \
                        ls $TEST_VAR; \
                        break; \
                fi; \
        done
waiting
Testing: toto
ls: toto: No such file or directory
$ echo $?
0
  • This is failing as expected:
$ make -f test.mk
set -eo pipefail; \
        for i in $(seq 1 5); do \
                if [ -z "$TEST_VAR" ]; then \
                        sleep 1; \
                        echo "waiting"; \
                        TEST_VAR=toto; \
                else \
                        echo "Testing: $TEST_VAR" && \
                        ls $TEST_VAR; \
                        break; \
                fi; \
        done
waiting
Testing: toto
ls: toto: No such file or directory
make: *** [test] Error 1
$ echo $?        
2

Copy link
Contributor

@Conky5 Conky5 left a comment

Choose a reason for hiding this comment

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

LGTM

@jmlrt jmlrt merged commit cd9e50c into elastic:master Oct 7, 2021
@jmlrt jmlrt deleted the fix-make-test branch October 7, 2021 16:41
jmlrt added a commit to jmlrt/helm-charts that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix elastic#1385
jmlrt added a commit to jmlrt/helm-charts that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix elastic#1385
jmlrt added a commit to jmlrt/helm-charts that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix elastic#1385
jmlrt added a commit to jmlrt/helm-charts that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix elastic#1385
jmlrt added a commit that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix #1385
jmlrt added a commit that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix #1385
jmlrt added a commit that referenced this pull request Oct 7, 2021
This commit fix the make test target to fail with the proper exit code
if a shell command is failing.

Fix #1385
@jmlrt jmlrt mentioned this pull request Mar 8, 2022
@jmlrt jmlrt mentioned this pull request Apr 21, 2022
This was referenced Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[meta] CI tests jobs are successful when goss tests are failing
2 participants