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

[FIX] issue 1637 #1720

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

[FIX] issue 1637 #1720

wants to merge 10 commits into from

Conversation

t-h2o
Copy link

@t-h2o t-h2o commented Nov 17, 2024

Fix the dry run flag

issue 1637

TODO

  • fix the bug
    • --dry-run flag set variable
    • dryRun avoid to read config
  • rename dry run by no config
  • write a better flag description to no config
  • Also add a test for it in application/testing/CMakeLists.txt

@mwestphal
Copy link
Contributor

Do you need help moving forward @t-h2o ?

@t-h2o
Copy link
Author

t-h2o commented Nov 25, 2024

Do you need help moving forward @t-h2o ?

yes, I am not familiar with F3D testing framework.

My goal is to test that no-config is set to 1:

'no-config' = '1' from CLI options

For that, I run this command

f3d --no-render --config=config_build --no-config --verbose

In application/testing/CMakeLists.txt

NOTE --no-render and --verbose are already set in the f3d test function -> I remove them

My result for lines to add into application/testing/CMakeLists.txt is... :

# Test that --no-config set no-config value to 1
f3d_test(NAME TestNoConfigWithConfig ARGS --no-config --config=config_build --verbose REGEXP "'no-config' = '1'" NO_BASELINE)

t-h2o added a commit to t-h2o/f3d that referenced this pull request Nov 25, 2024
@mwestphal
Copy link
Contributor

Please let me know if you need another review @t-h2o :)

@t-h2o
Copy link
Author

t-h2o commented Dec 10, 2024

Please let me know if you need another review @t-h2o :)

Hi @mwestphal, I have these two unanswered comments:

@mwestphal
Copy link
Contributor

Do you need help moving forward @t-h2o ?

yes, I am not familiar with F3D testing framework.

My goal is to test that no-config is set to 1:

'no-config' = '1' from CLI options

For that, I run this command

f3d --no-render --config=config_build --no-config --verbose

In application/testing/CMakeLists.txt

NOTE --no-render and --verbose are already set in the f3d test function -> I remove them

My result for lines to add into application/testing/CMakeLists.txt is... :

# Test that --no-config set no-config value to 1
f3d_test(NAME TestNoConfigWithConfig ARGS --no-config --config=config_build --verbose REGEXP "'no-config' = '1'" NO_BASELINE)

This looks correct to me

@mwestphal
Copy link
Contributor

Please let me know if you need another review @t-h2o :)

Hi @mwestphal, I have these two unanswered comments:

* [[FIX] issue 1637 #1720 (comment)](https://github.com/f3d-app/f3d/pull/1720#issuecomment-2496450147)

* [[FIX] issue 1637 #1720 (comment)](https://github.com/f3d-app/f3d/pull/1720#discussion_r1855644894)

I have answered your questions :)

@mwestphal
Copy link
Contributor

Do you need help moving forward @t-h2o ?

t-h2o added a commit to t-h2o/f3d that referenced this pull request Dec 17, 2024
Copy link
Contributor

@mwestphal mwestphal left a comment

Choose a reason for hiding this comment

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

missing TestNoConfigWithConfig

@t-h2o t-h2o marked this pull request as ready for review December 17, 2024 11:26
@@ -1049,6 +1049,9 @@ f3d_test(NAME TestConfigFileQuiet DATA nonExistentFile.vtp CONFIG ${F3D_SOURCE_D
# Test no file with config file
f3d_test(NAME TestNoFileConfigFile CONFIG ${F3D_SOURCE_DIR}/testing/configs/verbose.json ARGS --verbose REGEXP "No files to load provided" NO_BASELINE)

# Test that --no-config set no-config value to 1
f3d_test(NAME TestNoConfigWithConfig ARGS --no-config --config=config_build --verbose REGEXP "'no-config' = '1'" NO_BASELINE)
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of testing the verbosity of no-config, how about opening a file a taking a screenshot ? This way we ensure the config_build is not taken into account

@mwestphal
Copy link
Contributor

Looks like a few console test are failing, can you check them locally ?

@mwestphal
Copy link
Contributor

Looks like a few console test are failing, can you check them locally ?

You actually just need to update the baselines :)

--dry-run flag set variable
dryRun avoid to read config
in case dry-run or no-render is true,
we do not read the configuration file

from f3d --help:

[...]
--dry-run [=<bool>(=1)]   Do not read the configuration file
                          (default: false)
--no-render [=<bool>(=1)]
                          Do not read the configuration file
                          (default: false)
[...]
find . -name "*\.cxx" -exec sed -i 's/dry-run/no-config/g' {} \;
find . -name "*\.cxx" -exec sed -i 's/dryRun/noConfig/g' {} \;
find . -name "*\.txt" -exec sed -i 's/--dry-run/--no-config/g' {} \;
find . -name "*\.h" -exec sed -i 's/dry-run/no-config/g' {} \;
find . -name "*\.md" -exec sed -i 's/dry-run/no-config/g' {} \;
find . -name "*\.txt" -exec sed -i 's/DryRun/NoRender/g' {} \;
test it with
ctest -R NoConfigWithConfig
@t-h2o
Copy link
Author

t-h2o commented Dec 18, 2024

You actually just need to update the baselines :)

What do you mean by update the baselines?
Rebase on the origin/master?

@mwestphal
Copy link
Contributor

I mean that your change has an impact on some test that had an incorrect baseline because of the dry run issue. You can run these test locally and recover the baseline

@mwestphal
Copy link
Contributor

You can look in the CI results to see which test are impacted.

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