8000 Add tests for `aiidalab registry parse-app-repo`, fix error handling by danielhollas · Pull Request #551 · aiidalab/aiidalab · GitHub
[go: up one dir, main page]

Skip to content

Add tests for aiidalab registry parse-app-repo, fix error handling - #551

Merged
danielhollas merged 8 commits into
mainfrom
parse-app-repo-tests
Oct 21, 2026
Merged

danielhollas merged 8 commits into
mainfrom
parse-app-repo-tests

Conversation

@danielhollas
@danielhollas danielhollas commented Oct 12, 2026 •
Copy link
Copy Markdown
Contributor

The command now reports all parsing failures (including RuntimeError and configparser errors, which previously crashed with a traceback) via click.ClickException, and exits with a non-zero exit code.

I verified this manually by trying to parse a folder with invalid setup.cfg.

❯ aiidalab registry parse-app-repo .
Parsing '.'
Error: Failed to parse metadata from '.': File contains no section headers.
file: '<string>', line: 1
'aiidalab]\n'

On main the whole stack trace is printed:

❯ aiidalab registry parse-app-repo .
Parsing . ...
Traceback (most recent call last):
  File "/home/hollas/atmospec/aiidalab/.venv/bin/aiidalab", line 10, in <module>
    sys.exit(cli())
             ^^^^^
.
.
.
  File "/home/hollas/atmospec/aiidalab/aiidalab/metadata.py", line 213, in from_setup_cfg
    return cls(**_parse_setup_cfg(content))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hollas/atmospec/aiidalab/aiidalab/metadata.py", line 110, in _parse_setup_cfg
    cfg.read_string(setup_cfg)
  File "/usr/lib64/python3.12/configparser.py", line 710, in read_string
    self.read_file(sfile, source)
  File "/usr/lib64/python3.12/configparser.py", line 705, in read_file
    self._read(f, source)
  File "/usr/lib64/python3.12/configparser.py", line 1064, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: '<string>', line: 1
'aiidalab]\n'

Tests generated by Claude 5.5 and checked by me.
Also bumps the minimum click version to 8.1, the same as in aiida-core 2.9

@danielhollas
danielhollas added this pull request to stack #552 October 12, 2026 14:24
@codecov
codecov Bot commented Oct 12, 2026 •
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.71%. Comparing base (bc179c7) to head (a6c8799).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #551      +/-   ##
==========================================
+ Coverage   79.19%   79.71%   +0.52%     
==========================================
  Files          18       18              
  Lines        1759     1760       +1     
==========================================
+ Hits         1393     1403      +10     
+ Misses        366      357       -9     
Flag Coverage Δ
py-3.12 79.65% <100.00%> (+0.46%) ⬆️
py-3.14 79.62% <100.00%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pyproject.toml Resolved
@danielhollas
danielhollas marked this pull request as ready for review October 13, 2026 12:25
@edan-bainglass edan-bainglass left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@danielhollas
Copy link
Copy Markdown
Contributor Author

Thanks for review @edan-bainglass

In the last commit I've added the indent=2 parameter so that the json-output is pretty-printed.

Before

image

After

image

Base automatically changed from remove-aiidalab-folder to main October 21, 2026 16:44
danielhollas and others added 8 commits October 21, 2026 17:44
The command now reports all parsing failures (including RuntimeError and
configparser errors, which previously crashed with a traceback) via
click.ClickException, and exits with a non-zero exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danielhollas
danielhollas merged commit c144c93 into main Oct 21, 2026
7 checks passed
@danielhollas
danielhollas deleted the parse-app-repo-tests branch October 21, 2026 16:46
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

0