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

ci(run-tests): fix data JSON checker error reporting #3722

Merged

Conversation

tiborsimko
Copy link
Member

Fixes a problem with the CI data JSON checker that was not reporting proper error code when checking multiple files.

@tiborsimko tiborsimko self-assigned this Mar 5, 2025
if old_content != new_content:
if check:
print(f"[ERROR] File {filename} is badly formatted.")
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine that there are 10 files failing. The first execution of the script will only show the first file, and exit. Then, the user will fix that one, run the script again and it will fail in the next one.
Wouldn't it be better if it gave the list of all the badly formatted files on the first execution? That would be consistent with the pytest

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Fixed.

@tiborsimko tiborsimko force-pushed the ci-fix-data-json-checker-exit-code branch 2 times, most recently from 22e7612 to 393e110 Compare March 5, 2025 12:59
Fixes a problem with the CI data JSON checker that was not reporting
proper error code when checking multiple files.
@tiborsimko tiborsimko force-pushed the ci-fix-data-json-checker-exit-code branch from 393e110 to b0c24a5 Compare March 11, 2025 09:31
@tiborsimko tiborsimko merged commit b0c24a5 into cernopendata:master Mar 11, 2025
16 checks passed
@tiborsimko tiborsimko deleted the ci-fix-data-json-checker-exit-code branch March 11, 2025 10:36
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.

2 participants