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

Remove date dependent screenshot path #1002

Closed

Conversation

dosas
Copy link
Collaborator

@dosas dosas commented Oct 11, 2023

  • Do not implicitly overwrite settings.selenium.screenshots_path
  • Date is already set in the filename
  • Reduce datetime dependency

See also #989

* Do not implicitly overwrite settings.selenium.screenshots_path
* Date is already set in the filename
* Reduce datetime dependency
@dosas dosas changed the title Remove date dependent screenshot path: Remove date dependent screenshot path Oct 11, 2023
@omkarkhatavkar
Copy link

Can one of the admins verify this patch?

Copy link
Contributor

@sambible sambible left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. No real reason to have the date both places, I'd agree.

@Gauravtalreja1 Gauravtalreja1 added 6.12.z CherryPick PR needs CherryPick to previous branches 6.13.z 6.14.z labels Oct 20, 2023
@Gauravtalreja1 Gauravtalreja1 requested a review from a team October 20, 2023 06:56
Copy link
Contributor

@lhellebr lhellebr left a comment

Choose a reason for hiding this comment

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

LGTM, makes sense, ACK if this is tested.

@dosas
Copy link
Collaborator Author

dosas commented Oct 24, 2023

Are there any actions left required from me?

@ogajduse
Copy link
Member

ogajduse commented Oct 24, 2023

Are there any actions left required from me?

I can not see any. Let me run our PR tester, that should show us if something broke on our end.

@ogajduse
Copy link
Member

ogajduse commented Oct 24, 2023

trigger: test-robottelo
pytest: tests/foreman/ui/test_architecture.py tests/foreman/ui/test_bookmarks.py tests/foreman/ui/test_hardwaremodel.py tests/foreman/ui/test_host.py

@ogajduse
Copy link
Member

ogajduse commented Oct 24, 2023

PRT did not trigger a job build in our internal infra. @omkarkhatavkar Can you please take a look at what might be wrong?

now.strftime('%Y-%m-%d'),
)
path = settings.selenium.screenshots_path

Copy link

@omkarkhatavkar omkarkhatavkar Oct 25, 2023

Choose a reason for hiding this comment

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

@dosas Thanks for creating the PR, I appreciate the work you added. Looking at the function doc string this was added long back, looking at this statement

All directories will be created if they don't exist. Make sure that the user running Robottelo has the right permissions to create files and directories. this could be the reason this was added. I see some value in that. Also, I see some benefits as follows

  • It dynamically creates directories based on the current date, ensuring that the screenshots or files are organized in a structured manner. Imagine if someone specifies the '/tmp' path here; all the screenshots would be jumbled together in a single directory. It's much better to have them organized by date for better isolation.

@jyejare, @ogajduse what are your thoughts?

Copy link
Collaborator Author

@dosas dosas Oct 25, 2023

Choose a reason for hiding this comment

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

There is an easy fix for that don't use /tmp but use /tmp/screenshots (I assume this is why robottelo needs the permissions).
Don't take away all responsibility from the user.

I would even go as far and not put the date information into the filename, since this is duplicate information that is already provided by the filesystem.

Copy link

@omkarkhatavkar omkarkhatavkar Oct 25, 2023

Choose a reason for hiding this comment

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

I would even go as far and not put the date information into the filename, since this is duplicate information that is already provided by the filesystem.

I have a different perspective on this. If we don't include the date and time in the screenshot filenames using (DateTime) f'{self.name}-screenshot-YYYY-mm-dd_HH_MM_SS.png', there's a risk of overwriting the same screenshots when running the test again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point I did not think of that

Copy link

@omkarkhatavkar omkarkhatavkar left a comment

Choose a reason for hiding this comment

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

I have reviewed the proposed changes in this pull request in light of the current requirements within Airgun and Robottelo, as indicated in my previous review comments https://github.com/SatelliteQE/airgun/pull/1002/files#r1371209526. After careful consideration, I find that these changes do not align with the current project requirements and standards.

Therefore, I regret to inform you that I am disapproving of this PR at this time. If you have any questions or require further clarification regarding the decision, please don't hesitate to reach out, and we can discuss how to best proceed.

@dosas dosas closed this Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z 6.13.z 6.14.z CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants