Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Provide a fallback chromedriver for other Linuxes as well#2901

Merged
semenko merged 1 commit intoEFForg:masterfrom
Tenzer:chromium-script-other-linuxes
Sep 15, 2015
Merged

Provide a fallback chromedriver for other Linuxes as well#2901
semenko merged 1 commit intoEFForg:masterfrom
Tenzer:chromium-script-other-linuxes

Conversation

@Tenzer
Copy link
Copy Markdown
Contributor

@Tenzer Tenzer commented Sep 15, 2015

When running the test scripts (and thus pre-commit hook) on a Linux distribution which is neither Ubuntu or Debian, the chromedriver_path variable isn't set at all, and the script will then always fail with a error such as this:

Traceback (most recent call last):
  File "test/chromium/script.py", line 51, in <module>
    driver = webdriver.Chrome(chromedriver_path, chrome_options=chromeOps)
NameError: name 'chromedriver_path' is not defined

This fixes that by providing the fallback value of just "chromedriver" to other Linux distributions, which at least makes it work on my machine (running Arch Linux).

@semenko
Copy link
Copy Markdown
Contributor

semenko commented Sep 15, 2015

Ooof, yeah, good call. That logic got pretty silly over a couple of merges (that's a new script since ~last week).

Thanks a bunch!

semenko added a commit that referenced this pull request Sep 15, 2015
Provide a fallback chromedriver for other Linuxes as well
@semenko semenko merged commit 4d5d0ac into EFForg:master Sep 15, 2015
@Tenzer
Copy link
Copy Markdown
Contributor Author

Tenzer commented Sep 15, 2015

You're welcome. It could probably be cleaner by putting chromedriver_path = "chromedriver" above the entire if statement, and then scrapping the last two branches, but I wanted to make the change as small as possible.

@semenko
Copy link
Copy Markdown
Contributor

semenko commented Sep 15, 2015

Yeah -- definitely. Testing got significantly restructured last week, so there are a bunch of hacks hanging around to make things work.

@TheNavigat want to take a look now that Travis/Debian, etc. have been fixed, and see if anything can be cleaned up?

@TheNavigat
Copy link
Copy Markdown
Contributor

The chromedriver_path = "chromedriver" above the entire if statement is a good idea. However, not doing that has a reason. I simply wanted to make sure that every listed distro is fully supported instead of adding support for distros that might not work. Quite close to the reason why rulesets guides were changed.

Since this PR basically ruins my whole "fully supported distros only" point, you can go ahead and add the whole path setting thing above the if statement.

@semenko Sure, I'll check that in a few!

@Tenzer
Copy link
Copy Markdown
Contributor Author

Tenzer commented Sep 15, 2015

Oh, sorry, I wasn't aware of that. What does it take to be a fully supported distro then?
One problem with that - at least when using Python 2, is that Arch Linux apparently doesn't fill in a distribution name while it does however work on Python 3:

[jeppe@jeppe ~]$ python2 -c 'import platform; print(platform.linux_distribution())'
('', '', '')
[jeppe@jeppe ~]$ python3 -c 'import platform; print(platform.linux_distribution())'
('arch', '', '')

@semenko
Copy link
Copy Markdown
Contributor

semenko commented Sep 15, 2015

I disagree with @TheNavigat -- I think it's totally fine to provide a best effort "hey this might work" on other distros.

Clearly people are developing on non-Debian flavors -- and if people want to submit patches to make those distros work better, that's great!

Let's just set chromedriver to look in the path by default -- and if Arch, BSD, etc. run into fun problems, hopefully we'll get equally fun fixes.

@TheNavigat
Copy link
Copy Markdown
Contributor

@Tenzer, there are no specific rules, but basically I thought that we need to make sure everything works on the distro before adding it to the script.

And that's weird... However, if it works then we're good.

@semenko Alright then, let's do that instead.

@Tenzer
Copy link
Copy Markdown
Contributor Author

Tenzer commented Sep 15, 2015

I have submitted #2903 which makes the change suggested.

@Tenzer Tenzer deleted the chromium-script-other-linuxes branch September 15, 2015 15:15
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.

3 participants