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

Merged
merged 19 commits into from
Dec 26, 2024
Merged

[FIX] issue 1637 #1720

merged 19 commits into from
Dec 26, 2024

Conversation

t-h2o
Copy link
Contributor

@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
    • screenshot with no-config

@mwestphal
Copy link
Contributor

Do you need help moving forward @t-h2o ?

@t-h2o
Copy link
Contributor 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
Contributor 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
@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 :)

t-h2o added a commit to t-h2o/f3d that referenced this pull request Dec 18, 2024
@t-h2o
Copy link
Contributor 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.

@mwestphal
Copy link
Contributor

Hi @t-h2o

We will need this before January 3 to start the release cycle. So you want me to take over the PR or do you want to finish it ?

@t-h2o
Copy link
Contributor Author

t-h2o commented Dec 21, 2024

So you want me to take over the PR or do you want to finish it ?

No/Yes, my next update will be before the Mon Dec 23 11:00:00 PM CET 2024.

@mwestphal
Copy link
Contributor

So you want me to take over the PR or do you want to finish it ?

No/Yes, my next update will be before the Mon Dec 23 11:00:00 PM CET 2024.

Thanks for the feedback! Let me know if you need any help.

@mwestphal
Copy link
Contributor

You now need to rebase on latest master, many changes have been merged.

@mwestphal
Copy link
Contributor

I updated other image with the function, for each failed test, I ran the function

$ function f3d-update-image() {
  ctest -R "${1}"
  mv Testing/Temporary/"${1}".png testing/baselines/"${1}".png
  git add -p <<< y
  git commit -m "test: update ${1}"
}
$ f3d-update-image TestInteractionConsoleOpenWarningKeyboard

Indeed, all new baselines are correct!

t-h2o added 18 commits December 25, 2024 23:50
--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
bin/f3d \
  --output testing/baselines/TestNoConfigWithConfig.png \
  --no-config \
  --resolution=300,300 \
  --config testing/configs/complex.json \
  testing/data/f3d.glb
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.

one last small change :)

@t-h2o
Copy link
Contributor Author

t-h2o commented Dec 26, 2024

Yet, we should be good :)

@mwestphal mwestphal merged commit 7a649d4 into f3d-app:master Dec 26, 2024
43 checks passed
@mwestphal
Copy link
Contributor

Thanks for your contribution @t-h2o !

@t-h2o t-h2o deleted the issue-1637 branch December 26, 2024 14:48
@t-h2o
Copy link
Contributor Author

t-h2o commented Dec 26, 2024

Nice to participate in the open source world!
I learned a lot from this contribution.
Thanks for the review.

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