-
Notifications
You must be signed in to change notification settings - Fork 1
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
114 looks for errors in the structlogger in tests #115
114 looks for errors in the structlogger in tests #115
Conversation
pyproject.toml
Outdated
@@ -33,6 +33,7 @@ dev = [ | |||
"pytest", | |||
"ruff", | |||
"structlog==22.3.0", | |||
"nomad-lab[infrastructure]>=1.3.4dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the infrastructure dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the dependencies from nomad
are needed when running the cap log fixture, specifically:
"python-logstash==0.4.6",
"mongoengine>=0.20",
"pyjwt[crypto]==2.6.0",
"unidecode==1.3.2",
"fastapi==0.92.0",
"zipstream-new==1.1.5",
Since all of them were mentioned in the infrastructure
, I thought of adding the full set to avoid future import errors if a new dependency is added, which the cap log fixture might require. However, we can also list only the dependencies that are currently required.
564ea06
to
b4b6696
Compare
b4b6696
to
cfa9126
Compare
1234047
to
bb71620
Compare
@hampusnasstrom I checked again if infra deps are still needed. Only one of them is required: To test the caplog fixture, you can log an error in the normalize method. This should make the pytest fail. For example, adding this: logger.error('Error: here for testing') here: |
1504c10
to
140ab7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
140ab7a
to
e5592f2
Compare
* Add fixture to capture error from logs * Add nomad-lab infrastructure deps required by caplog fixture * Ruff * Refactoring fixtures; parameterize caplog to allow capturing different log levels * Removing the formatter from nomad.utils * testing: add logger.error in normalize * testing: adding the formatter from nomad.utils * Add logstash dep; cleaning * Cleaning * Specify caplog as an arg (from review)
* Added general PPMS plugin in its old structure * Adapted PPMS structure * Quick fix on the entry points * Fix in schema bound_logger import * Fixed formatting * Fixed some typos * Small Fix: ACT -> ETO * changed names and made test folder * added entrydata_definition for parser specilization * lint * Changed repeats to not is_scalar in merge_sections (#136) Updated `merge_sections` util function to work with the latest nomad-lab version * 137 merge sections break for non scalar quantities (#138) * Added breaking test for boolean array * Added more breaking test cases * Added fix for comparing non numpy arrays * Ruff * Enhance test_merge_sections to capture output and validate float_array values * Refine warning message for merging sections with differing quantity values * Refactor merge_sections to improve warning logic for differing quantity values * 139 merge sections still breaking for pint quantity arrays (#140) * Added breaking test for float array with units * Added fix for comparison of pint quantity arrays * Added test for multi dimensional array * Ruff * 114 looks for errors in the structlogger in tests (#115) * Add fixture to capture error from logs * Add nomad-lab infrastructure deps required by caplog fixture * Ruff * Refactoring fixtures; parameterize caplog to allow capturing different log levels * Removing the formatter from nomad.utils * testing: add logger.error in normalize * testing: adding the formatter from nomad.utils * Add logstash dep; cleaning * Cleaning * Specify caplog as an arg (from review) * moved nomad search import * lint * change create_archive inheritance * lint * fix test files path * Added ETO test file to tests/ppms * Added ETO sequence file to tests/ppms * Changed regex in parsers mainfile_name_re * Removed entry_type from PPMSSequenceParser * lint * Fixed PPMS parsers Added call of set_entrydata_definition to parse * Added test for PPMS data file * Update __init__.py * Fixed failing ppms test * Fixed ppms test again * PPMS data parser now matches two mime types --------- Co-authored-by: Andrea Albino <andrea.albino@physik.hu-berlin.de> Co-authored-by: Hampus Näsström <hampus.nasstrom@gmail.com> Co-authored-by: Sarthak Kapoor <57119427+ka-sarthak@users.noreply.github.com>
Resolves #114