Add ArithmeticAdd
CJ Node fixture without run
or submit
#6733
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a fixture to obtain an
ArithmeticAdd
CalcJobNode
that doesn't require to actuallyrun
theProcess
. 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 theProcess
(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 theMultiplyAddWorkChain
, if it turns out to be actually useful to be able to obtainCalcJobNode
s andWorkChainNode
s for testing that don't to rely on actually submitting to/running on aComputer
.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
CalcJobNode
s andWorkChainNodes
, organized in groups, etc., for testing theprofile 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, thegenerate_calculation_node_add
fixture I wanted to use is function-scoped and therefore pytest throws aScopeMismatch
exception... (and so are the fixtures it relies on, such asaiida_localhost
)Pinging @khsrali and @unkcpz, if you have comments <3