Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Make click_failed_*.png world-readable #807

Closed

Conversation

eagletmt
Copy link
Contributor

@eagletmt eagletmt commented Jul 2, 2015

When we run tests using capybara-webkit in CI server, all users should
be able to read click_failed_*.png for debugging.

When we run tests using capybara-webkit in CI server, all users should
be able to read click_failed_*.png for debugging.
@mhoran
Copy link
Collaborator

mhoran commented Jul 2, 2015

Thanks for the pull request, @eagletmt. We're actually going to be removing this functionality, as capybara-webkit doesn't seem to be the right place to handle this. Check out #800 for further discussion. It may be worth kicking off an upstream discussion to figure out how to work this in.

@mhoran mhoran closed this Jul 2, 2015
@mhoran
Copy link
Collaborator

mhoran commented Jul 2, 2015

Note that a PR to do the same to the standard Render command would be welcome -- however we don't like to merge pull requests without tests.

@jferris
Copy link
Member

jferris commented Jul 2, 2015

I'm not sure it's a good idea for us to make decisions for users about who has access to their files. I think you can control how new files are created by changing your umask on CI.

@mhoran
Copy link
Collaborator

mhoran commented Jul 2, 2015

That's a good point. After commenting I noticed the files screenshots are created with world read on my machine. Sounds like there's a umask issue affecting the reporter.

@eagletmt
Copy link
Contributor Author

eagletmt commented Jul 2, 2015

It's not umask problem.
At least in Qt 5.4.2, QTemporaryFile seems to create a file with 0600 permission.
https://github.com/qtproject/qtbase/blob/5.4.2/src/corelib/io/qtemporaryfile.cpp#L176-L178

eagletmt% umask
022
eagletmt% git rev-parse HEAD
3ef6732baa2a3ed7a1b7ba5d6a464485779cebd4
eagletmt% bundle exec rspec spec/integration/session_spec.rb:308
Run options:
  include {:locations=>{"./spec/integration/session_spec.rb"=>[308]}}
  exclude {:full_description=>/Capybara::Session webkit Capybara::Window #(size|resize_to|maximize|close.*no_such_window_error)/, :skip_on_qt4=>false, :skip_if_offline=>false, :selenium_compatibility=>false, :skip_on_jruby=>false, :skip_on_windows=>false, :requires=>#<Proc:0x00000003ce9778>}

Capybara::Session
  iframe app
    raises an error if an element is obscured when clicked

Finished in 1.34 seconds
1 example, 0 failures
eagletmt% ls -l /tmp/click_failed_*
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_J20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_L20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_M20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_S20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_T20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_X20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_h20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_n20297.png
-rw------- 1 eagletmt eagletmt 17242 2015-07-02 23:39 /tmp/click_failed_o20297.png

@jferris
Copy link
Member

jferris commented Jul 2, 2015

@eagletmt interesting. I guess it makes sense for Qt to be generally paranoid about temporary files.

We only use QTemporaryFile in the automatic screenshot saving, though, which is being removed in #800. In the regular save_screenshot path, we use QImage.save, which seems to respect umask.

@eagletmt eagletmt deleted the world-readable-click_failed branch July 2, 2015 16:06
@eagletmt eagletmt restored the world-readable-click_failed branch July 2, 2015 16:07
@eagletmt
Copy link
Contributor Author

eagletmt commented Jul 2, 2015

Okay, I understand this feature will be removed soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants