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

Update pyvirtualdisplay #831

Closed

Conversation

MollieBakal
Copy link
Contributor

@MollieBakal MollieBakal commented Dec 14, 2020

Closes #694

@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #831 (fc7c772) into CommandRefactoring (4d7db91) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           CommandRefactoring     #831   +/-   ##
===================================================
  Coverage               42.22%   42.22%           
===================================================
  Files                      29       29           
  Lines                    3214     3214           
===================================================
  Hits                     1357     1357           
  Misses                   1857     1857           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d7db91...1ac71d3. Read the comment docs.

@MollieBakal
Copy link
Contributor Author

Linking the issue #694 -- also, please note the first 5 commits here were already merged

dependabot bot added 3 commits December 14, 2020 12:03
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](npm/ini@v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@vringar vringar self-requested a review December 14, 2020 11:17
Copy link
Contributor

@vringar vringar left a comment

Choose a reason for hiding this comment

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

Thank you for creating this PR! I've left a couple of minor things and will comment some more on the issue.

environment.yaml Show resolved Hide resolved
openwpm/deploy_browsers/deploy_firefox.py Show resolved Hide resolved
test/test_mp_logger.py Show resolved Hide resolved
Comment on lines 1 to 26
from functools import partial
from typing import List

from openwpm.command_sequence import CommandSequence
from openwpm.task_manager import TaskManager

from .openwpmtest import OpenWPMTest
from .utilities import BASE_TEST_URL


class TestXVFBDisplay(OpenWPMTest):
"""Test the XVFB display option to see if it runs and shuts down properly after a command is given"""

def get_config(self, data_dir=""):
return self.get_test_config(data_dir, display_mode="xvfb")

def test_display_shutdown(self):
manager_params, browser_params = self.get_config()
TEST_SITE = BASE_TEST_URL + "/test_pages/simple_a.html"
manager = TaskManager(manager_params, browser_params)

sequence = CommandSequence(TEST_SITE)
sequence.get()
sequence.save_screenshot()
manager.execute_command_sequence(sequence)
manager.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think that this test tests anything that isn't tested by test_simple_commands.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per request later, added different command. Had not seen that displaymode=xvfb was tested, sorry.

@vringar vringar changed the title update of pyvirtualdisplay as per #694 Updated of pyvirtualdisplay Dec 14, 2020
@vringar
Copy link
Contributor

vringar commented Dec 14, 2020

When writing this comment I noticed one thing.
If we could guarantee that the Display object always gets stoped then we could just remove all of the other code.
And since the entire function is already wrapped in a try/except-block we could add a finally that contains the changes you made in the shutdown block.
This way, no matter how we exit the function we'd stop the Display properly.

Would you want to do this?
Could you also rebase this PR on the CommandRefactoring branch and then create a test with a custom command that throws an exception, to see if the lock file gets removed properly, even when there is an exception.

@MollieBakal
Copy link
Contributor Author

These commits aren't done--I'm having some trouble with the environment

@MollieBakal
Copy link
Contributor Author

By rebasing based on CommandRefactoring, it seems to have created a number of unintended commits--I don't know if that was unintentional, or if I should file another pull request to that branch instead of master.

@MollieBakal MollieBakal changed the title Updated of pyvirtualdisplay Update pyvirtualdisplay Dec 15, 2020
@MollieBakal MollieBakal requested a review from vringar December 15, 2020 07:39
@vringar vringar changed the base branch from master to CommandRefactoring December 15, 2020 10:32
openwpm/deploy_browsers/deploy_firefox.py Outdated Show resolved Hide resolved
test/test_mp_logger.py Show resolved Hide resolved
test/test_xvfb_browser.py Show resolved Hide resolved
@vringar
Copy link
Contributor

vringar commented Dec 15, 2020

By rebasing based on CommandRefactoring, it seems to have created a number of unintended commits--I don't know if that was unintentional, or if I should file another pull request to that branch instead of master.

I have changed this PR to target the CommandRefactoring branch. Unfortunately this is always a bit messy with GitHub, but I'll ignore all files that I know you didn't touch.

@vringar
Copy link
Contributor

vringar commented Dec 15, 2020

These commits aren't done--I'm having some trouble with the environment

If you elaborate on what these troubled are, I'd be happy to help you.

Co-authored-by: Stefan Zabka <zabkaste@informatik.hu-berlin.de>
@MollieBakal
Copy link
Contributor Author

Thanks, but I think it was just an issue with cached files? I reran install.sh and that seems to have cleared it up.

test/test_xvfb_browser.py Outdated Show resolved Hide resolved
@vringar vringar self-requested a review December 16, 2020 16:58
@vringar
Copy link
Contributor

vringar commented Dec 16, 2020

Thanks for fixing this issue :)
I'll wait for @englehardt to merge the CommandRefactoring into master before I merge this.
Do you want remove the __init__ in the meantime?

MollieBakal and others added 2 commits December 16, 2020 13:52
Co-authored-by: Stefan Zabka <zabkaste@informatik.hu-berlin.de>
@MollieBakal
Copy link
Contributor Author

Yep! Thank you

@vringar vringar closed this Jan 9, 2021
@vringar vringar deleted the branch openwpm:CommandRefactoring January 9, 2021 10:15
@vringar vringar mentioned this pull request Jan 11, 2021
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.

Update pyvirtualdisplay to >1.0.0 version
3 participants