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 test for inserting the keyword INCLUDE from a PyAction in a paral… #5881

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lisajulia
Copy link
Contributor

…lel run with 4 processes

@lisajulia
Copy link
Contributor Author

jenkins build this please

@akva2
Copy link
Member

akva2 commented Jan 15, 2025

is there really any parallel aspect to this ? it seems to me that it would be doing exactly the same on all processes which means adding 20+ secs to the test suite for no good reason.

@lisajulia
Copy link
Contributor Author

is there really any parallel aspect to this ? it seems to me that it would be doing exactly the same on all processes which means adding 20+ secs to the test suite for no good reason.

Yes, you’re right, the test is to make sure that the functionality to add the kw "INCLUDE" in a parallel run is covered by at least one test. I understand the concern about the added time, yet I'd actually prefer to keep this test, if we want to reduce the test suite duration, I’d rather consider removing the sequential test instead.

@bska
Copy link
Member

bska commented Jan 15, 2025

Just a tangential remark here since I haven't been following the development at all. The "regular" action handling (i.e., for the ACTIONX keyword) does not permit INCLUDE in action block. We're of course free to relax that restriction in our own PYACTION keyword but for what it's worth, I do understand why INCLUDE is not permitted in ACTIONX.

@blattms
Copy link
Member

blattms commented Jan 15, 2025

FYI the test for INCLUDE in ACTIONX is from 2021 and our notes mark it as supported since at least 2 years...

@bska
Copy link
Member

bska commented Jan 15, 2025

FYI the test for INCLUDE in ACTIONX is from 2021 and our notes mark it as supported since at least 2 years...

Only by accident–we run essentially a full parse of the action block–and only because we've only ever seen very restricted use if any at all.

If we allow INCLUDE there's nothing to stop me from writing

ACTIONX
  A /
  SOME CONDITION /
/
INCLUDE
  'ExtraSteps.inc' /
ENDACTIO

with ExtraSteps.inc being something along the lines of

TSTEP
  100*12.3 /

That's going to really confuse the rest of the run if it expects to use DATES.

@lisajulia
Copy link
Contributor Author

lisajulia commented Jan 28, 2025

FYI the test for INCLUDE in ACTIONX is from 2021 and our notes mark it as supported since at least 2 years...

Only by accident–we run essentially a full parse of the action block–and only because we've only ever seen very restricted use if any at all.

If we allow INCLUDE there's nothing to stop me from writing

ACTIONX
  A /
  SOME CONDITION /
/
INCLUDE
  'ExtraSteps.inc' /
ENDACTIO

with ExtraSteps.inc being something along the lines of

TSTEP
  100*12.3 /

That's going to really confuse the rest of the run if it expects to use DATES.

Sorry for the late reply - yes you're right! Should we remove it from the supported keywords? Or at least display a warning that the user must be cautious?

@bska
Copy link
Member

bska commented Jan 29, 2025

FYI the test for INCLUDE in ACTIONX is from 2021 and our notes mark it as supported since at least 2 years...

Only by accident–we run essentially a full parse of the action block–and only because we've only ever seen very restricted use if any at all.

If we allow INCLUDE there's nothing to stop me from writing

ACTIONX
  A /
  SOME CONDITION /
/
INCLUDE
  'ExtraSteps.inc' /
ENDACTIO

with ExtraSteps.inc being something along the lines of

TSTEP
  100*12.3 /

That's going to really confuse the rest of the run if it expects to use DATES.

Sorry for the late reply - yes you're right! Should we remove it from the supported keywords? Or at least display a warning that the user must be cautious?

Do you mean in the manual? If so, then yes I think we should at least add a warning there and a note that this is subject to change in the future.

Due to the way we're currently parsing INCLUDE statements–effectively resolving the link immediately regardless of context and pasting the contents of the include file directly into the to token stream–we don't have a way of detecting INCLUDE inside an action block and therefore no way of issuing a diagnostic message if the situation happens. As an aside, this mechanism is the reason that INCLUDE "works" in this context right now. I agree that it's very convenient and it allows us factor things like segment definitions out of the action block itself, but as I said that's a quirk of the current parser implementation. If that implementation changes, and it might have to if we're going to support nested action blocks, then we may not be able to continue to "support" this feature.

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.

4 participants