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

Add ArithmeticAdd CJ Node fixture without run or submit #6733

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GeigerJ2
Copy link
Contributor

@GeigerJ2 GeigerJ2 commented Jan 28, 2025

This PR introduces a fixture to obtain an ArithmeticAdd CalcJobNode that doesn't require to actually run the Process. Instead, the incoming and outgoing links (and properties) are manually added (set). Not sure if this will be actually useful for testing in the future, but I'd probably put it under nice-to-have.

There are likely still a few details missing to get exactly the same Node, as one obtains when actually running the Process (which is typically done in the test suite via the builder/factory and inputs), and I haven't checked if suitable tests would also run through with this fixture. Though, at least for my dumping-related tests, the obtained node gives the same results. One could also do the same for the MultiplyAddWorkChain, if it turns out to be actually useful to be able to obtain CalcJobNodes and WorkChainNodes for testing that don't to rely on actually submitting to/running on a Computer.

The main motivation that led to adding the fixture of this PR was to be able to add tests to #6723, where I would like to construct a profile with some CalcJobNodes and WorkChainNodes, organized in groups, etc., for testing the profile mirror functionality. However, I'd like to have the setup of this profile's data structure to be class or session-scoped, as it takes some compute time to set up, and should not be repeated for every test method. However, the generate_calculation_node_add fixture I wanted to use is function-scoped and therefore pytest throws a ScopeMismatch exception... (and so are the fixtures it relies on, such as aiida_localhost)

Pinging @khsrali and @unkcpz, if you have comments <3

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.09%. Comparing base (f43a510) to head (9f9aeee).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6733   +/-   ##
=======================================
  Coverage   78.09%   78.09%           
=======================================
  Files         564      564           
  Lines       42544    42544           
=======================================
  Hits        33219    33219           
  Misses       9325     9325           

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

@unkcpz
Copy link
Member

unkcpz commented Feb 6, 2025

I think this is a nice thing to have, for the tests that we don't want to actually test the transport this is a good gain on performance.

@GeigerJ2
Copy link
Contributor Author

GeigerJ2 commented Feb 6, 2025

Note to self. There exists a similar fixture (factory) in aiida-qe:
https://github.com/aiidateam/aiida-quantumespresso/blob/c4d7c190456deca0c26e4fc36304e973fe14a2c2/tests/conftest.py#L208

Also pinging @edan-bainglass, as @unkcpz mentioned you were also looking for this in the past. I'll clean up the code here a bit, check how it's done in the QE fixture, and implement a version for the MultiplyAdd, as well.

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