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

Extend instead of overrride PATH in tests #215

Merged
merged 2 commits into from
Dec 10, 2024
Merged

Conversation

fsimonis
Copy link
Member

@fsimonis fsimonis commented Nov 7, 2024

Main changes of this PR

This allows to change PATH after configuring and building ASTE.
It also allows to use a venv created afterward building.

Author's checklist

  • I used the pre-commit hook and used pre-commit run --all to apply all available hooks.
  • I added a test to cover the proposed changes in our test suite.
  • I updated the documentation in docs/README.md.
  • I added a changelog entry in ./changelog-entries/ (create if necessary).
  • I updated potential breaking changes in the tutorial precice/tutorials/aste-turbine.

@@ -135,7 +135,7 @@ foreach(example IN LISTS _examples)
set_tests_properties(aste.example.${example} aste.example.${example}.setup
PROPERTIES
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/examples/${example}"
ENVIRONMENT "PATH=$ENV{PATH}:${CMAKE_BINARY_DIR}"
Copy link
Member

Choose a reason for hiding this comment

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

Is this also how we handle this in our preCICE profiling tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

There, the test directly calls the file, so PATH modifications aren't required.

Copy link
Member

Choose a reason for hiding this comment

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

And in our case the python script calls the file, right?

Since the diff at the end is part of the test: can we do something similar here?

Copy link
Member Author

@fsimonis fsimonis Nov 8, 2024

Choose a reason for hiding this comment

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

In this case, CTest calls the run.sh, which calls the precice-aste-* scripts.
The run.sh needs the updated PATH.

One could pass the binary directory by argument to the script, but this seems a bit unintuitive for users that try to run the example.

Does this answer your questions?

@fsimonis fsimonis self-assigned this Dec 10, 2024
@fsimonis fsimonis requested a review from davidscn December 10, 2024 10:03
@davidscn davidscn merged commit 4952531 into develop Dec 10, 2024
6 checks passed
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