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

Test: Formatting Check Always Finishes Successfully on Second Invocation #3281

Closed
sanssecours opened this issue Nov 25, 2019 · 1 comment
Closed

Comments

@sanssecours
Copy link
Member

Steps to Reproduce the Problem

  • Add some incorrectly formatted C or C++ code to the repository

Expected Result

Either Cirrus or Travis should report the incorrectly formatted code. The build jobs that test formatting should finish unsuccessfully.

Actual Result

All build jobs finish successfully.

Additional Information

The script testscr_check_formatting fails in the CI builds as expected. However, since we use ctest $ARGS --rerun-failed:

ctest $ARGS || ctest $ARGS --rerun-failed

the test testscr_check_formatting is executed again. This time the test does not fail, since the source was modified:

if ! git diff --quiet; then
printf >&2 'Source is already modified, aborting test!\n\n'
exit 0
fi

.

Possible Fix

One option to solve this problem would be to stash the current changes at the end of the check_formatting.sh. I do not know if doing that has other unintended consequences though.

@markus2330
Copy link
Contributor

Thank you so much for this detailed issue. I think this is a good first issue?

sanssecours added a commit to sanssecours/elektra that referenced this issue Dec 14, 2019
@mpranj mpranj closed this as completed in 567a105 Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants